Pages

April 15, 2007

Install network LaserJet fast way

In this tip for Linux and Solaris admins, we are going to install network LaserJet printer into system. I assume printer has own ip address (for example 11.22.33.44). Be sure you have CUPS 1.1 installed. Now type:

lpadmin -p LaserJet -E -v socket://11.22.33.44 -m laserjet.ppd

That's all, you can modify your configuration at location http://localhost:631/admin

April 11, 2007

Alternate break sequence for Solaris (8,9,10)

Have you been in situation, when you were connected to Sparc machine using terminal, which didn't allow you to send break sequence ? Well, this tip may help you. To bring the system to the OK prompt send the following key sequences:
 <cr> ~ ^b     (enter  tilde  ctrl+b)

To enable this feature, be sure to have this in file /etc/default/kbd
KEYBOARD_ABORT=alternate

March 30, 2007

Burn .iso under Linux 2.6.18 fast way

This tip is very simple, I assume you have cdrecorder device /dev/hdc, so type as root this:

cdrecord -v dev=/dev/hdc speed=12 -dao driveropts=burnfree -eject -data /path/to/isofile.iso

March 23, 2007

How to create MySQL snapshot

Because people always ask me how to backup their database, I decided to write this minimalistic howto. It will do correct snapshot even if you have MyISAM or InnoDB tables, version of MySQL doesn't matter (3.23, 4.0, 4.1, 5.0). Howto has only 4 steps, so read on..

I assume your MySQL data dir is /var/lib/mysql and you have enough space in /tmp. Open two terminals, in the first one connect to MySQL and do these steps:

1. (optional) read third section of page
2. terminal one: FLUSH TABLES WITH READ LOCK; #do NOT exit mysql prompt
3. terminal two: tar -cvzf /tmp/mysql-snapshot.tar.gz /var/lib/mysql
4. terminal one: UNLOCK TABLES;

Now you have correct snapshot (/tmp/mysql-snapshot.tar.gz) of your MySQL DB.