Friday, July 13, 2012

ubuntu 12.04 precise: automated installation, preseeding

To get you started: https://help.ubuntu.com/12.04/installation-guide/i386/appendix-preseed.html

I had never done this before, and had great fun getting it to work. I was installing from a USB thumb drive. So I made of those guys per usual. The help page then says

"... you need to tell the installer what file to use when you boot it. This is normally done by passing the kernel a boot parameter, either manually at boot time or by editing the bootloader configuration file (e.g. syslinux.cfg) and adding the parameter to the end of the append line(s) for the kernel."

Since we're automating this, editing syslinux.cfg seemed to be the way to go. However, taking a look at that guy, there was no append line. Sad face. I added a kernel and append line, but it wasn't changing the boot parameters. I then came across /syslinux/txt.cfg, which had what looked like the boot prompt being used. So I changed the append line there to include "preseed/file=/hd-media/preseed.cfg". Error, "Failed to retrieve the preconfiguration file". I changed this to "preseed/file=/cdrom/preseed.cfg".. and voila!

Some other newb notes:

  • If the installer stops to ask you a question, you can press escape and a menu with lots of options will popup. You can abort the installation from here.

Thursday, January 5, 2012

print urls in a css file

Print the URLs in a css file:

sed -rn 's/^.*url\((.+\.[a-z]+)\).*$/\1/p' file.css

I had a css file that referenced a some images in a directory that contained lots of images and wanted to move just the images referenced in the css file to a new directory, so ended doing something along the lines of:

for p in $(sed -rn 's/^.*url\((.+\.[a-z]+)\).*$/\1/p' file.css); do cp ~/old_path/css/$p new_path/$p; done

Tuesday, January 3, 2012

ubuntu chromium flash killing tabs

So sometimes when flash dies, like any good gift, it continues giving in the form of freezing any subsequent page that has flash. I tried killing the flash plugin process via the browser but that didn't seem to help; however, when killing the process from a terminal my browser was back to normal! Huzzah!

ps -ef | grep chromium-browser | grep flashplugin | awk '{print $2}' | xargs kill