Category: Uncategorized

Ubuntu 13.04 A Ruckus with Ringtail

This past weekend, I finally got the time to go through installing Ubuntu 13.04 (Raring Ringtail).  Here’s to documenting it…

Install_001

I have been trying to rebuild my laptop with each new version of Ubuntu.  This is proving a little more challenging, but this is my first post.  This is as much of a story as my other posts, and if you have any suggestions please comment.

Preparing the Installation Media

The troubles started at the outset for me.  The default tool for putting an iso on a USB drive had been crashing, so I have dropped back to UNetbootIn.  I had mentioned that on several posts, and this one is no different.

It worked fine at first, but after I went through the install, my wireless wasn’t recognized.  Then, I found that my USB ports weren’t working; at least, I couldn’t mount a USB key or external drive.  Also, my touchpad wouldn’t work.

I did a little searching around, and I found Husain’s Chronicle.  He mentioned that the problem seems to be common with everyone who used UNetbootIn.  It seems very strange to me because the problem happens not when you boot off the USB but after booting to an installation made by the USB drive.  Still, I went to my other computer that happened to be running Linux Mint, and I used the “USB Image Writer” program:

USB Writer

The only thing that I noticed different was the boot loader was different.  The install went exactly the same, but when I booted, I had no trouble with the touchpad, the wireless, or the USB drives.

Partitioning

I tried the option to remove the Ubuntu 12.10 partitions and reinstall, but that didn’t work for me.  I have special preferences on where I want my partitions.  Yes, I have to be difficult.

I have a solid state drive (apparently /dev/sdb) that I want to use as my root.  My thought is that I want all of the binaries and the swap partition on the faster solid state drive.  Then, I have a 1TB drive (/dev/sda) that I want to use for my home folder where I will place all of my files, pictures, virtual machines, etc.

I set the large partition to format and to mount on the /home folder:

Selecting Home Partition

Next, I removed all of the partitions on my SSD drive and created an 8G swap partition at the end:

Creating the Swap Partition

Finally, I created my root partition with the rest of the space:

Adding the Root Partition

Encrypting the Drive

This time I decided to encrypt my home folder to add a little security.  This is my first try at this, so I’ll have to see how things work.  So far, it doesn’t seem like any complication for the security that it adds.

Encrypting the Home Folder

On the first boot, it prompted me to save my key.

Encryption key message

So, I ran ecryptfs-unwrap-passphrase.  Note that it says, but I missed it the first time: when it asks for the “Passphrase”, it is asking for the password that you associate with your user account, the one when you login to your computer.

Cleaning Up the Launchers

One of the first issues that I notice is that the launcher on the left is full of icons that I don’t necessarily use all of the time.  So, I removed most of them to make room for running applications:

Unlocking Launchers

Adding Google Software

Google offers a software repository.  Rather than just trying to install chrome by downloading the deb, I installed the repository with:

wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get install google-chrome-beta

I had expected chrome to show up in the Ubuntu Software Center, but it never did.  It worked fine to install from the command-line though.

Shutter

Shutter is one of the first things that I install so that I can document and blog my install.  It is an easy install from the Software Center:

Shutter in the Software Center

For configuration, I don’t like the way the program sticks the screenshots in the Pictures folder.  To me, that is for photos rather than screenshots.  So, I create my own screenshots folder:

Creating the Screenshots folder

Then, under Edit > Preferences, I set it to use the new folder:

Shutter folder setting

On previous versions, I had to tweak the settings to get it to show by the clock.  This install, I didn’t have to do anything, and it shows up!

Shutter by the clock

Since I am always taking screenshots of things, I set it to start automatically.  I checked the first two options on the “Behavior” tab:

Shutter on Startup options

Restoring Backups

I copied off all of my important content off to an external USB drive.  I installed grsync to make copying easier.  Then, I copied the following directories back:

  • ~/Documents: This is where I put all my document files
  • ~/Pictures: I have Shotwell pointed at this directory, so it contains all the pictures from my cell phone and digital camera
  • ~/MIS: I keep my work files in a different directory
  • ~/app: This has all of my programming stuff (“application development”)
  • ~/VirtualBox VMs: These are the virtual computers
  • ~/.config/google-chrome: The settings for Chrome (extensions, bookmarks, etc)
  • ~/.gnome2/keyrings: My saved passwords
  • ~/.Skype: Skype history
  • ~/.remmina: The settings for my remote connections
  • ~/.ssh: The keys for my remote ssh connectinos
  • ~.local/share/shotwell: The settings and thumbnails for my photos (moved from ~/.shotwell, see Ask Ubuntu)
  • ~/.sword: The downloaded Bible files for Xiphos (and the underlying Sword library)
  • ~/.VirtualBox: The settings for my virtual machines
  • ~/.filezilla: The settings for my FTP connections
  • ~/.sqldeveloper: The connection settings for SQL developer
  • /etc/NetworkManager/system-connections and /etc/NetworkManager/VPN: this saves all of my wireless connections and VPN connections

