Force IPv4 for apt-get

Running an apt-get update or an apt-get install occasionally times out on VMs that I am building before I have setup IPv6.  Instead of waiting the (seemingly) long time for it to timeout, just add:

-o Acquire::ForceIPv4=true

to the end of the apt-get command to force IPv4.

And to make it permanent:

create /etc/apt/apt.conf.d/99force-ipv4 and put in it:

Acquire::ForceIPv4 "true";

Cannot get array info for /dev/md0

When adding a disk back to an mdadm array I got this error for the md0 array which was actually my swap partition.

root@mothership2 ~ # mdadm --manage /dev/md0 --add /dev/sdb1
mdadm: Cannot get array info for /dev/md0

To fix this you have to run:

mdadm --stop /dev/md0
mdadm --assemble --scan

Then you can add the drive to array like so:

mdadm --manage /dev/md0 --add /dev/sdb1
mdadm: added /dev/sdb1
You have new mail in /var/mail/root