Categories
Blog Computers Linux

Ubuntu wallpapers

For every version of Ubuntu there is a set of wallpaper images. Each version has its own set and doesn’t include the old ones. However, it is very simple to install all previous versions by running:

apt-cache search ubuntu-wallpapers- | awk '{ print $1; }' | xargs apt-get -y install

As of today (January 2015) this will install the wallpapers from:

  • Karmic (9.10)
  • Lucid (10.04)
  • Maverick (10.10 LTS)
  • Natty (11.04)
  • Oneiric (11.10)
  • Precise (12.04 LTS)
  • Quantal (12.10)
  • Raring (13.04)
  • Saucy (13.10)
  • Trusty (14.04 LTS)

If you want to use them for other purposes you will find the images in /usr/share/backgrounds/. I use them as wallpaper in OS X. In return I may just use the Yosemite wallpapers in Ubuntu to really confuse people.

Categories
Linux

Switch BU-353 to NMEA mode

BU-353 is a nice little USB based GPS receiver that I use for several types of project. Straight out of the wraps it defaults to outputting NMEA data at 4800 baud which is exactly what I want. However, it also supports the SIRF binary protocol and may switch to that format. This can happen if you connect it to a system that uses gpsd. That daemon supports both the NMEA and the SIRF protocol but will switch the GPS to the latter if it can.

So how do you switch it back? Maybe you can just leave it be and the supercap inside will discharge and it will revert to its default settings. The FAQ kind of hinted at that. However, I wasn’t patient enough to see if that works so I needed a quicker option.

It turns out that if you use Windows it is not too difficult. You can follow any one of several guides on the net, for instance this, straight from the horse’s mouth.

But I needed a way to do this from Linux and this is how.

First make sure you have gpsctl in your path. If it is not installed you can install it by running:

sudo apt-get install gpsd-clients

I am doing this on an Ubuntu system but it should work on most Debian derivatives.

Then connect your BU-353 and type (assuming that your GPS device turns up at /dev/ttyUSB0):

sudo stty -F /dev/ttyUSB0 4800
sudo gpsctl -n -D 4 /dev/ttyUSB0

Then it should be back on NMEA.

Categories
Computers Linux Mac

Create bootable Ubuntu USB stick

I don’t create bootable USB sticks that often but every time I do it I think that it’s harder than it really is and start to search the web for walkthroughs.

This post could also simply be written: Look at the Ubuntu download page.

Here is the process for OS X:

  1. Download ISO file of the operating system you want to put on the USB stick
  2. Open the terminal
  3. Convert the ISO file using the convert option of hdiutil: hdiutil convert -format UDRW -o /path/to/target.img /path/to/source.iso
  4. Run diskutil list to get the current list of devices
  5. Insert the USB stick
  6. Run diskutil list again to determine the device node assigned to your USB stick
  7. Unmount the USB stick: diskutil unmountDisk /dev/diskN
  8. Write the image to the USB stick: sudo dd if=/path/to/disk.img of=/dev/rdiskN bs=1m
  9. Eject the USB stick: diskutil eject /dev/diskN
Categories
Computers Linux

Acerfand crashes Acer Aspire One 110

I have an Acer Aspire One 110 Ab that I have upgraded with 1 GB RAM (for a total of 1.5 GB) as well as upgrading the BIOS to version 3309.

Before upgrading the BIOS, which was done in an attempt to improve the stability of 802.11 networking, the acerfand program worked wonders to keep the fan running as little as possible.

Once I upgraded the BIOS to 3309 the acerfand program no longer worked. Instead of turning the fan off the fan was running at full speed for a second every other second.

On March 14th, version 0.07 of acerfand was released and I tried it out in the hope that it would fix the fan issue for by BIOS version. While it did turn off the fan, it caused the computer to reboot after a few minutes. Clearly, this was even worse than the alternative.

I did some trial and error and changed the value 0x20 to 0x21 (two places) for the 3309 specific values. In other words, roughly half-way down in the file, my acerfand file now looks like this:

"${BIOS_VERSION_3309}")
	#change: handle 3309 seperate 0xAF -> 0x20
	R_FAN=55
	R_TEMP=58
	FAN_CMD_OFF=21
	FAN_CMD_AUTO=00
	RAW_FAN_STATE_OFF="0x21"
	;;

This has completely solved the issue. The fan now stays off as long as the temperature is below 70 degrees Celsius. The rest of the time (which is virtually always) it is dead silent. Case closed. For now.

Categories
Computers Linux

Configure postfix to use smart host

My ISP filters outgoing SMTP traffic so to be able to run a mail server running at home I need to use the ISPs SMTP server to relay outgoing email. If they would have allowed open relaying from their customers I could just have set their SMTP server as ‘relayhost’ in /etc/postfix/main.cf and be done with it.

