How to: Tips and Tricks

Change mouse cursor theme in Ubuntu with Compiz enabled (10.04 and higher)

There is a bug in the Compiz package in Ubuntu 10.04 Lucid Lynx (in Maverick Meerkat too) that doesn't allow you to fully change the mouse cursor theme. You only get the new cursor theme in some windows. But you can still change the mouse cursor theme in Ubuntu, even if you have Compiz enabled.

1. Go to /usr/share/icons and locate the exact folder name for the mouse cursor theme you want to use - remember it! For the Elementary theme, the folder name would be "DMZ-Black"

2. Now you need to edit the /usr/share/icons/default/index.theme file. Press ALT + F2 and enter:

gksu gedit /usr/share/icons/default/index.theme

Comment line with "Inherits=DMZ-White" and under this line add an identical line with the exact name of the mouse cursor theme you got in step 1. The final index.theme should look like this:

[Icon Theme]
#Inherits=DMZ-White
Inherits=DMZ-Black

UPDATE: Second way

Press ALT+F2 and run gconf-editor and go to desktop > gnome > peripherals > mouse and edit cursor_theme. Here you can enter theme name you got in step 1.

3. Restart Compiz by pressing Alt + F2 and entering:

compiz --replace

or simply Log out and Log in.

Via webupd8.org

Umount CIFS problem: Reboot and Shutdown

If You mount samba shares using cifs method like I, You probably have met with delays at shutdown or restart.

[18.312000] CIFS VFS: Server not responding
[18.312000] No response for cmd 5 mid 8

To avoid this delay it is necessary to umount all samba shares before rebooting or shutdown your computer. There are many solutions to fix this problem, but no one did not work for me when i am connected via wifi. So I made two simple launchers for Reboot (init 6) and Shutdown (init 0). More »

Ubuntu: Bash completion does not work with apt-get

If for some reason does not work bash completion in terminal (using the TAB key), look inside the file bash.bashrc. Open terminal and type:

sudo gedit /etc/bash.bashrc

At the line 31 you can find this entry.

# enable bash completion in interactive shells
#if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
#    . /etc/bash_completion
#fi

Uncomment it and save file.

# enable bash completion in interactive shells
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
    . /etc/bash_completion
fi

Ubuntu: Make ALSA default instead of PulseAudio

PulseAudio has still problems with some applications and it always adds a little latency and that's the reason, why so many people still prefer ALSA. This howto shows you, how to remove PulseAudio, add alsa-mixer applet to the panel and associate hotkeys for volume change.

1. Remove PulseAudio

This will uninstall PulseAudio, delete the configuration files and uninstall it's dependencies; gstreamer-10-pulseaudio, libpulse-browse0, libpeexdsp1, pulseaudio-esound-compat, pulseaudio-module-udev, pulseaudio-module-x11, pulseaudio-utils, rtkit and gnome-desktop (don't worry, it is dummy package):

sudo apt-get purge pulseaudio

2. Install alsa-mixer (volume) applet

PulseAudio removes volume applet, so you need new volume applet. For getting it to work, you need to intall the following packages: python, python-notify, python-gtk2, python-alsaaudio and xfce4-mixer or gnome-alsamixer (i preffer xfce4-mixer).

sudo apt-get install python python-notify python-gtk2 python-alsaaudio python-eggtrayicon xfce4-mixer

More »

Ubuntu server: install Alsa sound and MOC (Music On Console)

1. To install Alsa sound (alsa-base, alsa-utils, alsa-tools and libasound2) enter this command:

sudo apt-get install alsa alsa-tools

2. Add yourself to the group audio:

sudo adduser yourusername audio

3. Reboot to take effect

sudo init 6

4. Alsamixer is sometimes muted by default, so you might need to unmute it. Run alsamixer:

alsamixer

Use arrows up and down to change volume, left and right to change source. To mute/unmute press M.

Note: Alsamixer might look different in any machine. It depends on your sound device (sound card). Please, read audio source labels. For example: PCM in Virtualbox is on fifth place instead of the second in VMWare.

Alsamixer in VMWare

alsamixer

Alsamixer in Virtualbox

alsamixer virtualbox

To quit press Q.

If any error occurs, look here. More »

WordPress: modify the upload list of allowed file types

WordPress logo

When you attempt to upload a file in WordPress that is not in the default list of acceptable file types, you will receive the following error: File type does not meet security guidelines. Try another. While there’s no admin-based tool for editing list of allowed file types, it’s not at all difficult to add your own or remove any existing. More »

Ubuntu 9.10: compiling FFmpeg with x264

FFmpeg logo

FFmpeg is a versatile tool to encode and convert a multitude of video and audio formats. x264 encodes high-quality video superior to other popular encoders. Ubuntu 9.10 (Karmic Koala) ships with a version of ffmpeg without libfaac and x264 support because of licensing issues. This means you will need to compile ffmpeg yourself. This guide explains how. More »

Download YouTube videos with youtube-dl

YouTube logoyoutube-dl is a small command-line program to download videos from YouTube.com. It requires the Python interpreter, version 2.x (x being at least 4), and it's not platform specific. It should work in your Unix box, in Windows or in Mac OS X.

Install & using

1. install youtube-dl

sudo apt-get update && sudo apt-get install youtube-dl

2. use this command to download files from YouTube

youtube-dl -o [name of output file] [YouTube URL]

3. To view all options youtube-dl, paste this in command line

man youtube-dl

To quit from manual press q key More »

Put Minimize, Maximize, Close buttons to the left in Ubuntu window

Default are Minimize/Maximize/Close buttons in the title bar on the right. This short tutorial shows you, how to put these icons to the left, like in Mac OS X.

1. Press ALT + F2, type in gconf-editor and press Enter key

gconf-editor

2. Navigate to apps > metacity > general. On the right find option called button_layout

Button layout

3. Double click on the value menu:minimize,maximize,close and change it to

close,maximize,minimize:menu

4. Look at your new titlebar :) It may look like this

Titlebar - icons left

Tip: You can remove unused buttons, or change their order. Just change the value to eg. close:menu or menu:close,minimize,maximize.

Easy converting PNG, JPG and other image formats to PDF

Easiest way to convert over 100 image formats to PDF is using ImageMagick. To install type in terminal:

sudo apt-get install imagemagick

Convert image to pdf:

convert source.png target.pdf

Merge all images in folder to one PDF file:

convert *.jpg target.pdf

For more info enter

convert -man