Fixing DNS on Ubuntu after a DNS server change

Maybe this is too niche an issue, but in case anyone else runs into this problem, we recently retired one DNS server for another one. A Ubuntu VM I was running didn't pick up on this change. I kept Googling about hosts not resolving in Ubuntu, and people kept pointing to the /etc/hosts and /etc/hostname files. Some older posts from years ago mentioned editing the /etc/resolv.conf file, but the file itself says not to manually edit it! (DO NOT EDIT THIS FILE BY HAND - YOUR CHANGES WILL BE OVERWRITTEN)

Well, turns out that's fine in this case. The wrong address was in there. I hand-edited it to the new address, and now everything's cool.

Looks as if you have to edit the /etc/network/interfaces file to change the dns-nameservers

Setting up Nagios on Ubuntu 16.04 (Xenial)

The best guide I found for installing Nagios on Ubuntu 16.04 (Xenial) was How To Install Nagios on Ubuntu 16.04, with only a couple of amendments. First of all, it's not using the absolute latest version of Nagios or the Nagios plugins. And secondly, it's missing a command in terms of untarring the downloaded Nagios.

So, as of this writing, the first part of step #4 should be:

cd /tmp
wget -c https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.2.1.tar.gz
tar -zxvf nagios-4.2.1.tar.gz
cd /tmp/nagios-4.2.1
and, similarly, the third part of step #4 should be:
cd /tmp
wget -c https://nagios-plugins.org/download/nagios-plugins-2.1.3.tar.gz
tar xzf nagios-plugins-2.1.3.tar.gz
cd /tmp/nagios-plugins-2.1.3
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install

How to create a bootable Ubuntu USB stick on/for Macs

For some reason (at least as of this writing), the official Ubuntu documentation on creating a bootable USB of Ubuntu for Macs is now recommending using UNetbootin. I haven't found that to actually work. I dug up a cached copy of the old instructions (which do work), but I wanted to document the old procedure here, just in case the cached copy later becomes inaccessible.

Here are the steps to get a bootable-to-Mac USB of Ubuntu

Go to the list of alternative downloads and use a BitTorrent client (e.g., Transmission) to download a .torrent of the desktop version of Ubuntu.

Launch up /Applications/Utilities/Terminal.app.

In the terminal put in

hdiutil convert -format UDRW -o /path/to/target.img /path/to/nameofubuntu.iso
but substitute in your actual paths to the names of the files.

You may notice that your target.img ends up turning into target.img.dmg, which is totally fine.

Run

diskutil list
to get a list of the drives/partitions on your Mac.

Plug the USB stick in and run

diskutil list
again to find the new drive name, based on what didn't show up the last time you ran the command. For the sake of this example, we'll assume it's /dev/disk2, but pay careful attention to your actual USB's name, which may be different.

Unmount the USB (without unplugging it physically) by running this command

diskutil unmountDisk /dev/disk2
(being sure to substitute in your actual disk number for disk2).

Copy the .img (or .img.dmg) file to your USB using dd:

sudo dd if=/path/to/target.img of=/dev/rdisk2 bs=1m
Put in your actual disk number, if it's not 2.

If it copied correctly, you should actually get an error message:ejectubuntu Click Eject.

Then remove the USB drive from your Mac and put it in the Mac you want to boot from. Hold down the option key while booting up, and then select EFI as the drive to boot from.

Create a custom live/installer disk image for Ubuntu using Pinguy Builder

If you have your Ubuntu installation exactly the way you want it, and you want to create a live/installer disk image, you can use Pinguy Builder, a fork of Remastersys (which has since been abandoned).

Go to the Pinguy Builder website to get the appropriate version of Pinguy Builder. If you're using Ubuntu 14.04 LTS, then you want version 3.*. If you're using Ubuntu 15.10, use version 4.*.

If you're using Ubuntu 15.10, you'll have to manually download and install xresprobe. You can get the 15.04 version from the Ubuntu packages website, and that will work on 15.10.

pinguybuilder01 The Pinguy Builder website will take you to SourceForge for the download files.

pinguybuilder02 Once you've selected your download, click Save file

pinguybuilder03 After it downloads, double-click it to open it.

pinguybuilder04 The Ubuntu Software Center should launch up. Click Install.

pinguybuilder05 When prompted, type in your password and then click Authenticate.

pinguybuilder06 Wait for Pinguy Builder to install.

pinguybuilder07 Once it's installed, you can close the Ubuntu Software Center.

