Friday, December 9, 2011

Wireshark - no capture interfaces as normal user

In Ubuntu 10.04, Wireshark shows no capture interfaces unless run as root. Found a couple options listed here:

http://steve.kargs.net/bacnet/wireshark-on-ubuntu-not-as-root/

Option 1
sudo apt-get install libcap2-bin wireshark
sudo chgrp admin /usr/bin/dumpcap
sudo chmod 750 /usr/bin/dumpcap
sudo setcap cap_net_raw,cap_net_admin+eip /usr/bin/dumpcap

Option 2, I used this one
sudo dpkg-reconfigure wireshark-common
sudo adduser skarg wireshark

Thursday, December 8, 2011

glc - ALSA and OpenGL video capture tool

Helpful link:
http://www.dedoimedo.com/computers/glc.html

Capture:
glc-capture executable
Use Shift+F8 to start/stop recording.

Play:
glc-play recorded_file.glc
Encode?
glc-play filename.glc -y 1 -o - | mencoder-demuxer y4m - -ovc lavc -lavcopts vcodec-mpeg4:vbitrate=3000 -o output.avi

Saturday, November 12, 2011

No sound in Pingus

I downloaded Pingus but alas, no sound. Tried disabling pulseaudio which worked for Outgun, but no luck.

Found this bug listing: https://bugs.launchpad.net/ubuntu/+source/pingus/+bug/571536

1. I tried to install libsdl1.2debian-pulseaudio, said it was already at newest.
2. Installed libsdl1.2debian-alsa, which removed pulseaudio and ubuntu-desktop
3. Disabled pulseaudio (pingus sound worked!), enabled pulseaudio (no sound)
4. Installed libsdl1.2debian-all, which removed libsdl1.2debian-alsa
5. Disabled pulseaudio (pingus sound worked!), enabled pulseaudio (no sound)

A related post that looks promising, but I have not tried it: Elegant solution to disable pulseaudio

Tuesday, November 1, 2011

Virtualbox KVM error

I installed QEMU, but then a few days later when I tried to run my Virtualbox Windows 7 64-bit Guest, I got this error:

AMD-V is being used by another hypervisor. (VERR_SVM_IN_USE). VirtualBox can't enable the AMD-V extension. Please disable the KVM kernel extension, recompile your kernel and reboot (VERR_SVM_IN_USE).

I uninstalled QEMU (as suggested in some of the forums), and tried again but still go the same error.

Then I found this command which worked. However, it is temporary and you'll have to run it after each reboot.
sudo rmmod kvm_amd kvm
Next I found this code, which also worked but would have to be run after each reboot.
sudo service qemu-kvm stop
But... why should I be disabling a qemu-kvm service when I supposedly uninstall QEMU???

I checked services but could find not find an entry for qemu-kvm. After doing a system search for qemu-kvm, I found this file:
/var/lib/update-rc.d/qemu-kvm
I moved the file to my home folder, rebooted, and now my 64-bit Guest OS's are working again :)

Tuesday, October 25, 2011

Pingus script to play extra levels

Pingus is a nice Lemmings clone. Many of the levels are loadable only by the level editor or command line. You can also create custom Levelsets, but whichever method you use, they are all somewhat cumbersome.

I found a nice bash script here that loads individual levels and used it as a basis to create my own with some improvements. The new script gives you the option to open Pingus normally or select an individual level.

1. Change the PINGUS_DIR path to your pingus binary

2. Edit the Pingus command line parameters a few lines down (/pingus $f -g 1280x720 -f) if you want to change screen dimensions, etc

#!/bin/bash

#####################
# Pingus launcher #
#####################


# Pingus directory
PINGUS_DIR=~/pingus-0.7.4

# How do you wan to run Pingus
function runPingus {
  cd $PINGUS_DIR
  ./pingus $f -R 1280x720 -f
}

# Pingus level directory
PINGUS_LVL_DIR=$PINGUS_DIR/data/levels

function doExit {
  # if exit code equals 1, dialog was cancelled, exit
  if [[ $? == 1 ]]
  then
    exit
  fi
}

