Introduction About Site Map

XML
RSS 2 Feed RSS 2 Feed
Navigation

Main Page | Blog Index

Archive for the ‘Linux’ Category

Cron-based Backup

Servers

Regardless of your operating system, good practice is to put recently added/changed files in a container (let us call it transfer). Files should be accumulated in transfer until the next backup cycle. Once a backup of that container is obtained, files can finally be moved appropriately to their destined directory. The notes that follow deal with a method of automatically backing up transfer using a server or another hard-drive. It also places emphasis on back-up of Web sites — a task which can become closely-related.

Note: instructions are Linux/Mac-specific, but can be adapted to Windows

Until recently, I used to get gunzipped tar archives of all my sites from CPanel. I did this every morning. Some weeks ago I automated part of the process by getting more crucial (and frequently-changing) pages and storing them remotely. It all works as follows:

Set up a set of batch scripts (let us call them dummy1..2) which include the following commands:


cd /home/roy/Main/Transfer_Archives/Sites/Roy/
wget -r -l1 -t1 -N -np -erobots=off http://schestowitz.com/

If you are not sure what the latter is doing, type in man wget and read the documentation. Then, set up cron jobs which include the following tasks:

Get local copies of important Web pages (see above)
38 23 * * * /home/roy/Main/Transfer_Archives/Sites/dummy1
38 23 * * * /home/roy/Main/Transfer_Archives/Sites/dummy2
...
Compress all the pages
50 23 * * * tar czvf /home/roy/Main/Transfer_Archives/www-`date +%Y-%m-%d`.tar.gz /home/roy/Main/Transfer_Archives/Sites
Make a copy of compressed pages
58 23 * * * cp -rf /home/roy/Main/Transfer_Archives/ /home/server2/transfer/roy

The last line puts a copy on the SAN, just to be 100% covered. Such scripts allow you to sleep while your sites/files are being backed up.

Keyboard Accelerators

Shortcut keysMice are used excessively while much more precise and efficient ways of navigation exist. Generally, when using an application often enough, one needs to learn and practice commonly-used menu accelerators, e.g. CTRL+S to save, or CTRL+ENTER to despatch an E-mail message.

Taking accelerators into a more advanced level, application invocation can be purely keyboard-based.

For Windows users:

Windows allows items located at the desktop to have CTRL+ALT shortcuts assigned to them. I have used this feature extensively for many years. The only flaw is that the desktop rapidly becomes bloated. To get these shortcuts set up, steer towards Properties in the context menu.

Linux/Mac (Panther):

Keyboard shortcuts can be assigned to applications/commands using XBindkeys. Example shortcuts are given in my XBindkeysRC file.

If you are using KDE, you can also use window manager accelerators or mouse gestures, for example ALT+mouse primary buttons to drag windows around.

Recursive Downloads

schestowitz.com: Gallery
How would you download an entire gallery like the one above?

There should no longer be need for repeated downloads.

Have you ever found yourself downloading images from a gallery? A mechanic series of clicks to get images one by one? There is a better way.

The simple method: If you are using Firefox as your Web browser, use the FlashGot extension.
The better method: If you are working under Linux or Mac OS X you can become even more efficient. Use wget as in the example below and replace http://SITE with the Web address to be downloaded from recursively.

wget -r -l2 -t1 -N -np -erobots=off http://SITE

Keep the volume of downloads low or else this will be considered an abuse and frowned upon.

Resource Hog

Moderate use of computer resources and good net citizenship both are issues which are close to my heart. I recently started to worry that, quite inevitably, I have become one among the culprits. At the time of writing, I use about 30 Pentium 4′s, some of which will run computer vision experiments for 24 hours. This is done due to urgency (a near deadline), but my general advice is to always set the priority of your tasks as low as possible so that the scheduler prioritises other users.

I typically connect to remote computers via SSH. I have made my ‘hogging’ scripts public in case somebody is interested in modifying them for personal purposes.

Multiple SSH sessions
Remote sessions, shaded on the left monitor (click to enlarge)

Software Communists

Bill Gates
Bill Gates arrested in his younger days (photo in public domain)

President of the Free Software Foundation, Richard Stallman, writes in CNET:

…Thanks to Mr. Gates, we now know that an open Internet with protocols anyone can implement is communism…
 
…Mr. Gates’ secret is out now–he too was a “communist;” he, too, recognized that software patents were harmful–until Microsoft became one of these giants…

Linux Laptop Insanity

Laptop

Wal-Mart break a barrier by selling a Linux-based laptop for under $500. According to CNET:

The computer, dubbed Balance, comes loaded with the Linspire operating system and the OpenOffice.org office suite, the companies said.

The companies said Balance is the lowest-priced laptop currently available with an operating system and an office suite. It features a VIA C3 1-GHz processor, 128MB RAM, a 30GB hard drive, a CD-ROM drive and a 14.1-inch liquid crystal display…

Catalyst2

catalyst2The experience of choosing a Web host is very baffling. One has to rely on word of mouth and the features provided by the host are rarely understood. I have had bad experiences with slow hosts that offer little or no support, but my current hosts, catalyst2, have been impeccable. Their service scope is global and I warmly recommend them.

Retrieval statistics: 21 queries taking a total of 0.101 seconds • Please report low bandwidth using the feedback form
Original styles created by Ian Main (all acknowledgements) • PHP scripts and styles later modified by Roy Schestowitz • Help yourself to a GPL'd copy
|— Proudly powered by W o r d P r e s s — based on a heavily-hacked version 1.2.1 (Mingus) installation —|