pinguybuilder08 You should then be able to find Pinguy Builder in a search of the application menus.

pinguybuilder09 Once again, you'll have to authenticate. Then click OK.

pinguybuilder10 If you have other programs still open (e.g., Firefox), close them. Then click OK.

pinguybuilder11 In addition to backing up your system, you may also want to back up a particular user profile to be the default user. If so, click Select next to User, whose current settings will be used as default.

pinguybuilder12 Select the user and then click OK.

pinguybuilder13 To create your backup live/installer disk image, click Dist.

pinguybuilder14 Confirm by clicking OK.

pinguybuilder15 Once the process is done, you'll get a message saying so.

pinguybuilder16 You can then find your .iso in /home/PinguyBuilder/PinguyBuilder. You can burn that as a disk image to a blank DVD or "burn" it to become a bootable USB. Or you can use it to install to a virtual machine.

How to create a custom live/installer disk image for Ubuntu 15.10

This tutorial is out of date

For the more up-to-date version, go here.

This post is a sequel to How to create a custom live/installer disk image for Ubuntu 14.04.3 (Trusty Tahr). Remastersys does not appear to have any packages compatible with the newest version of Ubuntu. I looked into Respin but couldn't get anything working with it.

Another fork called Pinguy Builder appears to be up-to-date and operate a lot like Remastersys did.

Install Pinguy Builder

First, make sure your repositories' contents are up to date:

sudo apt-get update
Then make a temporary directory to hold some .deb files:
mkdir temp
Change to focus on that directory:
cd temp
If you're using the 64-bit version of Ubuntu, use this command to download xresprobe (which would otherwise be an unmet dependency software package):
wget -c http://mirrors.kernel.org/ubuntu/pool/universe/x/xresprobe/xresprobe_0.4.24ubuntu9_amd64.deb
If you're using the 32-bit version of Ubuntu, use this command to download xresprobe:
wget -c http://mirrors.kernel.org/ubuntu/pool/universe/x/xresprobe/xresprobe_0.4.24ubuntu9_i386.deb
Use this command to download version 4 of Pinguy Builder:
wget -c http://skylineservers.dl.sourceforge.net/project/pinguy-os/ISO_Builder/pinguybuilder_4.3-2_all.deb
Install all the .deb files in this folder (should be only two):
sudo dpkg -i *.deb
You'll get some error messages about unmet dependencies. The next command should fix all that:
sudo apt-get -f install
Go up one directory:
cd ..
Remove the temporary directory you created before:
rmdir temp

Note: All the above installation steps can be done through the GUI if you know how to navigate around packages.ubuntu.com/, you can download those packages manually and then use gDebi to install the packages and dependencies.

Use Pinguy Builder

pinguy01 Once Pinguy Builder is installed, you should be able to find it in the menus.

pinguy02 If you want to use one user's settings and files as a template for the default user, click Select next to User, whose current settings will be used as default.

Feel free to customize anything else you want.

When you're done customizing, click Dist to make your live/installer disk image.

pinguy03 When the .iso is complete, you'll find it in /home/PinguyBuilder/PinguyBuilder.

How to create a custom live/installer disk image for Ubuntu 14.04.3 (Trusty Tahr)

This tutorial is out of date

For the more up-to-date version, go here.

Read First

If you have a Ubuntu installation that you want to convert to a live/installer disk image (able to be burned to DVD, "burned" to bootable USB, or used as an .iso to set up a virtual machine), this is one way to do it. I'm using Ubuntu 14.04.3 in this example, because it's the latest LTS (Long-Term Support release for Ubuntu). If you're using the newest version of Ubuntu (15.10, as of this writing), you may find How to create a custom live/installer disk image for Ubuntu 15.10 more helpful.

Make sure you have your Ubuntu installation exactly the way you want it before proceeding.

Install Remastersys

remastersystrusty01 First, go to the Remastersys PPA.

Expand Technical details about this PPA.

Under Display sources.list entries for:, select Trusty (14.04).

You'll then see the sources in the input box change to something like this:

deb http://ppa.launchpad.net/mutse-young/remastersys/ubuntu trusty main
deb-src http://ppa.launchpad.net/mutse-young/remastersys/ubuntu trusty main
Highlight and copy them, and keep the webpage open.

Put this command into the terminal to edit the sources.list (while also making a backup):

sudo nano -B /etc/apt/sources.list