Other Utilities

I like to use the “Main Menu” program, or alacarte to update the list of applications for the Applications Dash.

Main Menu program

Bumblebee for the Discrete Video Card

WebUpd8 has a great article for installing Bumblebee.  I decided to try the Bumblebee Configurator GUI.  Notice that the program name changed from gtk to gui — bumblebee-config-gui.


sudo add-apt-repository ppa:alessandrofac93/bumblebee-config-gtk-dev
sudo apt-get update
sudo apt-get install bumblebee-config-gui

Issue … I started it with “sudo bumblebee-config”.  All I got was this output:


Traceback (most recent call last):
 File "/usr/bin/bumblebee-config", line 17, in <module>
 wnd = BumblebeeMainWindow()
 File "/usr/lib/python2.7/dist-packages/bumblebee_config/bumblebee_main_window.py", line 53, in __init__
 if self.aptHelper.checkBumblebeeInstalled():
 File "/usr/lib/python2.7/dist-packages/bumblebee_config/apt_helper.py", line 112, in checkBumblebeeInstalled
 if cache['bumblebee'].isInstalled:
 File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 204, in __getitem__
 raise KeyError('The cache has no package named %r' % key)
KeyError: "The cache has no package named 'bumblebee'"

There is a bug opened for this issue.  Just as a guess, I tried to add the repositories:

sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
sudo add-apt-repository ppa:bumblebee/stable

sudo apt-get update

After that, it worked fine:

Bumblebee Configurator

I found that I needed to click on the “Configure Bumblebee” button first to choose the Nvidia driver:

Configuring the Driver for Bumblebee

I clicked the “Install Bumblebee” button, and it started installing…

Installing Bumblebee

When I ran check status, I got this message:


Bumblebeed status:
[ 7161.740177] [INFO]Configured driver: nvidia
[ 7161.742547] [INFO]Switching method 'bbswitch' is available and will be used.
[ 7161.744668] [ERROR]Module 'nvidia-current' is not found.

Everything still seemed to work fine, though.  The nvidia-current package was actually installed.  I don’t know why it reports that “not found” message.

 

Linux to Samsung

A very good friend asked me to install Linux on his new laptop.  It is a Samsung NP550P5C-A01UB.  He has used Linux in the past, but he has a requirement to run a Windows-only program.  Not sure how he would want to meet that requirement exactly, I decided to give options.  I shrunk the original Windows 8 to make it dual boot.  Then, I installed Windows in Virtual Box so that Linux and Windows could run at the same time.  Finally, I installed Office with Wine to allow for editing Office docs natively.

Backing Up

My first task was to back up the PC before I did anything.  I wanted a snapshot so that I could get it back to the way the laptop was given to me.  Clonezilla was the tool of choice.  It boots from a CD or USB drive and it can snapshot a harddrive.

Bad EIP Value

When it booted with my first image of clonezilla (clonezilla-live-20121217-quantal.iso), it wouldn’t work.  I tried adding the following options in the boot menu:

pci=noacpi nobiospnp noapic nolapic

Unfortunately, that didn’t solve my problem.  I ended out just downloading the latest version from SourceForge/the Clonezilla website.

Creating the Clonezilla USB Drive

The “Make Startup Disk” program that I have been using has been crashing for me.  So, I set out to find a better way.  UNetbootin stepped in to save the day!  It was an easy install from the Software Center, and it worked with no problem.

UNetbootin

The “Distribution” option looked cool.  I didn’t read up on it, but it looks like it would download the version for you.  The only problem was that all of the versions were out of date.  So, I downloaded the latest version myself and I used the “Diskimage” option.

GPT Partition

Clonezilla gave me this error message:

This disk contains mismatched GPT and MBR partition: /dev/sda

It will confuse Clonezilla and might make the saved image useless or fail to clone the disk.

You can use gdisk or sgdisk to fix this issue.  E.g. if you are sure only MBR partition table is the one you want, you can run this command to destroy the GPT partition table while keep the MBR partition table:

sudo sgdisk -z /dev/sdx

First things first, I backed up the master boot record —

