How to make Teamviewer work on Ubuntu 13.10 – install lib32asound2?

I had a problem installing Teamviewer on Ubuntu 13.10. This is an awesome tool for helping to remote desktop into other Linux or Windows machines. I downloaded the .deb file but when installing it complained:

unresolvable dependency: lib32asound2

I did some research and some various solutions including installing the package which has been removed from Ubuntu:

The lib32asound2 package is deleted from saucy: https://launchpad.net/ubuntu/saucy/amd64/lib32asound2
You can download lib32asound2 from: https://launchpad.net/ubuntu/saucy/amd64/lib32asound2/1.0.25-4ubuntu4
Direct link for a .deb download for lib32asound2: http://launchpadlibrarian.net/139194357/lib32asound2_1.0.25-4ubuntu4_amd64.deb

So, I downloaded the .deb for this package but got even more dependency errors including:

dpkg: error processing lib32asound2_1.0.25-4ubuntu4_amd64.deb (–install):
cannot access archive: No such file or directory
Errors were encountered while processing:
lib32asound2_1.0.25-4ubuntu4_amd64.deb

The Solution:
The solution for me was to install a different Teamviewer installer:

http://download.teamviewer.com/download/teamviewer_linux.deb

God knows why this teamviewer.deb worked for me but it did.

How to reset your Apple password

I forgot the password to my Macbook Pro and it turns out that there aren’t very many short guides on this. However, it turns out that it is very easy to reset the password on a Macbook.

Step 1 – Boot to the Recovery HD:
Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.

Step 2 – When the menu bar appears select Terminal from the Utilities menu. Enter reset password at the prompt and press RETURN. Follow instructions in the dialog window that will appear.

How to repair / restore Grub on Ubuntu using Live CD

I just upgraded Ubuntu and selected the wrong location to install Grub onto. Basically, I installed Grub on /dev/sda1 and not /dev/sda and so I need to repair and installing grub.

I got out an Ubuntu installer cd which is essential a live cd and booted in it up. Then mounted the sda1 partition:

sudo mount /dev/sda1 /mnt

Grub then needs to have access to /dev so:

sudo mount --bind /dev /mnt/dev

To install Grub on sda then:

grub-install /dev/sda --root-directory=/mnt/ /dev/sda

Note: we are using the –root-directory option rather than changing the root directory using the chroot command which sometimes doesn’t work on a live CD.

For a tutorial with more words these two pages might helped you learn more:

Visualising your source code with gource…

This is the settings that worked for me when running gource

xvfb-run -a -s “-screen 0 1280x720x24” gource -s 0.4 -p 0.01 -1280×720  –auto-skip-seconds .4 –multi-sampling –stop-at-end –highlight-users –hide mouse,progress,filenames,dirnames –file-idle-time 0 –background-colour 111111 –font-size 20 –title “Omlet Lib 4_1” –output-ppm-stream – –output-framerate 60 | avconv -y -r 60 -f image2pipe -vcodec ppm -i – -b 8192K movie.mp4

How to remove exif metadata from jpegs using php or command line

There is a method of hacking php using a security flaw in php in how it handles exif meta data embedded in jpeg, png or gif images. You describe this as an EXIF injection attack. As a precaution it is a good idea to strip all EXIF information from any images that are uploaded to your website.

I have found these two tools really useful to do this and this is a quick outline of how we used them:

Removing EXIF meta data from .jpg on Ubuntu / PHP
There is a really good tool called exiftool. There is a version in the Ubuntu repositories – so it is super easy to install.

apt-get install libimage-exiftool-perl

You can then strip exif meta from a jpeg using the command:

exiftool -all=  filename.jpg

So in php this would look like this:

$output = exec(sprintf("exiftool -all= %s", escapeshellarg($_image_path)));

Removing EXIF meta data from .png images on Ubuntu / PHP
The best tool for removing exif information from .pngs is Optipng. You can install optipng on Ubuntu from source using this recipe.

apt-get install optipng

and so again in php it would look something like this:

$output = exec(sprintf('optipng -strip all %s', escapeshellarg($_image_path)));

I hope this helps someone.

How to install optipng on Ubuntu from source

Optipng is in the Ubuntu repositories but is you want an up to date version then it can be worth installing Optipng from source. This is essentially a script but you can use the commands on there own if you want.

wget --quiet http://downloads.sourceforge.net/project/optipng/OptiPNG/optipng-0.7.3/optipng-0.7.3.tar.gz
tar xf optipng-0.7.3.tar.gz

cd /root/scripts/optipng-0.7.3
./configure > /dev/null 2>&1
make > /dev/null 2>&1

cp /root/scripts/optipng-0.7.3/src/optipng/optipng /usr/bin/
ln -s /usr/local/bin/optipng /usr/bin/optipng

rm /root/scripts/optipng-0.7.3.tar.gz
rm -rf /root/scripts/optipng-0.7.3