# show zenity menu for selecting how to start Pingus
ans=$(zenity --list --text "Pingus" --radiolist --column "" --column "" --hide-header TRUE "Start Pingus normally" FALSE "Select individual level")
# run doExit function to test if menu was cancelled
doExit

# if individual level was selected...
if [[ $ans == "Select individual level" ]]
then
  cd $PINGUS_LVL_DIR
  exec >/dev/null 2>&1
  f=1
  while [ "$f" != "" ]
  do
    # prompt for level select
    f="$(zenity --title="Last Level: $(cat ~/.pingus.last)" --file-selection)"
    [ "$f" != "" ] && echo $(basename $f) > ~/.pingus.last
    # check to see if dialog was cancelled
    doExit
    # change to Pingus dir and run
    runPingus
    cd $(dirname $f)
  done
else
  # if starting Pingus normally, just run it
  runPingus
fi

Tuesday, October 18, 2011

Trimming FLV Videos

I wanted to trim some FLV videos without re-encoding.

flvtool2 is supposed to cut flv videos (in milliseconds!), but I always got errors.
flvtool2 -C -i 6000 -o 12000 input.flv output.flv
Avidemux opened the video and I could trim it (using keyframe arrows was necessary), but trying saving in FLV format had errors. Saving as an MP4 with copy/copy was successful, but sound was no longer synced. There is an option to shift the audio, but I didn't do any testing.

ffmpeg ended up being the easiest solution, but it didn't trim exactly where I specified. I'm guessing this has to do with keyframes. The following example trims approx first 15 seconds off the front of the video, and audio is synced.
ffmpeg -ss 15 -i input.flv -acodec copy -vcodec copy output.flv
According to the man pages, the value can be specified to millisecond: "hh:mm:ss[.xxx]", but I could never get this to work.

Thursday, October 6, 2011

JDiskReport - Find folder and file sizes quickly

JDiskReport finds files, largest on down. Very useful for finding where the bulk of you disk space is going.

http://www.jgoodies.com/freeware/jdiskreport/

Finding recently modified files in Ubuntu

A slight variation from this page:
http://mediakey.dk/~cc/linux-howto-find-the-most-recently-changed-files-recursively/

find . -type f -printf "%TY-%Tm-%Td %TT %p\n" | sort -r | less
Newest files on top, scroll through list using up/down arrow keys or page up/down, press Q to quit.

Wednesday, September 21, 2011

Open Samba Shares in Nautilus

Open Nautilus

Press Ctrl+L (or use menu: Go > Location)

Type: smb://192.168.123.123 (using IP of target share)

And you're in...

Tuesday, September 6, 2011

Rhythmbox - Changing the Genre Reverts after Program Restart

I have used Rhythmbox to edit the tags of many songs, but recently I came across one album that would not keep changes I made to the Genre field. Initially, the changes would be made, but after restarting Rhythmbox, the Genre had reverted back to the original.

I tried changing the song title, and and that worked, even after re-starting Rhythmbox.

I opened these mp3s in a few different audio players, and they all showed the new Genre. Sigh. However, Rhythmbox still showed the old Genre. This seemed to point to a tag version problem.