sudo dd if=/dev/sda of=GPT bs=512 count=34

If I needed to restore, I should be able to use this:

sudo dd if=GPT of=/dev/sda bs=512 count=34

Here’s the output of: sudo fdisk -l /dev/sda

Device     Boot      Start     End      Blocks    Id     System
/dev/sda1     *       2048    718847      358400      7      HPFS/NTFS/exFAT
/dev/sda2             718848  1465147391  732214272   7      HPFS/NTFS/exFAT

I checked, and this drive wasn’t over 2TB, so I just got rid of the GTP.  I ran this command:

sudo sgdisk -z /dev/sda

After rebooting clonezilla, the backup worked fine.

Installing Linux Mint

I downloaded the latest version of Linux Mint.  I chose the Cinnamon 64-bit version from the download page.  And, I used UNetbootin to put it on the USB drive.

When it asked for installing beside Windows, I chose “Install Linux Mint alongside Windows 8”:

Selecting install type

The interface to choose the size was very nice.  I could just drag the divider, and I chose to split the space like this:

Selecting parition size

Finally, the install finished and reported no problems:

Installation Complete

Fixing the Bootloader

After the install, it would only boot into Windows.  It wouldn’t load any bootloader.

I tried to load/install grub manually.  Here the commands that I used, but I won’t bother explaining them because they didn’t work:


sudo fdisk -l /dev/sda

sudo mount /dev/sda5 /mnt
 sudo mount -o bind /dev /mnt/dev
 sudo mount -t proc none /mnt/proc
 sudo cp /etc/resolve.conf /mnt/etc
 sudo chroot /mnt /bin/bash
 sudo mount -t sysfs none /sys
 sudo mount -t devpts none /dev/pts

sudo apt-get update
 sudo apt-get install grub-efi
 sudo update-grub
 sudo grub-install /dev/sda
 sudo grub-install /dev/sda1

exit

sudo umount /mnt/dev/pts
 sudo umount /mnt/dev
 sudo umount /mnt/proc
 sudo umount /mnt/sys
 sudo umount /mnt

Unfortunately, no luck.

Switching to Ubuntu

Finally, I decided to give up on Linux Mint.  I have more experience with Ubuntu, so I thought I would see if it makes a difference.  I found documentation that looked like they had the new bootloader issues taken care of.

I removed the partitions that Linux Mint created using gparted (had to launch with sudo gparted).  It had mounted the the Swap partition, so I had to use the swapoff option before it would let me delete:

removing the Mint partitions

It cleaned up like this:

Clean up partition table

Next, I went through the install, and it just asked if I wanted to install along side Windows

Install Type option

So, here’s the result after the install:

Partition Table after install

The install went fine.  The only problem was that it still wouldn’t boot to Linux.  It was like it didn’t install any bootloader at all!

Boot Repair

I finally found a program called “Boot Repair”.  It was supposed to fix issues like what I was running into.

I used the following two commands to install and launch boot repair:

sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update
 sudo apt-get install -y boot-repair && (sudo boot-repair &)

Then I clicked on the “Recommended Repair” button.  It had me run a couple of things in the terminal.

I did run this:

[ -d /sys/firmware/efi ] && echo "EFI boot on HDD" || echo "Legacy boot on HDD"

It said that I was installed in EFI mode.

After the reboot, I was good to go.

Getting Up to Date

I ran this to download the latest updates:

sudo apt-get update
 sudo apt-get upgrade

Installing VirtualBox

I was able to install Virtual Box very easily from the Software Center.  Then, I downloaded the latest version of the Clonezilla image.  I created a machine with 3G of RAM and a dynamically allocated 500G drive.  I set the Clonezilla.iso as the CD drive.

When I booted the image, it gave me an error about the kernel not being available.

To fix the problem, I tried:

sudo apt-get remove virtualbox-dkms
 sudo apt-get install virtualbox-dkms

That’s when I got the message:

Module build for the currently running kernel was skipped since the kernel source for this kernel does not seem to be installed.

I made sure that the linux-headers-generic package was installed, and it was.  Then, after playing with it for a while, I noticed there was a kernel update.  So, I let Software Updater do it’s job.  After rebooting, the machine worked.

The next challenge was getting Clonezilla to see the USB drive in the virtual machine.  I found that I needed to check the “Enable USB 2.0 (EHCI) Controller” on the USB tab of the VM’s settings.  When I did that, it said that I needed the “Oracle VM VirtualBox Extension Pack”.  That requires a different installation of Virtual Box, and I dropped that idea.

