Telling Ubuntu Network Manager to leave an interface alone

I wanted to assign a static IP address to a USB-to-Ethernet interface.  Edit /etc/network/interfaces… easy, right?  Then the NetworkManager starts to periodically get involved and make conflicting changes.  I’m not yet ready to embrace its GUIness, so I wanted to just disabled it.  

Turns out it’s easy if you know where to look:

sudo vi /etc/NetworkManager/NetworkManager.conf
# Add a line like this (comma-separated list of
# Ethernet MAC addresses of interfaces to ignore):

# Then restart NetworkManager
sudo service network-manager restart

It should then leave your interface(s) in peace.

Ubuntu Live CD with FOG 1.1.2

TL;DR: To do what the title says, get FOG working and then go to its admin page (http://MY-SERVER-IP/fog/management/index.php). Click the question-mark menu item (mouseover text “FOG Configuration”), then select “PXE Boot Menu” from the links on the left, and finally select “Advanced Configuration Options”. This produces a text box where a standalone iPXE script can be pasted in, which will be available from a magically appearing “Advanced” option at the end of the default list presented when your client system netboots. The script that did the trick for me is:

set arch i386
item fog.precise Run Ubuntu 12.04 LTS LiveCD (32 bit)
choose target && goto ${target}
# The kernel's path is relative to /var/www/fog/service/ipxe.
# The files at the nfsroot are a copy of the mounted contents of
# the ubuntu-12.04.4-desktop-i386.iso. Note that this 'kernel'
# line is one long line. ('nfsroot' is an argument to 'kernel'.)
kernel howtogeek/linux/ubuntu/precise/casper/vmlinuz boot=casper netboot=nfs nfsroot=MY-SERVER-IP:/tftpboot/howtogeek/linux/ubuntu/precise
# initrd should be on its own line so iPXE grabs it via HTTP,
# instead of requiring the kernel to grab via NFS
initrd howtogeek/linux/ubuntu/precise/casper/initrd.lz
boot || goto MENU

Mount an ISO persistently with a line like this in /etc/fstab:
/tftpboot/howtogeek/linux/ubuntu-12.04.4-desktop-i386.iso /tftpboot/howtogeek/linux/ubuntu/precise udf,iso9660 user,loop 0 0

The full version:

FOG is a really quick-and-easy way to setup a DHCP/TFTP/HTTP/NFS server which can be a lifesaver when doing low-level experiments using hardware that might not have a CD/DVD drive, bootable USB, etc. I’ve set this stuff up manually in the past and it is always very tedious. I feel compelled to mention that PXE is a completely insecure protocol. It downloads arbitrarily bytes from a cleartext network connection and executes them in CPU ring 0. Configurations like this are unsuitable for anything other than lab-style environments.

I stumbled upon all of this when I basically wanted to do exactly what this link suggests:, but unfortunately it’s for an earlier version of FOG, and rather than use the old version I thought I would see what I could do. This HOWTO suggests editing /tftpboot/howtogeek/menus/linux.cfg from a previous HOWTO, which all comes down to file /tftpboot/pxelinux.cfg/default, which no longer exists in FOG v1.1.2. The reason for this is that the PXE boot menu is dynamically generated on the server using PHP code and a database backend.

With the help of WireShark, I fairly quickly was able to figure out how FOG was working. The TFTP/PXE part was working just fine. The trick is to figure out how it gets the kernel, initrd, and root filesystem for the option it does end up booting. Basically all of the problems I had were with specifying the right access method and path to the kernel, initrd, and root filesystem.

One can pretend to be a client using curl (with its awesome-sauce support to trivially stick in POST arguments):

curl --data "mac0=aa%3Abb%3Acc%3Add%3Aee%3Aff&arch=i386" http://MY-SERVER-IP/fog/service/ipxe/boot.php##params

My apologies for forcing you to probably read the FOG wiki, two howtogeek articles with painfully low information density, and then this, but perhaps it will show up as a search result that can help people frustrated with instructions that apply to stale FOG versions.

How to get rid of Alt-Tab and Alt-` in Ubuntu 12.04 Unity

I was happy with the Alt-Tab behavior before Unity. I tend to switch windows very rapidly and the attempt to animate things, and I find the distinction between Alt-Tab and Alt-` to be very annoying, especially under certain circumstances when Alt-Tab actually does behave as Alt-` does.

Here are some instructions to fix this. I selected the Static Application Switcher. I have not tried the Shift Application Switcher.

OSXFuse + MacFUSE Compatibility Layer + Fuse-ext2 = ext[23] on OS X (ro)

I was hoping to be able to at least read (though writing is always nice) ext3 filesystems on external drives from OS X, without having to start up a virtual machine. This page suggested I use OSXFuse and Fuse-ext2.

It turns out OSXFuse is the actually-maintained descendent of MacFUSE, but that it includes a “MacFUSE Compatibility Layer” (just a checkbox during install; no need for a separate download) that can handle the Fuse-ext2 module (which apparently hasn’t been updated in several years). Nonetheless, these things worked pretty seamlessly for me. I installed OSXFuse, then installed Fuse-ext2, then rebooted. The next external USB storage device I connected with an ext3 filesystem was successfully mounted read-only. Various other places on the web suggest that really slow writing should be possible, but I have not explored that option.

OS X Mountain Lion does not include X11

Just spent way too long thinking it was something wrong with my SSH configuration. Ugh. The former is now an open source project that needs to be independently installed. Once installed things Just Worked the way they used to. An example error message that is resolved, that I encountered when trying to run gitk:

$ gitk
Application initialization failed: no display name and no $DISPLAY environment variable
Error in startup script: no display name and no $DISPLAY environment variable
while executing
"load /usr/lib/ Tk"
("package ifneeded Tk 8.5.11" script)
invoked from within
"package require Tk"
(file "/usr/bin/gitk" line 10)

Locales problems on Debian or Ubuntu

I use debootstrap to install a lot of Debian or Ubuntu systems. This often leads to “locales” problems. Examples of the errors you might see include (from aptitude or apt-get):

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

…or from gparted:

(process:16644): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
libparted : 2.3
(gpartedbin:16644): glibmm-ERROR **:
unhandled exception (type std::exception) in signal handler:
what: locale::facet::_S_create_c_locale name not valid

This fix has been the most reliable that I have found:

export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
dpkg-reconfigure locales

In particular, just running dpkg-reconfigure locales rarely accomplishes anything useful for me. If it doesn’t produce output, it probably didn’t fix your problem.