However, they require that I authenticate to their SMTP server which complicates matter slightly. This is how I did it:

  1. Create a password file, assigning username and password to SMTP relay hosts. Create the file /etc/postfix/relay_password and edit it to have the following content (replace the hostname with whatever relay host your ISP is providing and use your password and login)

    smtp.bredband.net :
  2. Change permissions for the credentials file and create a map file

    # chown root:root /etc/postfix/relay_password
    # chmod 600 /etc/postfix/relay_password
    # postmap /etc/postfix/relay_password
  3. Update postfix configuration

    relayhost = [smtp.bredband.net]
    smtp_sasl_auth_enable = yes
    smtp_sasl_password_maps = hash:/etc/postfix/relay_password
  4. Restart postfix

    # /etc/init.d/postfix restart
Categories
Computers Linux

Control Debian daemons

Debian and Ubuntu place startup files for all deamons in /etc/init.d. Symbolic links are then placed in /etc/rc.X to control when deamons are to be started and stopped. While it would certainly be possible to manage it manually, there are a few tools that makes life easier whenever you want to control which daemons are started by default.

Using rcconf

rcconf

Using sysv-rc-conf

sysv-rc-conf

Using update-rc.d

usage: update-rc.d [-n] [-f]  remove
       update-rc.d [-n]  defaults|multiuser [NN | sNN kNN]
       update-rc.d [-n]  start|stop NN runlvl [runlvl] [...] .
		-n: not really
		-f: force

Categories
Computers Linux

Ubuntu 8.10 – libpolkit error

On a newly installed system with Ubuntu 8.10 you will see these kind of lines in /var/log/syslog:

Nov 24 01:12:31 sirius console-kit-daemon[9837]: CRITICAL: cannot initialize libpolkit

The error will repeat every ten minute or so and the fix to this issue is to install policy-kit, i.e.:

sudo apt-get install policykit

This is described in more detail on Launchpad: https://bugs.launchpad.net/ubuntu/+source/policykit/+bug/275432

Categories
Computers Linux

VirtualBox and Ubuntu 8.04.1

When installing a Ubuntu 8.04.1 virtual guest under VirtualBox 2.06 running on a Mac you will probably be faced with the following error:

Starting up ...
This kernel requires the following features not present on the CPU:
0:6
Unable to boot - please use a kernel appropriate for your CPU.

This problem is due to the fact that the last couple of versions of Ubuntu have been compiled with PAE enabled – but the default guest setting of VirtualBox is that PAE is disabled. So to solve the issue, just stop the virtual guest and enable support in the CPU for PAE/NX, it’s under the advanced general settings. Another solution would be to reinstall the guest using the alternate CD image of Ubuntu (which, last time I checked, didn’t require PAE).

Categories
Computers Linux

Adding roles to Ubuntu Server

I have set up a number of server based on the past four or five versions of Ubuntu Server. Every time I face the dialog where one can pick what additional software to install, I just select OpenSSH so that I can make the server headless and manage it remotely. I then install each individual package using apt-get until the system works as I wish.

Ubuntu 8.10 Server - additional software roles

First, I thought that the alternatives for software could be installed as meta packages using apt-get but I never managed to find any such meta packages in the package list on http://packages.ubuntu.com – or by searching the repositories with apt-cache.

I just now learned that the command tasksel brings up a menu similar (but extended) to the one shown during the installation. It is also possible to list which deb packages an individual task would install. A simple method would for instance be to run ‘tasksel install dns-server’ which would lead to the exact same result as if one had picked the DNS server from the beginning.

Categories
Computers Linux

Keeping track of installed apps, part 2

In an earlier post I wrote how to output a list the currently installed applications under Debian (and distributions based upon it). This will now be extended into a script that can be run each hour to record changes to the installed applications. Now, it should be said from the beginning that this information may already be stored in the file /var/log/apt/term.log but it can be a challenge to follow what it happening.

The following script stores a snapshot of the installed applications and then makes a diff against that on a period basis (e.g. by running it as an hourly cron job). If there is a difference, the changes are saved to a time stamped file and a new snapshot is taken. All files are placed in the same log directory as apt normally uses (i.e. /var/log/apt). The downside of this method is that changes will be recorded with a granularity of an hour but usually that is not an issue as the reason for writing this was to keep an automated record of changes to the system.

#!/bin/bash
 
folder='/var/log/apt/'
installed=$folder'current'
 
if [ ! -e $installed ]; then
  echo "Creating initial file"
  dpkg-query -W -f='${Package}\n' > $installed
  cp $installed $folder'initial'
fi
 
# Compare package list against current
dpkg-query -W -f='${Package}\n' | diff $installed - \
  | grep -e '^[(<|>)]' > /dev/null
 
if [ $? -eq 0 ]; then
  # The set of installed packages has changed. Save the delta to a
  # file and save the new snapshot
 
  filename=$folder`date +%Y-%m-%d_%H-%M-%S`
  dpkg-query -W -f='${Package}\n' | diff $installed - \
    | grep -e '^[(<|>)]' > $filename
  dpkg-query -W -f='${Package}\n' > $installed
fi;
 
exit 0

css.php