remastersystrusty02 Then, at the very bottom of the file (use Control-V to scroll down), you can paste (Control-Shift-V) the text you'd copied earlier, and then save (Control-X) the file.

remastersystrusty03 Back on the PPA webpage, check out the bold text under Adding this PPA to your system—in this case, ppa:mutse-young/remastersys.

remastersystrusty04 Back in the terminal, paste in

sudo add-apt-repository ppa:mutse-young/remastersys
and then hit Enter when prompted to add the gpg keys to say you're trusting this repository.

Now that the repository is set up, let's pull from it to get Remastersys actually installed:

sudo apt-get update && sudo apt-get install remastersys

Use Remastersys

Optional: Remastersys, by default, will just back up your whole system but not any of the logged-in users. If you want to make one of your user's the default user profile, run this command:

sudo remastersys-skelcopy username
where username is the username of the user whose profile you want to make the default user profile in the new live/installer disk image.

remastersystrusty05 Required: To make the actual disk image, make sure all other programs are closed (you don't want to make changes to the system while it's being backed up / converted), and then run this command:

sudo remastersys backup dist

remastersystrusty06 Just let it run. It may take a while, depending on how large your installation is.

remastersystrusty07 Once it's done, you'll see the location of the created file, which should be /home/remastersys/remastersys/dist (not sure why the .iso file extension isn't appended).

remastersystrusty08 That's your disk image (I'd recommend renaming it from dist to dist.iso.

You can then burn it to a DVD (as a disk image—not data), use Startup Disk Creator to make a bootable USB, or use the .iso to install to a virtual disk using something like VMWare or VirtualBox.

Get photos/music off an iPad or iPhone using Ubuntu Linux

Disclaimer

These instructions work for iOS 8 (tested on both an iPhone and an iPad) using Ubuntu 14.04 (Trusty) and Ubuntu 15.04 (Vivid). The instructions will still likely work in other versions of iOS and Ubuntu, but your mileage may vary.

What's the problem?

If you take pictures with your iPhone or iPad and then plug your phone into your Mac, Photos (previously iPhoto) will import the pictures you took on your iOS device. It will not, however, easily allow you to copy random other photos that happen to be on your iOS device.

We recently had a user come in with an iPhone that had some pictures transferred from another computer with these pictures no longer living anywhere else, and so the user wanted the pictures backed up. Photos and iPhoto do not recognize and import random other photos that weren't taken with the camera.

There are plenty of paid-for utilities you can download that will allow you to copy photos and music off an iPhone or iPad, but if you'd rather save the money for other purchases, here's a little workaround that's cost-free.

Get Ubuntu Linux

Really, you can use any Linux distribution, since libimobiledevice is available for any Linux distribution, but we'll use Ubuntu for this example (and, handily, Ubuntu comes with libimobiledevice installed).

If you're a total Linux novice, you can read up quickly on how to get Ubuntu and how to make a bootable USB of Ubuntu. The instructions are a few years out of date, but the same basic procedure applies, and UNetbootin works on Windows and Mac OS X.

Using Ubuntu to rescue your photos (and music?) off your iPad or iPhone

If you're using Windows, make sure your BIOS or UEFI is set to boot to USB. If you're using Mac OS X, hold down the Option key at boot-up and then choose to boot from the USB stick (it may appear as just the word EFI).

You should get a boot menu similar to the following:

*Try Ubuntu without installing
Install Ubuntu
OEM install (for manufacturers)
Check disc for defects
You want to select *Try Ubuntu without installing. This will load Ubuntu into your computer's RAM and not affect your hard drive or SSD.

Once the live session is booted, unlock your iPad or iPhone, and plug it into the computer that has live Ubuntu booted on it. Ubuntu will throw you an error saying it can't connect to the iOS device, but that's because you have to say on the iOS device that the computer is trusted. Once you say the computer is trusted, you should be able to select the device from the file manager (you do not need to physically unplug and then re-plug in your device).

copyphotosfromipadphone01
To find non-camera photos from a previous sync, go to nameofiOSdevice > PhotoData > Sync > 100SYNCD.

copymusicfromipadphone01
For previously synced music, go to nameofiOSdevice > iTunes_Control > Music. You'll see a bunch of folders labeled F##. Just copy all of them or the entire Music folder that contains them.

For Windows, Ubuntu can write directly to the NTFS drive if you want to copy the photos or music there. For Mac, you'll need a USB stick or something else to copy the photos or music to.