Monthly Archive for September, 2006

Brother MFC-210C Printer

To get this to work in Linux with CUPS you’ll need to get the drivers from Brothers Linux Support. For printing you’ll need to get the LPR and CUPS wrapper for your model.

If you have an RPM or DEB based distro you can easily follow their instructions, but if you have a source based it’ll take some work. I managed to follow denials instructions with successful results, here’s the quick howto.
This should work with any of the Brother models from local printing.

- You need rpm2targz

- Convert the LPR driver and CUPSwrapper into tar.gz files. Replace the package name here with the one yours uses
$ rpm2targz brhl2040lpr-1.1.2-2.i386.rpm
$ rpm2targz cupswrapperHL2040-1.0.0-1.i386.rpm

- unpack the RPMS$ tar xzf cupswrapperHL2040-1.0.0-1.i386.tar.gz
$ tar xzf brhl2040lpr-1.1.2-2.i386.tar.gz

- As root copy the files to their working directories# cp usr/bin/brprintconflsr /usr/bin/.
# cp usr/lib/libbrcomplpr.so /usr/lib/.
# mv usr/local/Brother /usr/local/

- Modify the /usr/local/Brother/cupswrapper/cupswrapperHL2040-1.0.0 script to point to /etc/init.d/cupsd instead of /etc/init.d/cups; this change is required in three locations in this file.

- Run the /usr/local/Brother/cupswrapper/cupswrapperHL2040-1.0.0 script to set up the Brother HL2040 laser.

- Create a symbolic link from /usr/local/Brother/inf/brHL2040rc to /usr/local/Brother/inf/brPrintList.

cd /usr/local/Brother/inf
ln -sf brHL2040rc brPrintList

That should be all and the is available. A test page can e printed from the CUPS web interface at http://localhost:631

If I get to any othe other functions of the printer (scanning, copying, faxing) I’ll update them here, Brother has the drivers for these on the site also so I don’t expect much trouble.

IP Address email script

Here’s a little script put together that will check your external IP Address and send an email if that address was to change and include the new IP Address

I suggest putting this in /tmp unless you clean out /tmp completely. This can be run manually but of course the best way is as a cron job, here’s how mine is set which will check at the top of every hour

0 * * * * /tmp/ipcheck/oldip.sh

WhatIsMyIp.com changes their formatting at times so I’ll update my upload script when I need to make changes to keep it working.

Just be sure to make the changes for my email, I really don’t care what other people’s IPs are :)

Gnome Default Browser

For changing the default browser for Gnome apps like Evolution, use this command

gconftool-2 --set /desktop/gnome/url-handlers/http/command -t string 'firefox %s'

Tar’ing by Erik Mathis

Tar without compression
tar -cvf filename.tar /path/to/files

-c = create
-f = Filename (-f should always be last when using syntax)
-v = Verbose
-z = Compress

Tar WITH compression
tar -zvcf filename.tar.gz /path/to/files

#notice have to add the .gz extension.
-Z runs the old compress app.

Create Tar while keeping the path locations
tar -zPvcf filename.tar.gz /path/to/file

-P (absolute path)

Create Tar with absolute path but exclude files/directories
tar -zPvcf myhomebackup.tar.gz –exclude /home/erik/temp /home/erik

–exclude = Used after the filename and before the included directories

Backup only single files from different locations.
Create a file (use the editor of your choice…vi, emacs, pico, gedit…) and enter the full path to the files you want backed up. (These files need to be readable to the user running the backup)

Example: vi backup.list
/etc/mail/sendmail.cf
/usr/local/apache/conf/httpd.conf
/home/erik/scripts

tar -zPvcf backup.tar.gz -T locations

-T = read backup list from file

Now if you want to backup the whole drive. Then you will have to exclude lots of files like /var/log/* and /usr/local/named/*

tar -zPvcf fullbackup.tar.gz -X /path/to/excludefile -T /path/to/locationsfile

-X = read exclude list from file

To do an update to an archive it first needs to be uncompressed
gunzip /path/to/myhomebackup.tar.gz

Then updated and compressed
tar -Puvf myhomebackup.tar /home/erik | gzip mybackup.tar

-u update archive

If you want to extract the tarball that is compressed
tar -zxvf filename.tar.gz

-x extract

If it is not compressed then
tar -xvf filename.tar

I have included a little Perl script that I made so I can run it as cron job everynight and get a full backup each time. It wouldn’t be that hard to update the tarball but I just like full backups.
Feel free to use it.

#!/usr/bin/perl
#sysbkup.pl
#Created by Erik Mathis hornet@fluidgravity.com 7/02
#Change These paths to fix your needs.
my $filename=”/home/sysbkup/backup”;
my $exclude=”/home/erik/exclude”;
my $data=”/home/erik/locations”;
my $tar=”\.tar”;
my $gz=”\.gz”;
$file=$filename.$tar.$gz;
system (”tar -Pzcvf $file -X $exclude -T $data”);

Gamma Correction

If for whatever reason the Gamma (or brightness) of your display gets messed up, being to light or too dark, from a poorly exited app…”xgamma -gamma 1″ will reset it without rebooting.