Each time I’ve installed Ubuntu on my current desktop, the network adapters have failed to work ‘out of the box’. The culprit is the 680i chipset that my motherboard uses. There’s a simple fix, however: the forcedeth module needs to be loaded with some special sauce. A quick way to make it work is as follows:
sudo rmmod forcedeth
sudo modprobe forcedeth msi=0 msix=0
You should see the network adapter spring to life. Assuming that works, you can make the fix permanent by adding the following line to /etc/modprobe.d/forcedeth.conf:
options forcedeth msi=0 msix=0
and then running
sudo update-initramfs -u
and rebooting to save the changes.
Guess what! If you install Ubuntu 9.04 with /boot on an ext4 partition and you previously had grub installed into the MBR (and were using ext3), your system won’t boot! You need to boot the live cd and manually run grub-install.
# /dev/sdc2 has /boot on it, amongst other things
sudo mount /dev/sdc2 /mnt
sudo grub-install --root-directory=/mnt /dev/sdc2
psql doesn’t let you pass it a password at the command line (and with good reason–otherwise everyone would be able to see it with ps) but it can be somewhat frustrating if you’re trying to use psql in a script, as it will prompt for the password. One way to deal with this is to create a .pgpass file in your home directory. The lines in the file should be in the following format:
hostname:port:database:username:password
All values but the password can have * to match anything. Additionally, the file needs to have its permissions restricted, otherwise it will be ignored.
chmod 0600 ~/.pgpass
With that in place, you should be able to run psql from the command line without being prompted for a password.
I recently ran into a scenario where I needed to resize one of my Xen disk images. In this case, I wanted to add an extra 5GB.
I shut down the guest and run the following commands.
# use dd to create a 5GB file
dd if=/dev/zero of=temp bs=1024 count=5000000</code>
# append the temp file to the existing image
cat temp >> disk.img
# resize the file system
resize2fs -f disk.img
Start up the guest, and volia, we’ve got some free space!
More of a note to myself than anything:
# log in to the database template1:
psql template1
# issue command to create new database:
create database template_postgis with template = template1;
# update pg_database table to indicate that new database is a template
UPDATE pg_database SET datistemplate = TRUE where datname = 'template_postgis';
# connect to new database
\c template_postgis
# add PostGIS extensions and grant access to everyone to spatial tables.
CREATE LANGUAGE plpgsql ;
\i /usr/share/postgresql-8.3-postgis/lwpostgis.sql;
\i /usr/share/postgresql-8.3-postgis/spatial_ref_sys.sql;
GRANT ALL ON geometry_columns TO PUBLIC;
GRANT ALL ON spatial_ref_sys TO PUBLIC;
# prevent further changes to this database
VACUUM FREEZE;