Mount files in Ubuntu

UPDATE: Save yourself a lot of trouble and get the convenience of a GUI for mounting images – use the FREE program “Furius ISO Mount”, which you can find in Synaptic or the Ubuntu Software Center.. If you really want to mess with low level stuff and scripts, then you can use the following guide…

Instructions
sudo chmod +x mount.sh
sudo chmod +r mount.sh
sudo chmod +r unmount.sh
sudo chmod +x unmount.sh

Now you need to copy them nautilus scripts:

sudo cp mount.sh ~/.gnome2/nautilus-scripts/mount.sh
sudo cp unmount.sh ~/.gnome2/nautilus-scripts/unmount.sh

How to use
Rightclick on the image file (e.g. .iso) -> script -> mount/unmount
use the command wine path/to/file.exe to execute files on cd’s
Use IAT to convert weird formats to .iso (sudo apt-get install iat)

Installation
sudo chmod +x mount.sh
sudo chmod +r mount.sh
sudo chmod +r unmount.sh
sudo chmod +x unmount.sh

Mount-file
#!/bin/bash
#
# nautilus-mount-iso

gksudo -k /bin/echo "got r00t?"
BASENAME=`basename "${1%.*}"`
sudo mkdir /media/"$BASENAME"
echo $BASENAME

if sudo mount -o loop -t iso9660 "$*" /media/"$BASENAME"
then
if zenity --question --title "ISO Mounter" --text "$BASENAME Successfully Mounted.

Open Volume?"
then
nautilus /media/"$BASENAME" --no-desktop
fi
exit 0
else
sudo rmdir /media/"$BASENAME"
zenity --error --title "ISO Mounter" --text "Cannot mount $BASENAME!"
exit 1
fi

Unmount-file
#!/bin/bash
#
gksudo -k /bin/echo "got r00t?"
BASENAME=`basename "${1%.*}"`
sudo umount /media/"$BASENAME" && zenity --info --text "Successfully unmounted /media/$BASENAME/" && sudo rmdir "/media/$BASENAME/"

Best way to rip music from www.youtube.com in Ubuntu

Download videos:
Use Video DownloadHelper extention for Firefox to download videos as .flv or .mp4. (however its conversion functionality is buggy)

Rip video to mp3:
sudo apt-get install ubuntu-restricted-extras
sudo apt-get install ffmpeg
sudo apt-get install winff

Now find winff in Applications -> Sound and Video and use the GUI to rip the videos you have downloaded.

install and setup LAMP on Ubuntu for development

LAMP stack: Linux, Apache, MySQL, PHPMyAdmin

LAMP: Linux Operating System, Apache Webserver, PHP programming language, MySQL database, PHPMyAdmin database web interface

First install Apache2, PHP5, Mysql, Phpmyadmin in that order.

WEBROOT
########################
Then lets setup ~/public_html as webroot rather than /var/www/ (because it requires root privileges to modify there which is a pain!):

1. Copy the existing website configuration (virtual directory):
sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/mysite

2. Modify the following of mysite:
gksudo gedit /etc/apache2/sites-available/mysite
/var/www -> /home/USERNAME/public_html

3. enable mysite and disable default
sudo a2ensite
sudo a2dissite default
sudo /etc/init.d/apache2 reload

/home/USERNAME/public_html can now be accessed as webroot in webbrowser as http://localhost

PHP
########################
Setup PHP at this file: /etc/php5/apache2/php.ini
short_open_tag = Off (only use <php ?>? rather than non-standard <? ?> (inverted <)
error_reporting = E_ALL | E_STRICT (see all errors including the E_STRICT ones)
display_errors = On (obvious…)
display_startup_errors = On
html_errors = On

Remember to run this to update the apache configuration:
sudo /etc/init.d/apache2 restart

MYSQL
########################
user = root
Remember to use innoDB as storage engine for mySQL databases as it enables transactions and much more.

PHPMYADMIN
########################
access phpmyadmin at localhost/phpmyadmin (use “root” as user)

External guide with lots of more stuff including security: https://help.ubuntu.com/10.04/serverguide/C/httpd.html

Memory stick duo internal reader @ dell m1330 in Ubuntu 10.10 (Ricoh R5C592)

UPDATE: Ubuntu 12.04 includes the Ricoh internal card reader driver, so I will advice you to upgrade your Ubuntu to minimum 12.04 so you do not have to mess around with installing drivers for the Ricoh internal card reader… However if you are stuck with an old version of Ubuntu less than 12.04, then you can follow the guide below:

This is the essential information needed to install a driver for the Ricoh internal card reader (R5C592) so that it can read memory stick duo. It works for my Dell m1330 laptop.

I have got all information from the following bug thread and if there is any problem with my guide then it is probably a good idea to have a look at that thread (e.g. if the linux kernel is not supported):
link

Lets get started! First we gotta make sure that you have the particular memory stick reader chipset.

type the following command: lspci | grep Ricoh

It should output this (03:01.x can vary):
03:01.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 05)
03:01.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 22)
03:01.2 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 12)
03:01.3 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 12)

Now go ahead and click “download master.tar.gz” from http://gitorious.org/ricoh-kernel/ricoh-kernel/trees/master to download the needed driver. I have also uploaded a version of it here, but it might be outdated for the current kernel: ricoh-kernel-ricoh-kernel-master.tar Then unzip the folder.

Open the unzipped folder in a terminal, open to the subfolder “memstick” and write the following commands (if any of them fails, try preceding them with sudo):
make
make install
make load

Now the drive should be present!!!

Big thanks to the Maxim Levitsky for the driver and guidance!!

EDIT:
Be aware that you need to reinstall the driver each time you update the kernel… But I have made a simple gui based script to make it much faster to reinstall the driver: installMemstickDriver.sh

Just put the file in the root folder of the unzipped file (ricoh-kernel-ricoh-kernel-master.tar), make it executable and run it.

This is my first attempt in shell scripting so please don’t be offended by my newbie mistakes.

Remove old Linux Kernels from Dualboot Grub Startup Menu using Ubuntu

First of all, determine which Linux Kernel version you are running using the command:
sudo uname -r

Then go to System ->Administration -> “Synaptic Package Manager”.

Search for “linux-image-“, arrange by installed packages (click at the column header most to the left) and then completely remove all linux kernels (linux-images) that are older than you current version.

Then run the command:
sudo update-grub