So, I created a new virtual drive.  Then, after booting CloneZilla and going to the command line, I created a new partition with fdisk.  Then, I formatted it with:

sudo mkfs.ext3 /dev/sdb1

Next, I had to mount that drive on the host so that I could copy my clonezilla backup to it.  I installed:

sudo apt-get install virtualbox-fuse

To mount the drive on the host, I ran:

sudo vdfuse -a -f "<path to vdi file>" /mnt

Then, I needed to mount the partition:

sudo mount -o loop /mnt/Partition1 /mnt2

After that, I had access to the clonezilla backup.  I was able to unmount the partition and boot the virtual machine.  Clonezilla restored the backup onto the machine, and I was good to go.

Finally, I had to fix the NAT … I followed my old instructions and ran these commands:

vboxmanage modifyvm "Windows 8" --natdnshostresolver1 on
 vboxmanage modifyvm "Windows 8" --nic1 nat

Installing Microsoft Office on Wine

I tried to install via Play on Linux, but the install wouldn’t work.  At first, I thought the problem was because I had a different version of Office than what was expected.  Looking back, I think it was because I had the wrong CD in.  It was a 3 disk set, but I didn’t see that at first.

So, I installed by following this post and installed it manually:


sudo apt-get install mesa-utils mesa-utils-extra libgl1-mesa-glx:i386 libgl1-mesa-dev ia32-libs
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/mesa/libGL.so
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so /usr/lib/i386-linux-gnu/libGL.so
sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get update
sudo apt-get install wine
export WINEPREFIX="/home/cgomez/.wineprefixes/office2010/"
export WINEARCH="win32"

Then, I ran winetricks and installed:

  • dotnet20
  • msxml6
  • corefonts (under install a font)

Then, in winecfg, I set:

  • msxml6 to native
  • gdiplus to native

Next, I used wine to run the setup program on the CD.

After installing, I ran winecfg one more time and set riched20 to native.

Conclusion

Thankfully, my persistence paid off.  I was able to get the machine up and running.  I wasn’t super happy with the performance of the machine.  It seemed to run slow at times, which is frustrating for a brand new machine.  I ended up coming back and installing Windows Vista for the virtual machine.  The Windows 8 just didn’t work well in Virtual Box.

Also, I think it is worth noting that I could have probably used that “Boot Repair” program with Linux Mint.  Both are debian based, and I think it would have worked had I discovered it before trying Ubuntu.

I hope these notes help someone else.  They are a bit abbreviated at times, but at least I have some notes as to what I did.

Resources

Great Link: Email Tool

I found this great link to help open email attachments:

Encryptomatic’s Free Online Email Viewer

It doesn’t happen often, but every once in a while, someone will send me an email attachment.  It is either a file that ends with “.eml” or a winmail.dat file.  GMail can’t open those attachments; it has a “View” link but that just shows the raw text that can be very hard to read.  Now, I can use this tool.

Email Attachments

The tool says that you can “Upload and View a .EML, .MSG or winmail.dat message”.  I haven’t used it a lot, but it has worked for me so far.  The only problem that I have had is that I haven’t gotten winmail.dat files to work yet:

Trying to upload winmail.dat

Time to Clean Up: Out of Space for New Kernels

This past update, I started getting a new error.  My /boot mount was full.  The problem was that I had 6 or 7 previous kernels still in the mount taking up space.

Boot Mount Full Message

I was able to fix it with a command written by Linerd.  He did a very nice job explaining it, so I would recommend that you follow through and read his post.

To make a long story short, I first ran the trial command:


dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | xargs sudo apt-get --dry-run remove

Then, I ran the full command (without the –dry-run):


dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | xargs sudo apt-get -y purge

Now, I am good to go!  Thanks Linerd.

Resources

Too Many Inodes

I recently switched to Host Gator, and they have policy about the number of inodes.  I just noticed that my account moved to “Not Backed Up” just recently.  So, I thought I would blog a few of the things I learned while exploring…

Determining the Number of Inodes in a Directory

I found this command would do the trick:

find . -printf "%i\n" | sort -u | wc -l

One of the advantages of Host Gator is that they provide SSH access.  I was able to login quickly and run the command in the different directories.  If you have a host that doesn’t offer SSH access, may I suggest PHP Shell?

Git Repositories

I had a rough guess that my git repositories might be part of the culprit.  If it’s based on the number of files, I guessed that git uses a bunch to track changes.  So, I did a little tinkering.

Sure enough, most of the inodes in my project are in the .git directory:


$ find . -printf "%i\n" | sort -u | wc -l
2050
$ find .git -printf "%i\n" | sort -u | wc -l
1195

I found a few options to try.  First, I tried the fsck command, but that didn’t seem to make a difference in the inodes:


$ git fsck --full
Checking object directories: 100% (256/256), done.
dangling commit 9e18c6e42e3f62127776bdd2f52608f904991e08
$ find .git -printf "%i\n" | sort -u | wc -l
1195

Next, I tried the gc command, and that seemed to make all the difference in the world:

# git gc --prune=today --aggressive
Counting objects: 912, done.
Delta compression using up to 16 threads.
Compressing objects: 100% (900/900), done.
Writing objects: 100% (912/912), done.
Total 912 (delta 525), reused 0 (delta 0)
$ find .git -printf "%i\n" | sort -u | wc -l
37

The repack didn’t do much:

# git repack
Nothing new to pack.
$ find .git -printf "%i\n" | sort -u | wc -l
37

WordPress Cache

My next culprit is the WordPress Cache.  For example, on one of my blogs, the cache accounts for 76% of the inode count.


$ find . -printf "%i\n" | sort -u | wc -l
23323
$ find wp-content/cache/ -printf "%i\n" | sort -u | wc -l
17766

Well, that is another task for another day.  This is where I will start though.  If you have any ideas, please comment.

Resources

Great Link: CDN for Angular, Bootstrap, etc.

I was looking for a CDN to use with Bootstrap and Angular, and I found a great resource.  CDNjs.com ended up doing the trick.  I also learned that you can discover many great Javascript libraries and projects by going through the offerings of different CDNs.  So, with that being said, here is a list of the CDNs that  I discovered:

Just to give you an idea of what I ended up with, here’s part of the <head> of my project.  I used the head javascript library for most of the javascript:

<head>
	<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet">
	<link href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css" rel="stylesheet">
	
	<script src="//cdnjs.cloudflare.com/ajax/libs/headjs/0.99/head.min.js"></script>
	<link type="text/css" href="css/devtools.css" rel="stylesheet" />	
	
	<script>
		head.js(
			//  https://groups.google.com/forum/?fromgroups=#!topic/ace-discuss/rNckG17-7ac
			//  http://stackoverflow.com/questions/5733275/chrome-uncaught-syntax-error-unexpected-token-illegal
			"//d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js",
			"//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js", 
			"//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js", 
			"//cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.1/angular.min.js",
			"js/app.js",
			function() {
				/* My initialization ... */
			}
		);
	</script>

If you know of a CDN that I missed, please comment below!

Resources

Google Voice Voicemail Rings

I have really enjoyed using the Google Voice option for voicemail on my cell phone.  The cool part is that it sends me an email with the voicemail message.  The message is attached in sound form and it also makes an attempt to do voice recognition.  The one disadvantage is that it rings way too many times.  Some people give up on leaving a message because it rings so many times.  Well, thanks to Evan Wondrasek, I found a fix!

Here’s the original article:

Techorator: How to Prevent Extra Rings using Google Voice as Voicemail

Read More

Troubleshooting: Playing DRM Videos from Amazon

This is the second time this has happened.  I keep getting:

Sorry we were unable to stream this video.  This is likely because your flash player could not be updated.

I had just reinstalled my media laptop with Linux Lite OS (a flavor of Ubuntu), and I was trying to watch a video from Amazon.  It was one of the Prime Instant Videos.

To fix the issue, I followed McDougall’s instructions.  Basically, it was just installing the “hal” package and deleting the .adobe and .macromedia settings directories:

sudo apt-get install hal
rm -r ~/.adobe ~/.macromedia

Finally, I rebooted and retried.  It all worked fine after that.

Resources

Fixing Super Tux Kart

Super Tux Kart is a fun game that my son and I have gotten into.  It has recently improved quite a lot, and we have enjoyed playing it.

But, just recently, I found that it crashes a lot.  It’s not predicable, it will either freeze the X display or it will just close in the middle of a race.

So, I decided to do a quick Google search to see if there was a solution out.  I can’t find the article now, but something suggested that maybe it was a bug that was already fixed.  I found I had version 0.7, and version 0.8 was available.

On the download page, it suggested a repository.  So, I installed this repository:

sudo add-apt-repository http://ppa.launchpad.net/stk/dev/ubuntu

To get it to install, I ran the regular apt-get update…

sudo apt-get update
sudo apt-get upgrade

After that, I had the 0.8 version.  In addition, the crashes seem to have gone away, so far.