I ended up using Audio Tag Tool and found that all these songs had a v1 tag but no v2 tag. This tool did not show the v3 tag (but I knew it existed). The fix was to copy the v1 tag to the v2 tag (Ctrl+2) and then delete the v1 tag for each file (deleting the v1 tag might not have been necessary, I don't know).

Then I opened the files in Rhythmbox, edited the Genre, quit out, re-launched Rhythmbox, and the Genre was changed!

Reset Gnome Panel to Default

Sometimes I screw something up with the main panel bar at the top and can't figure out how to get it back, so it's easier to just reset the panels and start over.

In Terminal, do:
gconftool --recursive-unset /apps/panel
Then do:
pkill gnome-panel

Tuesday, August 9, 2011

Virtualbox Ubuntu guest - accessing shared folders

Launch guest OS in Virtualbox and add a new shared folder, we'll call it Files.

Open the terminal and create a new folder:
sudo mkdir /mnt/Files
Mount the shared folder:
sudo mount.vboxsf Files /mnt/Files/

Sunday, August 7, 2011

Install Sun Java in Ubuntu 10.04

http://www.ubuntugeek.com/how-install-sun-java-runtime-environment-jre-in-ubuntu-10-04-lucid-lynx.html

sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts
java -version

If necessary, change which Java implementation is selected
sudo update-alternatives --config java

Thursday, July 28, 2011

Getting Broadcom wireless drivers working in Ubuntu 11.04

Installing the default Broadcom driver didn't work. (System > Administration > Additional Drivers)

Solution found here:
http://askubuntu.com/questions/38327/broadcom-bcm4311-wireless-not-working
  • Open Synaptic Package Manager and uninstall bcm-kernel-source
  • Install b43-fwcutter
  • Then install firmware-b43-installer (this one didn't show up for me until b43-fwcutter had been installed)
In Terminal do:
cat /etc/modprobe.d/* | egrep '8180|acx|at76|ath|b43|bcm|CX|eth|ipw|irmware|isl|lbtf|orinoco|ndiswrapper|NPE|p54|prism|rtl|rt2|rt3|rt6|rt7|witch|wl'
See if the term blacklist bcm43xx is there. If it is, it needs to be commented out.

Edit the file:
sudo gedit /etc/modprobe.d/blacklist.conf
Put a # in front of the line: blacklist bcm43xx:
# blacklist bcm43xx
  • Save the file
  • Reboot

Install NVIDIA drivers in Ubuntu 11.04

This is the easiest method I've found...

sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
sudo apt-get update
sudo apt-get install nvidia-current nvidia-current-modaliases nvidia-settings

Reboot.

See this link for more detailed information including supported video cards.
http://www.webupd8.org/2010/06/how-to-install-nvidia-25635-display.html

What's my Ubuntu version and name?

Open Terminal and type:

cat /etc/lsb-release
Output:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=11.04
DISTRIB_CODENAME=natty
DISTRIB_DESCRIPTION="Ubuntu 11.04"

Thursday, July 14, 2011

Volume slider missing from panel in Ubuntu 10.04

This will restore the top panel to defaults...

Delete the following folder:
rm -r ~/.gconf/apps/panel
Or rename the folder instead if you want a backup copy just in case:
mv ~/.gconf/apps/panel ~/.gconf/apps/panel-bak
Log out and back in.

Monday, July 4, 2011

VLC - Automatic Deinterlace

It gets old to manually select deinterlace options for videos, so I enable it by default.

Click Tools > Preferences
Under Show Settings (lower left) select All.
In the left column, expand Video (click the + beside it)
Select Filters (not expand).
In the right column under Video filter module (first section) check the Deinterlacing video filter option.
Expand the the Filters section in the left column. (click the + beside it)
Select Deinterlacing.
In the right column select the preferred modes. I like X.
Save settings.

VLC - Audio/Video Syncronization

After upgrading to VLC 1.1.10, audio was out of sync with all videos.

Click Tools > Preferences
Under Show Settings (lower left) select All.
In the left column, select Audio
Change the Audio desynchronization compensation value.

During playback, synchronization can be changed using J and K. Any changes will be discarded when VLC is closed.

VLC - Video Effects > Crop

Sometimes a widescreen DVD or other video has black bars on the top/bottom. The actual video image is 16:9, but it has been formatted at 4:3 putting black bars on the top and bottom. You end up watching a shrunk 16:9 video on the widescreen monitor. Annoying.

Go to Tools > Effects & Filters
Video Effects tab
Crop tab
Change the Top/Bottom values to crop the video.

You can also use keyboard shortcuts to crop the video:
Crop one pixel from the top: Alt+r
Bottom: Alt+c
Right: Alt+f
Left: Alt+d

This crop method worked back in Ubuntu 8.04 and was very handy, but now Top/Bottom crop doesn't work. No cropping actually takes place, and the image stretches sideways. I haven't been able to figure it out. Right/Left crop both crop the right side. I upgraded to VLC 1.1.10, and the Top/Bottom crop worked. After trying a few videos, it was back to the no-crop-only-stretch. Even after deleting preferences it still didn't work. Well, I guess I'll have to resort to auto crop for now.

VLC - Automatic crop

Sometimes a widescreen DVD or other video has black bars on the top/bottom. The actual video image is 16:9, but it has been formatted at 4:3 putting black bars on the top and bottom. You end up watching a shrunk 16:9 video on the widescreen monitor. Annoying.

In previous versions of Ubuntu & VLC, I would manually go to Tools > Effects & Filters, Video Effects tab, Crop tab, and change the Top/Bottom values to crop the video. In all VLC versions I've used in Ubuntu 10.04, Top/Bottom crop don't work they way they used to, no cropping actually takes place, and the image stretches sideways. I haven't been able to figure it out. Right/Left crop both crop the right side.

After some looking through the settings, I found a setting for automatic cropping that works.
  1. Click Tools > Preferences 
  2. Under Show Settings (lower left) select All.
  3. In the left column, expand Video (click the + beside it)
  4. Select Filters (not expand). 
  5. In the right column under Video output filter module (second section) check the Crop video filter option. 
  6. Expand the the Filters section in the left column. (click the + beside it)
  7. Select Crop
  8. In the right column check Automatic cropping.
  9. I also like to change the Number of images for change setting. By default it is 25, which equals about 1 second. So if there is a change in the black border for 1 second, the screen will flicker and change. This makes some videos change much more frequently than is necessary, and the flicker can get annoying. I changed it to over 500 so it would take at least 20 seconds (25fps * 20sec = 500) of difference before changing the crop. 
  10. Click Save button. 
  11. Restart VLC.
Keep in mind that if you changed the Number of images for change setting to something higher, the crop won't take place right when you start playing the video. In my case I'll have to wait 20+ seconds for the crop to change.

Saturday, June 18, 2011

Extracting images from a PDF

I had a 140 page PDF and wanted each page as an image. Each page happened to be a scanned image, so it was as simple as extracting all images from the PDF.

Install PDF utilities
sudo apt-get install poppler-utils
Save images as jpg using pdfimages
pdfimages -j file.pdf imagename
You can also save as ppm images, which are larger than jpg but are lossless
pdfimages file.pdf imagename

Rotating Multiple Images

I had 140 images that needed to be rotated, batch style. I didn't want to rotate them one by one. I used Imagemagick to rotate them via the command line. You could also use the Nautilus Image Converter which adds Resize and Rotate Images to the context menu of images.

Install Imagemagick:
sudo apt-get install imagemagick
Rotate 90 degrees (files will be overwritten!):
mogrify -rotate 90 *.jpg
If you don't want the original files overwritten, use convert instead:
convert -rotate 90 *.jpg
Alternately, install the Nautilus Image Converter.
sudo apt-get install nautilus-image-converter
Log out / in or restart for the context menu items to show up in Nautilus. Select all the images you want to rotate, right-click and select Rotate Images.


Change the settings and rotate!

Combining PDF files with Pdftk

A user manual I downloaded was split into about 20 pages, and I wanted it combined into a single document.

Pdftk did the job.

After looking at the official examples, and since all of my PDF's were numbered sequentially, I successfully combined them all using a wildcard:
pdftk *.pdf cat output combined.pdf
If they are not numbered sequentially, you'll have to include each filename:
pdftk 1.pdf 2.pdf 3.pdf cat output 123.pdf
If you prefer a GUI, install PDF Chain.

Saturday, June 4, 2011

Compacting a Windows 7 Virtualbox vdi Disk Image

When you add data within a dynamically-sized Guest OS, the vdi file gets larger in the Host OS. When you delete data from within the Guest OS, the vdi file does not get smaller but retains its size. You can compact it to reduce the size and save disk space.

Most of these steps I grabbed from oracle's blog: http://blogs.oracle.com/virtualbox/entry/how_to_compact_your_virtual

  1. Within the Guest OS, delete any files you don't need. Also, run a full system cleanup (I like bleachbit).
  2. Defrag using whatever tool you prefer (I used Smart Defrag)
  3. Download SDelete, and run the following command to zero out free space:
sdelete -c
  1. Shutdown the Guest OS.
  2. From the Host OS, run:
VBoxManage modifyhd Windows7.vdi --compact
And you're done!

Virtualbox Windows 7 guest OS inaccessible after upgrade to 4.0.8

I upgraded Virtualbox to v4.0.8. The Windows 7 Guest OS booted up and shut down with no problems. The second time I tried to boot, I got the following error in the main Virtualbox window, and it said the OS was inaccessible:

Location: '/home/user/.VirtualBox/Machines/W7/W7.vbox', line 142 (3), column 36.
/home/vbox/vbox-4.0.8/src/VBox/Main/src-server/MachineImpl.cpp[679] (nsresult Machine::registeredInit()).
Result Code:
NS_ERROR_FAILURE (0x80004005)
Component:
VirtualBox
Interface:
IVirtualBox {d2de270c-1d4b-4c9e-843f-bbb9b47269ff}


This ticket solve the issue: http://www.virtualbox.org/ticket/8948

I had to edit the .vbox file to remove a "strange" character at the line specified above and once back in the Guest OS, edit the registry to fix the issue.

1. Go to HKLM\SOFTWARE\Oracle\VirtualBox Guest Additions
2. Create a string key VersionEx (use exactly this spelling)
3. Give it a reasonable value
4. Shut down the VM.

Getting VPN to work in Virtualbox Windows 7 guest OS

By default, NAT was the default Network setting for the Windows 7 guest OS. The VPN connection would not work until I changed it to Bridged Adapter.

Monday, May 9, 2011

Grub managers

Recently I have been using Grub Customizer for my Grub configuration. I used to use StartUp-Manager, but parts of it didn't work in Ubuntu 10.04. Grub Customizer had more options and did what I needed.


Grub Customizer
https://launchpad.net/~danielrichter2007/+archive/grub-customizer

After following steps for adding the PPA to your system, install with:
sudo apt-get install grub-customizer
Run it by going to Applications > System Tools > Grub Customizer


StartUp-Manager

Install with:
sudo apt-get install startupmanager
Run it by going to System > Administration > StartUp-Manager

UNetbootin and USB persistence

From http://unetbootin.sourceforge.net/diskimg/readme.txt...

Go to http://unetbootin.sourceforge.net/diskimg/ and download one of the files (128mb.zip, 256mb.zip, or 512mb.zip) corresponding to the amount of persistent space you want (make sure the size of the persistent disk image is smaller than the free space you have on your USB drive).

Now extract the file "casper.rw" from the zip file to your USB drive.

Now edit D:\syslinux.cfg (assuming D:\ is where your USB drive is) and add in "persistent" at the end of the line that begins with "append", and save the file, so your syslinux.cfg should look something like this:

default unetbootin
label unetbootin
kernel /ubnkern
append initrd=/ubninit file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash persistent --


For more info see https://help.ubuntu.com/community/LiveCD/Persistence

Mouse acceleration too high in Ubuntu 10.04

One day my mouse was moving waaay too fast - no idea what caused it. Changing mouse settings in System > Preferences > Mouse did not slow it down enough, so I had to find a different method.

Open the terminal and type:
xinput --list --short

Find the name of your device. Mine was Areson USB Device.

Set the constant deceleration (a value to 2 worked best for me):
xinput --set-prop "Areson USB Device" "Device Accel Constant Deceleration" 2

To run this command at startup, create a script (mouseAccel.sh):
#!/bin/sh
xinput --set-prop "Areson USB Device" "Device Accel Constant Deceleration" 2


Set permissions to make it executable:
$ chmod +x mouseAccel.sh

Add it to System -> Preferences -> Startup Applications

Samba setup in Ubuntu 10.04

Things I wanted to accomplish:
- Share files on internal Harddrives
- Share files on external USB Harddrives that are frequently disconnected

I tried NFS first, but for whatever reason, it was slow and frequently caused the PCs to freeze if shares were not unmounted prior to being disconnected. Samba has been much more forgiving.

Folder sharing
To share a folder, right-click on it and select Sharing Options. If you're not setup for sharing, it will prompt you to install some packages. Change the share name if it complains that it already exists.

External USB Harddrive sharing
Instead of sharing the actual harddrive, I created a symbolic link in my home folder to /media for USB harddrives that were frequently disconnected.

Samba is not setup to follow symbolic links by default, so this must be enabled. Add to /etc/samba/smb.conf in [global] section:
follow symlinks = yes
wide links = yes
unix extensions = no

Restart samba via the terminal:
$ sudo restart smbd
Quirks
  • Using shares-admin doesn't show shared folders...
  • Looking at smb.conf doesn't show shared folders...
  • Sometimes folders don't show as being shared in nautilus, but they are...

Sound not working in Outgun

In Ubuntu 10.04 sound was not working in Outgun. The fix that worked was one I came across when having sound issues with Skype.
  1. "...edit or create the file ~/.pulse/client.conf and add a line containing "autospawn = no" there..."
  2. Restart (maybe log out/in works?)

This fixed the sound problem but created new problems:
  • Audio controls on the keyboard no longer worked
  • Volume slider in the panel no longer worked
  • System > Prefs > Sound no longer worked

After some toying around, I found that pulseaudio could be disabled / enabled without having to restart or log out. I put together a script that disables pulseaudio, runs Outgun, and then restarts pulseaudio after the game is shut down.
 
The script doesn't entirely make sense to me. Creating the client.conf file wouldn't be necessary I would think, especially right before killing pulseaudio. But the sound fix didn't work otherwise.
 
#!/bin/bash
# create client.conf file
cd ~/.pulse
echo "autospawn = no" > client.conf
# kill pulseaudio
pulseaudio -k

# run outgun
cd ~/outgun_1.0.3_r336
./outgun

# remove client.conf file
cd ~/.pulse
rm client.conf

# restart pulseaudio
pulseaudio --start

Sunday, May 8, 2011

Some Skype sounds don't work in Ubuntu 10.04

At one point I had problems with the sounds in Skype on Ubuntu 10.04. Some worked, others did not. I could play them in VLC just fine, but not in Skype. Right now running Skype 2.2.0.25, these problems seem to have disappeared. Below is what I did previously to work around this problem.

Official Skype fix here
  1. "...edit or create the file ~/.pulse/client.conf and add a line containing "autospawn = no" there..."
  2. Restart (maybe log out/in works?)

This solved the Skype sound problem but created new problems:
  • Audio controls on the keyboard no longer worked
  • Volume slider in the panel no longer worked
  • System > Prefs > Sound no longer worked
I tried playing a dvd and some mp3s, and they worked just fine. Overall I didn't like this option because it took away a lot of the control I had over my sound. If you go this route, you can install gnome-alsamixer for sound settings. sudo apt-get install gnome-alsamixer
My workaround
  1. Don't do the fix outlined above
  2. Create bash scripts that play the desired sound using vlc or other software
  3. Go into Skype Options, Notifications, find desired sounds
  4. Disable the sound playing for each
  5. Enable the script for each
CallRingingIn.sh example script #!/bin/bash
# Incoming call, play and quit
vlc --play-and-exit /usr/share/skype/sounds/CallRingingIn.wav

ContactOnline.sh example script #!/bin/bash
# Contact comes online, plays twice and quits
vlc --play-and-exit /usr/share/skype/sounds/ContactOnline.wav vlc --play-and-exit /usr/share/skype/sounds/ContactOnline.wav

Don't forget to change permissions so each script is executable $ chmod +x CallRingingIn.sh

Trisquel On A Sugar Toast - USB startup disk with persistence

I tried installing Sugar in Ubuntu 10.04, but according to the official wiki, there are issues. So instead I was using a live CD. This was OK, but all changes were lost after a reboot. I was pleased to find an easier and more flexible solution: a Sugar USB startup disk with persistence.

1. Download the ISO
http://wiki.sugarlabs.org/go/Trisquel_On_A_Sugar_Toast#Download
Currently Sugar 0.86.2 with the Fructose and Honey activities built on top of Trisquel 3.0 (based on Ubuntu 9.04).

2. Use Virtualbox to launch the OS.

3. Create a USB startup disk.
The official instructions say to open the terminal and type usb-creator, but that command doesn't exist. It's usb-creator-gtk.

4. Using the GUI, create the startup disk.
Insert your USB stick before or after running usb-creator-gtk, it doesn't matter. Make sure to specify how much space you want to use for saving files / settings. Creating the startup disk will take a few minutes. If there are existing files on the disk, they won't be erased.

5. Additional tweaks:
The default timeout at the main boot menu is 30 seconds. I like to change this to something smaller to speed up the boot process. Boot into your regular OS, insert the USB stick and edit /syslinux/syslinux.cfg. Find the line: TIMEOUT 300 and change it. I set mine to 20 which is 2 seconds.

6. Reboot using the USB stick.
Make any changes / updates you want. One thing I noticed was that the sound was muted by default, so make sure to turn it on. Move the mouse to a corner, then click the speaker icon in the lower right.

7. Backup the persistence file
I like to create a backup copy of the persistence file in the case that I want to revert back to my "default" settings or create another USB stick. In your OS of choice, backup the casper-rw file from the USB stick.
A final observation: delete journal entries if an application is slowing down or having issues. This was the solution when Physics started becoming very slow after a lot of shapes were added and existed somewhere offscreen.

Saturday, May 7, 2011

Getting my iPod touch to work with gtkpod

After upgrading my iPod touch to iOS 4.2.1, it didn't mount at all in Ubuntu 10.04. I found help here, and got the device to mount again.

However, gtkpod still did not detect it. Ubunut's help mentioned ifuse, but this blog provided the walkthrough I needed.

I installed ifuse:
$ sudo apt-get install ifuse
Created a folder for mounting the iPod, changed permissions:
$ sudo mkdir /mnt/ipod
$ sudo chmod 777 /mnt/ipod

Mounted the iPod
$ ifuse /mnt/ipod
And it worked! gtkpod detected my iPod touch and I was off and running.

When finished, "unmount" the ifuse mount with:
$ fusermount -u /mnt/ipod

As I didn't want to have to manually run ifuse / fusermount each time I ran gtkpod, I created a script to do this for me and saved it as gtkpod.sh:
#!/bin/bash

# mount using ifuse
ifuse /mnt/ipod

#run gtkpod
gtkpod

# unmount
fusermount -u /mnt/ipod

At a command prompt, change permissions on the file so it can be executed:
$ chmod +x gtkpod.sh
Then, you can either run the script via command line by running:
$ ./gtkpod.sh
Or, create a launcher on the desktop that runs the script (my preference).

Converting videos for iPod touch using Handbrake

I use Handbrake because:
  1. It can convert DVD, flv, avi, m4v, mp4, etc.
  2. It has an iPhone & iPod Touch preset.
  3. It supports multiple CPU cores, so conversions are quick (if you have multiple cores :)
After conversion, copy files to the iPod.
Method 1
Use gtkpod to copy / sync. Copying a 40 MB file took about 1 minute.
Method 2 (preferred)
Copy files to the iPod using Nautilus and and copy the videos to the Videos folder. Copying a 40 MB file took about 10 seconds.
The only downside to using Nautilus to copy the videos is that they don't show up in the Movie Player! So, I use iFile to locate and open the videos. Click Video Player when it asks how you want to open the file.

MP4Box for trimming m4v videos

I had some H.264 m4v videos that I wanted to trim.

I used Avidemux a while back for trimming some xvid avi videos, but trying to trim the H.264 m4v videos didn't work. The cuts would work, but the video would be slightly jerky (using Copy). Re-encoding the video did work, but the whole point was to losslessly cut the video to save time & quality.

I tried using ffmpeg to trim the videos, but I could never get the -t flag to work. I came across a few other posts of other people having the same problem.

Then I found MP4Box, and it worked. (It's part of the gpac package).

This example extracts a new file starting at 0 and ending at 267.8 seconds.
MP4Box -splitx 0:267.8 input.m4v -out output.m4v
Notable commands from the manual that might be handy later:
-split time_in_seconds
splits in files of desired maximum duration. This will remove
all MPEG-4 Systems media.

-splits size_in_kilobytes
splits in files of desired maximum size. This will remove all
MPEG-4 Systems media.

-splitx start:end
extracts a new file from specified start to end times (in sec‐
onds). This will remove all MPEG-4 Systems media. When input
file is an ISO-Media file (QT, MP4, 3GP), if no output is speci‐
fied THE INPUT FILE IS OVERWRITTEN.


-cat <src_file>
concatenates all src_file tracks to input file, creating it if
not exisiting. Media samples are added at the end of existing
compatible tracks. If no compatible track is found for a media
it is created. Up to 20 cumulated -cat operations can be used.
Syntax is the same as -add.

Monday, April 25, 2011

VirtualBox - USB devices greyed out in Guest OS

Ubuntu 10.04 Host
VirtualBox 4.0.x
Windows 7 Guest


I had this problem previously (on a different OS install) running VirtualBox 3.x with a Windows XP Guest, and steps 1-2 below solved my problem.

This time, running VirtualBox 4.x with a Windows 7 Guest OS, I needed a 3rd step. Guest OS may not have mattered. Shortly after installing the new VirtualBox, I installed the VirtualBox Extension Pack to support USB 2.0 devices.

Following steps 1-2 removed the "greyed out" problem, but the USB devices would not mount and were inaccessible in the Guest OS. I had to open the Guest OS properties and enable the USB 2.0 (EHCI) Controller option.


Steps:
  1. Add your Ubuntu account to group "vboxusers". Go to System > Administration > Users and Groups - then click "Manage Groups", then double-click "vboxusers" then check/enable your account in there.
  2. Reboot (or maybe log out/in? - untested)
  3. Enable USB 2.0 in VirtualBox. Open VirtualBox (not Guest OS), click Settings button for Guest OS. Click USB. Check the Enable USB 2.0 (EHCI) Controller box.

Rosetta Stone - Profile backup

Backup tracking.db3 to save your profile and progress information.

Windows 2000 or XP:
C:\Documents and Settings\All Users\Application Data\Rosetta Stone\tracking.db3

Windows Vista/7:
C:\Program Data\Rosetta Stone\tracking.db3

iPod touch does not mount after iOS 4.2.x upgrade

After upgrading my iPod touch to iOS 4.2.x, it no longer mounted in Ubuntu 10.04.

Following the steps outlined here fixed the problem.
https://help.ubuntu.com/community/PortableDevices/iPhone#Device does not mount after iOS4.2.x upgrade


1. Add the new repository

sudo add-apt-repository ppa:pmcenery/ppa
sudo apt-get update
sudo apt-get dist-upgrade


2. In synaptic, find libimobiledevice0 and uncheck, check libimobiledevice1

3. Apply changes.

A logout / login or reboot may be necessary to allow the auto-mounting to work.

4. If you still have problems, and get TLS error messages when typing the command 'ifuse /media/iphone' in a terminal, rename the ~/.local/libimobiledevice folder to ~/.local/libimobiledevice.old or delete it.

Friday, April 22, 2011

Getting a new iPod touch to work in Virtualbox

Recently got an iPod touch. From the time I turned it on, the screen instructed me mercilessly to plug the thing into iTunes and wouldn't allow me to do anything else.

So I fired up Windows 7 in Virtualbox. After installing iTunes, I mounted the iPod, it was detected and iTunes opened. When I would try to restore the iPod, iTunes would begin the process, but it would never finish, always bringing up an error that, according to Apple's website was a USB-related issue.

I noticed in Virutalbox that the iPod would unmount during this process (no check mark beside it when right-clicking on USB icon in lower right corner). It would never re-mount, and eventually the USB error would come up.

So, on a long shot, I tried the restore again, this time manually re-mounting the iPod after it was unmounted from Virtualbox.

This time the restore began working. I had to manually re-mount the iPod a few times during the process, and it completed.

Now I've got a fully functional iPod touch that I'm using with gtkpod.