Archive for the ‘Ubuntu’ Category

Locking down Firefox on Ubuntu

Sunday, January 28th, 2007

Edit /usr/lib/firefox/firefox.cfg to read:

//
lockPref("app.update.enabled", false);
lockPref("network.proxy.http", "192.168.1.3");
lockPref("network.proxy.http_port", 3128);
lockPref("network.proxy.type", 1);
lockPref("network.proxy.no_proxies_on", "localhost, 127.0.0.1, 192.168.0.0/16, 172.0.0.0/8");
lockPref("network.proxy.share_proxy_settings", true);
lockPref("browser.startup.homepage", "http://www.google.com/ncr");

Find any additional settings to lock down by entering “about:config” in the Firefox address bar. The resulting list is all of the settings that can be locked.

UPDATE: Ubuntu has an annoying habit of overwriting this file every time it updates Firefox. My short-term work-around is to copy the contents of firefox.cfg to firefox.cfg.local and then setting a root cron job (using “sudo crontab -e”) with the following entry (copies the .local file back over the .cfg file every hour - so the longest you’re without locked prefs is that hour.  Make it shorter if you prefer.):

# Restore firefox.cfg to preferred configuration every hour.
# Corrects bug where firefox.cfg gets overwritten by update.
0 * * * * cp /usr/lib/firefox/firefox.cfg.local /usr/lib/firefox/firefox.cfg

HP LaserJet 1020 - Getting it to work in Ubuntu

Sunday, November 19th, 2006

The foo2zjs driver shipped with Ubuntu Edgy doesn’t work. Uninstall it using the Synaptic package manager. Then install the “build-essential” package using Synaptic. This allows you to compile source code. Then get foo2zjs from the homepage. Follow the directions at the bottom of the homepage. Works like a charm.

The Ubuntu bug report on foo2zjs says that this has been fixed, but didn’t make it into Edgy. As of the writing of this post, it is not in the package repository.

Update from a Friend:
On Feisty you do not need to rebuild the foo driver.

Just do this:
getweb 1020
sudo arm2hpdl sihp1020.img > sihp1020.dl
sudo cp sihp1020.dl /usr/share/foo2zjs/firmware/

see:
https://bugs.launchpad.net/ubuntu/+source/foo2zjs/+bug/96454

BackupPC on Ubuntu

Saturday, November 11th, 2006

BackupPC is a great backup program for an Ubuntu server. However, it doesn’t work “out of the box” due to Ubuntu’s lack of a root account. This is what I had to do to make it work.

Modify /etc/backuppc/config.pl

  • Run “sudo vim /etc/backuppc/config.pl”
  • Add sudo to the TAR Client and ClientRestore commands
    • Change $Conf{TarClientCmd} to read
      $Conf{TarClientCmd} = 'sudo $tarPath -c -v -f - -C $shareName'
      . ' --totals';
    • Change $Conf{TarClientRestoreCmd} to read
      $Conf{TarClientRestoreCmd} = 'sudo $tarPath -x -p --numeric-owner --same-owner'
      . ' -v -f - -C $shareName';
  • Change $Conf{BackupFilesExclude} (for my config - these seem to all be temp files that you don’t really need to backup) to read
    $Conf{BackupFilesExclude} = ['/proc', '/dev', '/tmp', '/mnt', '/media', '/sys', '/lost+found', '/usr/src', '/var/lib', '/var/tmp', '/var/cache', '/var/spool', '/var/run', '/var/lock', '/var/games', '/home/*/.Trash', '/home/*/.mozilla/*/*/Cache', '/home/*/.mozilla/*/*/Cache.Trash'];
  • Change $Conf{XferMethod} to read
    $Conf{XferMethod} = 'tar';
  • Change $Conf{TarFullArgs} to read
    $Conf{TarFullArgs} = '$fileList';
  • Change $Conf{TarIncrArgs} to read
    $Conf{TarIncrArgs}= '--newer=$incrDate $fileList';

Add backuppc to the sudoers list

  • Run “sudo visudo”
  • At the bottom of the file add
    • # Allow backuppc to run tar without a password
      backuppc ALL=NOPASSWD: /bin/tar

Delete all of the text from /etc/backuppc/localhost.pl. This will prevent the “per-PC” defaults from overriding the changes above.
By adding sudo to the TAR commands in /etc/backuppc/config.pl and adding backuppc to the sudoers list, you’re able to perform both backups and restores directly from the web-based interface.