Monthly Archives: July 2009

Troubleshooting Sound on Ubuntu

Some good documentation on Troubleshooting Sound on Ubuntu.

And a nice post on getting Amarok going on Jaunty – remove phonon-backend-gstreamer and install phonon-backend-xine (bug 349847). I can now go back to grooving to some laid-back Brazilian Reggae – Tribo de Jah – Ruinas de Babilonia:

Veja a face sofrida dessa gente, Tanta gente sofrida,
Buscando uma vida decente, Buscando um pouco de paz em suas vidas…

git – ignore vim temporary files in all directories

Up until a few weeks ago I was using subversion for all my personal stuff. But then I got fredded when my free subversion hosting (xp-dev.com) went down for a few days, so I’ve moved to git. Yay, no more central repository to go down…

To ignore files in git you use .gitignore, eg for a rails project:

% cat .gitignore
log/*.log
tmp/**/*

But how to ignore files in all directories? Use .git/info/exclude. For example, to ignore all temporary files generated by vim:

% cat .git/info/exclude
.*.sw*

All the howto’s I’ve read so far mention .gitignore but not .git/info/exclude – I stumbled across this by accident. More RTFM’ing to do…

Correction

To ignore all files in all directories, .gitignore can be used. A bit of experimentation and reading of man gitignore shows that any wildcard that doesn’t contain a / will apply to that directory and all child directories.

.gitignore is propagated during clone operations, whereas .git/info/exclude isn’t ie use the former for common settings and the latter for personal settings.

From the manpage:

Patterns which should be version-controlled and distributed to other repositories via clone (i.e., files that all developers will want to ignore) should go into a .gitignore file. Patterns which are specific to a particular repository but which do not need to be shared with other related repositories (e.g., auxiliary files that live inside the repository but are specific to one user´s workflow) should go into the $GIT_DIR/info/exclude file. Patterns which a user wants git to ignore in all situations (e.g., backup or temporary files generated by the user´s editor of choice) generally go into a file specified by core.excludesfile in the user´s ~/.gitconfig.

netapp – disabling and deleting snapshots

Netapp volumes by default are created with snapshots turned on; if the volume is being used for backups (for example), the snapshots just use up space. Here’s how to delete them:

df vm_dev                     # see space usage for vm_dev volume
snap sched vm_dev             # see the current snapshot schedule
snap sched vm_dev 0 0 0       # zero out the current schedule
vol options vm_dev nosnap on  # disable snapshots (not required, but "belts and braces")
snap delete -a vm_dev         # delete all old snapshots

On a multi terabyte volume, the actual deletion can take a while – don’t expect the space to return immediately…

See Netapp’s “Data Protection Online Backup and Recovery Guide” for more details.

ipcalc

ipcalc – a tool I used to use years ago but had forgotten about.

sudo aptitude install ipcalc
% ipcalc 192.168.1.0/26
Address:   192.168.1.0          11000000.10101000.00000001.00 000000
Netmask:   255.255.255.192 = 26 11111111.11111111.11111111.11 000000
Wildcard:  0.0.0.63             00000000.00000000.00000000.00 111111
=>
Network:   192.168.1.0/26       11000000.10101000.00000001.00 000000
HostMin:   192.168.1.1          11000000.10101000.00000001.00 000001
HostMax:   192.168.1.62         11000000.10101000.00000001.00 111110
Broadcast: 192.168.1.63         11000000.10101000.00000001.00 111111
Hosts/Net: 62                    Class C, Private Internet

Firefox – default paper size A4

A bug that has been dragging on for years – Firefox under Ubuntu (and other distros) doesn’t respect the locale setting, and defaults to printing in US Letter size – grrrr…

Firefox: Guide for the Perplexed seems to suggest:

  • about:config
  • print.postscript.paper_size set to “A4″

Now to see if it holds, and work out a way to script this (I have a set of bash scripts that keeps all my Ubuntu desktops the same).