December 21, 2013


We aim to collect practical, well-explained bash one-liners, and promote best practices in shell scripting.

Purging i386 Packages From AMD64

After trying out the free demo of X-Plane and removing it from my 64bit installation, I wanted to purge all the i386 packages I no longer needed ( 224 packages ).

After some Google search I found this one-liner :

sudo apt-get purge  `dpkg --get-selections | grep i386 | awk '{print $1}'`

To simulate the above command you can add the -s option and see exactly what gets removed before actually running it....

sudo apt-get -s purge  `dpkg --get-selections | grep i386 | awk '{print $1}'`

After this operation, 492 MB disk space will be freed.
Do you want to continue [Y/n]? y

Removing libao4:i386 ...
Purging configuration files for libao4:i386 ...
Removing lib32asound2 ...
Purging configuration files for lib32asound2 ...
Removing nvidia-304 ...


I only had to reinstall nvidia-304 afterwards...

Links :

December 13, 2013

Manage Trash With Trashindicator

Download trashindicator_1.00-1_all.deb from

Open terminal and navigate to Downloads :
cd Downloads
Installation :
sudo dpkg -i trashindicator_1.00-1_all.deb

Trashindicator will be added to the Startup Applications in System Settings.

Restart wingpanel :
killall wingpanel or log out and log in again.

December 9, 2013

Show Username On Wingpanel

In terminal :
gsettings set com.canonical.indicator.session show-real-name-on-panel true
then :  
killall wingpanel


Remove username :
gsettings set com.canonical.indicator.session show-real-name-on-panel false
then : 
killall wingpanel

December 8, 2013

Hiding Applications Slingshot-Launcher

Open Terminal and navigate to /usr/share/applications :
cd /usr/share/applications

E.g. I wanted to remove the icon Archive Manager from slingshot :

sudo nano file-roller.desktop

Add a line NoDisplay=true

Hit Ctrl+O , Enter and then Ctrl+X

December 7, 2013

Use Pepperflash In Chromium

Go to the Google Chrome Webpage and download the web browser for your processor architecture.
Unpack the deb package:

Navigate to /opt/google/chrome/PepperFlash/ and extract :

Then :
cd Downloads
sudo mv /usr/lib/chromium-browser/plugins

Edit the file /etc/chromium-browser/default :
sudo nano /etc/chromium-browser/default and make the following change :

# Options to pass to chromium-browser
CHROMIUM_FLAGS=" --ppapi-flash-path=/usr/lib/chromium-browser/plugins/"

Restart chromium....

Check the setting at chrome://plugins in the address bar ( press +Details ) :

November 30, 2013

White Sands Wallpaper Pack

Images taken in southern New Mexico in a national park called White Sands.

Wallpaper pack can be downloaded from this site.

PLEASE mind the terms of use and do not re-host these images anywhere else on the web......
the images are for your own personal use only as desktop wallpaper imagery and other uses of these images without written permission is not tolerated.

November 29, 2013

Customize Firefox Scrolling

You can use extensions like Yet Another Smooth Scrolling or Smoothwheel, but there is another way without installing any add on.

Just go to the about:config page in Firefox : type about:config in the Location Bar (address bar) and press Enter to display the list of preferences.

Uncheck Show this warning next time

You can search in the Search bar at the top of the page to filter the preferences that you want to inspect. The search bar is case-insensitive, unlike the actual configuration variables.
Examples to filter results : mousewheel and smoothscroll .

If you want to try out the settings I use, do the following :
Quit Firefox, navigate to ~/.mozilla/firefox/xxxxxxxx.default and create a file user.js with the following content :

// === Mouse Wheel Scrolling ===================================================
user_pref("general.smoothScroll", true);                            // boolean    enable/disable smooth scrolling
user_pref("general.smoothScroll.mouseWheel", true);                 // boolean    enable/disable smooth scrolling with mouse wheel
user_pref("general.smoothScroll.mouseWheel.durationMaxMS", 600);    // integer    smooth out the start/end of scrolling operations in ms
user_pref("general.smoothScroll.mouseWheel.durationMinMS", 400);    // integer    smooth out the start/end of scrolling operations in ms
user_pref("mousewheel.acceleration.factor", 10);                    // integer    sets acceleration factor if mousewheel.acceleration.start > -1
user_pref("mousewheel.acceleration.start", 0);                      // integer    when to apply mousewheel.acceleration.factor (after how many scroll clicks of mouse wheel)
user_pref("mousewheel.default.delta_multiplier_y", 85);             // integer    vertical step size

Update : there is another setting in about:config you can play with :
mousewheel.min_line_scroll_amount  default setting = 5

November 24, 2013

Password Strength


Commandlinefu is a simple repository for storing and sharing great shell commands.


MPlayer is a free and open source media player, available for all major operating systems. It will play all types of free media formats as well as most non-free media formats.

MPlayer2 is a fork of the original MPlayer project, it contains few enhancements.

A GUI is available. To install :

sudo apt-get install mplayer2 mplayer-gui mplayer-skins

Package mplayer-skins contains three different skins, more skins can be downloaded from here.
I downloaded a skin from Deviantart, called simpliX.

Extract the downloaded file ( 7z format ) with Archive Manager. Move the folder simpliX to /usr/share/mplayer/skins :

sudo mv simpliX /usr/share/mplayer/skins

You can also create folder skins in ~/.mplayer and move the folder simpliX over there. ( link ).

Start MPlayer-gui and select your skin and set preferences ( right-click player or screen ) :

MPlayer2 is played from the commandline : .

Example ( playing music from, Smoothjazz ) :

User settings are in ~/.mplayer/config which from the first start contains only one line :

# Write your default config options here!

For settings and options look here :


Having a Nvidia GT 330 card my config looks like the one from here.

Cool things you can do with mplayer :

Movie :

November 17, 2013

Make Firefox Look Like Chrome

Install firefox :
sudo apt-get install firefox

Start firefox and install the Movable Firefox Button.
You have to restart firefox to make the Addon active.

Right click between the address bar and search bar and uncheck Menu Bar.

Repeat the same but then choose Customize... Grab the Firefox Menu button and move it to the far right side.

Grab the ( with Customize... ) Home, Reload and Stop buttons and move them to the left right next to the address bar. Remove the search bar...( drop it in the Customize Toolbar window ).

Install Fxchrome theme and you're done....

Pinboard An Online Bookmarking Tool

As said on it's website :

Pinboard is a bookmarking website for introverted people in a hurry.
The focus of the site is less on socializing, and more on speed and utility. Pinboard tries to offer useful features without getting in your way.
My highest priority is keeping your data safe over the long term.

Unlike some social bookmarking sites, Pinboard will cost you a one-time fee of around ten dollars.
The site follows a rather unconventional pricing strategy -- as more people sign up, the price increases.
The signup fee helps keep the site from growing too fast, and keeps Pinboard spam-free.

Thanks to the site’s clean design and focus on speed, saving bookmarks and browsing them is always super-fast.

There’s also an optional archiving service that, for $25/year, guarantees that articles you bookmark will still work even if the original link changes or gets deleted

Read the Getting Started page if you get interested.

Pinboard extensions for your browser :

Alternative online bookmarking :

November 15, 2013

Blocking Unwanted Ads In Youtube

This can be done without installing any software and will work with any browser.
We just need to edit the file /etc/hosts and add a few lines :

sudo nano /etc/hosts

The hosts file is just a text file, used to map hostnames to IP adresses.

Anytime an entry listed in your hosts file is requested on the page you are viewing, your computer thinks is the location of the file....( your computer will automatically check the hosts file first before DNS for entries to the web page you just requested ). is the standard IP  address used for a loopback network connection. This means that if you try to connect to, you are immediately looped back to your own machine. is also referred to as localhost.

Link :

November 7, 2013

Add My Weather Indicator To Wingpanel

My-Weather-Indicator is a ( Wing )panel-based weather applet that can show weather conditions, a forecast, a forecast map and check sunrise and sunset information, moon phase and more in the latest release. You can set two locations.

To install :
sudo add-apt-repository ppa:atareao/atareao
sudo apt-get update
sudo apt-get install my-weather-indicator

After installation it will appear in the Slingshot-launcher.
To have it started after login :
My-weather-indicator > Preferences > General options > check Autostart

Troubleshoot :

November 4, 2013


Bootinfoscript is a bash script which searches all hard drives attached to the computer for information related to booting and displays it in a convenient format. Its primary use is for troubleshooting booting problems.

Go to and download bootinfoscript-061.tar.gz.

Extract and run :

tar xf bootinfoscript-061.tar.gz
sudo ./bootinfoscript

Boot Info Script 0.61      [1 April 2012]

"gawk" could not be found, using "busybox awk" instead.
This may lead to unreliable results.

Identifying MBRs...
Computing Partition Table of /dev/sda...
Searching sda1 for information...
Searching sda2 for information...
Searching sda3 for information...
Searching sda4 for information...

Finished. The results are in the file "RESULTS.txt"
located in "/home/eric/Downloads/bootinfo/".

A Elementary Branded Wallpaper

Link :

Download :

Adding A Swapfile

During installation I did not create a swap partition.As an alternative to creating an entire partition, a swap file offers the ability to vary its size on-the-fly, and is more easily removed altogether.

To create a swap file two different commands can be used : dd or fallocate.

With dd ( swap file 2 GB in /media/Data, you can choose another location. I choose /media/Data, because my root file system is small and /media/Data is mounted at boottime ) :
sudo dd if=/dev/zero of=/media/Data/swap bs=1M count=2048

With fallocate :
sudo fallocate -l 2048M /media/Data/swap
fallocate: /media/Data/swap: fallocate failed: Text file busy........
Another try :
cd /media/Data
sudo fallocate -l 2048M swap
Done !

ls -l swap
-rw-r--r-- 1 root root 536870912 Nov  4 12:07 swap
Set the right permissions (a world-readable swap file is a huge local vulnerability)
sudo chmod 600 swap
ls -l swap
-rw------- 1 root root 536870912 Nov  4 12:07 swap
Better !

After creating the correctly-sized file, format it to swap:
sudo mkswap swap

Activate the swapfile:
sudo swapon swap 

You can verify this yourself with the swapon command :
swapon -s 
Filename                                 Type        Size             Used    Priority
/media/Data/swap                 file           2097148    0            -1

Edit /etc/fstab and add an entry for the swap file:
sudo nano /etc/fstab  
/media/Data/swap   none   swap   sw   0   0
Your location would be different....After the next reboot the swap will be used automatically.

To remove a swap file, the current swap file must be turned off.
sudo swapoff -a
sudo rm -f swap 

The Linux kernel assigns priorities to all swap containers. The system will use swap areas of higher priority before using swap areas of lower priority. Priorities can be assigned in fstab via the pri parameter or with sudo swapon -p <value>.
I'm using just one swap area, so priority is of no concern...

The swappiness parameter controls the tendency of the kernel to move processes out of physical memory and onto the swap area.
cat /proc/sys/vm/swappiness will show a number between 0 and 100. Default is 60.
Setting this parameter to a low value will reduce swapping from RAM, and is known to improve responsiveness on many systems.
To  change the system swappiness value, open /etc/sysctl.conf as root :
sudo nano /etc/syscl.conf
and add these lines :

Reboot for the change to take effect. You can also clear your swap by running swapoff -a and then swapon -a as root instead of rebooting to achieve the same effect.

vm.vfs_cache_pressure controls inode/dentry (i.e. filesystem) cache vs. other caches, i.e. we want to keep filesystem meta-data in RAM if possible ( link ).

Links : 

There is also a package dphys-swapfile that will autogenerate a swap file. After the package has been installed whenever you boot you'll have /var/swap created.

Using a memory stick/memory card as swap memory on Linux

November 3, 2013

System Restore With Timeshift

TimeShift for Linux is a application that provides functionality similar to the System Restore feature in Windows and the Time Machine tool in Mac OS. TimeShift protects your system by taking incremental snapshots of the file system at regular intervals. These snapshots can be restored later to bring your system to the exact state it was in at the time when the snapshot was taken.

TimeShift is designed to protect only system files and user settings ( hidden files in your Home directory ). User files such as documents, pictures and music are excluded.  Read more in the Timeshift FAQ...

Snapshots can be restored either from the running system or from a live CD. Restoring backups from the running system requires a reboot to complete the restore process.

I have used it a few times and it worked really well ( only taking snapshots ondemand ).

Installation :

sudo apt-add-repository -y ppa:teejee2008/ppa 
sudo apt-get update 
sudo apt-get install timeshift

Links :

Howto Enable Login Sound

You will need a sound file in the .ogg or .wav format. Rename the file into desktop-login.ogg( wav ) and place it in the
/usr/share/sounds folder. Rightclick and choose New Window As Administrator in order to be able to place the file there :

In System Settings ( Applications > System Settings ) go to Startup Applications > Add.

Name : Login sound
Command : /usr/bin/canberra-gtk-play --id="desktop-login"

Then Add....

Download sounds from here.

More sounds :  ( download with Save Link As... ).

Knoppix sounds.

Free online audio convertor :

October 27, 2013

VPNBook : Free VPN

VPNBook is a 100% Free VPN service without any need for registration or sign-up.

Here is how I did my setup : open a terminal :
Applications > Terminal and copy and paste the following line :

sudo apt-get install network-manager-openvpn-gnome 
( will pull in packages network-manager-openvpn and openvpn, the other needed packages are already installed in a default installation ).

Wingpanel > Network-manager-applet > Edit Connections....

Network Connections > VPN > Add  , Choose a VPN Connection Type > PPTP > Create...

Go to VPNBook and look for the PPTP settings. I choose Server #3 : (UK VPN - optimized for fast web surfing; no p2p downloading).


Connection name : VPNBook-PPTP-UK ( you can set any name )
VPN tab :
Gateway :
User name : vpnbook
Password : qe6resTe ( password changes every one to two weeks ! , )
Check : Show password
Check Available for all users.


Go to Advanced and check Use Point-to-Point encryption ( MPPE ) > press OK button.

Now can choose your VPN connection in the network-manager-applet...

To setup OpenVPN : Go to VPNBook and download one of the OpenVPN Certificate Bundles ( e.g Server #3 ).

Create a new folder in your Home directory and name it e.g. openvpn-config.

Move the downloaded  ( Applications > Files > Downloads ) OpenVPN Certificate Bundle ( ) into the openvpn-config folder and right click and choose Open With Archive Manager.
Hit the button Extract files from the archive 

Choose one of the .ovpn files e.g. vpnbook-uk1-tcp80.ovpn.
We need to create three files in the openvpn-config folder with the names : ca.crt, client.crt and client.key :

For the next copy/paste actions to work with Scratch ( default text editor ) we need to change it's Autosave feature :

Applications > Scratch > Menu ( gear icon ) > Preferences : uncheck Save files when changed .
This is a known bug : pasted text in Scratch will get lost with Autosave feature enabled...

Open the file vpnbook-uk1-tcp80.ovpn and copy the lines between the <ca> tags and paste into the file ca.crt, save ( second button from the left ) and close.
Copy and paste the lines between the <cert> tags into the file client.crt, save and close.
Copy and the paste the lines between the <key> tags into the file client.key, save and close.

Wingpanel > Network-manager-applet > Edit Connections...
In the window Network Connections > VPN > Import  and navigate to the file vpnbook-uk1-tcp80.ovpn.

Window opens ( Editing vpnbook-uk1-tcp80 ) :
Connection name : choose whatever you like ( I choose VPNBook-OpenVPN-UK ).
Uncheck Connect automatically
VPN tab :
Authentication > Type : choose Password with Certificates ( TLS )
User name : vpnbook
Password :  qe6resTe ( password changes every one to two weeks ! )
User Certificate : navigate to client.crt
CA Certificate : choose ca.crt
Private Key : choose client.key
Finally : Save

Now can choose your VPN connection in the network-manager-applet...

October 26, 2013

Viewnior, A Simple Pictureviewer

Viewnior is an image viewer program. Created to be simple, fast and elegant.

The download page shows that there is no package for Ubuntu....and so we need to compile to make a deb-package.

Download the source from here :

Go to Downloads in a terminal :
cd Downloads

First install the necessary tools :
sudo apt-get install build-essential intltool dh-make

Development libraries :

sudo apt-get install libgdk-pixbuf2.0-dev libgtk2.0-dev

tar xf viewnior-1.3.tar.gz 

mv viewnior-1.3.tar.gz viewnior-1.3/
cd viewnior-1.3

dh_make --createorig

It will ask :

Type of package: single binary, indep binary, multiple binary, library, kernel module, kernel patch?

Just type s. Then it will show you some package information that you can edit. Just hit Enter.
Next message :
Done. Please edit the files in the debian/ subdirectory now. viewnior
uses a configure script, so you probably don't have to edit the Makefiles.


At the end ( won't take much time ) :
dpkg-deb: building package `viewnior' in `../viewnior_1.3-1_amd64.deb'.
dpkg-genchanges  >../viewnior_1.3-1_amd64.changes
dpkg-genchanges: including full source code in upload
dpkg-source --after-build viewnior-1.3
dpkg-buildpackage: full upload (original source is included)

cd ..
viewnior_1.3-1_amd64.changes  viewnior_1.3-1.debian.tar.gz  viewnior_1.3.orig.tar.gz
viewnior-1.3  viewnior_1.3-1_amd64.deb        viewnior_1.3-1.dsc

There it is : viewnior_1.3-1_amd64.deb......

Installation is done with gdebi, a simple tool to install deb files ( sudo apt-get install gdebi ).

Links :;a=blob_plain;f=packaging-tutorial.pdf;hb=refs/heads/pdf

October 25, 2013

Elementary OS Luna Review

......I have to tell you after test-driving it for the last four days I have come to the conclusion that I have really been doing myself a disservice and so are you if you don't download this distro and give it a try..... 

......this is a lightning-fast, responsive desktop that is just ready to go out of the box....

October 24, 2013

Mozilla’s UX-Nightly Build Of Firefox

The UX Nightly branch is the branch where developers can test out new features and experience them for a while before knowing if it’s something they want to ship.

Go to this page : ( or this one ) and download the appropriate build ( 32 or 64-bit, you can find out which one you need by going to Applications > System Settings > About ).
In my case it says : Version: 0.2 "Luna" ( 64-bit ).

Navigate to Downloads and open firefox-27.0a1.en-US.linux-x86_64.tar.bz2 with
Archive Manager ( just click on it ).
You will have a folder named firefox.
Assuming that you have installed and used firefox from the repositories before, I will rename the folder firefox  firefox-ux and move the folder to my home directory :
mv firefox/ ../firefox-ux
cd ../firefox-ux
./firefox -P

In the window that will open create a profile : call it ux  and start UX with this profile:

If all goes well....

Create a desktop file in ~/.local/share/applications with the following lines :
[Desktop Entry]
Name=Firefox Ux
Exec=/home/username/firefox-ux/firefox -P "ux" --no-remote %u

Replace username with your username.....

The -no-remote switch will make it possible to run firefox with different profiles simultaneously ( see : ).

Log out and in to see Firefox UX occur in Slingshot.

October 23, 2013

Mount Data Partition At Boot Time

I've created a large Data partition using Gparted. ( filesystem : ext4, label Data ).

Create mountpoint :
sudo mkdir /media/Data

Change ownership to user :
sudo chown $USER:$USER /media/Data

Data partition will be shown in left pane in Files, and manually mounted by clicking on Data.

In Terminal the command mount will show ( among other lines ) :
/dev/sda3 on /media/Data type ext4 (rw,nosuid,nodev,uhelper=udisks)

Adding this line to the file /etc/fstab will mount the partition at boottime :
sudo nano /etc/fstab

Add the line :
/dev/sda3 /media/Data ext4 rw,nosuid,nodev,uhelper=udisks 0 0

Get it mounted without reboot :
sudo mount -a

October 21, 2013

Music Player Foobnix

Foobnix is a music player for both local and online music. With the online music search feature you can download and save music from VK, the second biggest social network service in Europe after Facebook.

To install :

sudo add-apt-repository ppa:foobnix-team/foobnix-player
sudo apt-get update
sudo apt-get install foobnix

If it doesn't play music :
sudo apt-get install gstreamer0.10-plugins-ugly

Add your Music folder

Customizing radio channels or adding your own ( press My channels ) :

Pressing VK opens up next login window. You need to login to enable search and download of music.

Update Feb 10 2014 : from their site :

We are actively working on a new version of the player 3.0 rewriting it on GTK 3

sudo apt-get remove foobnix
sudo add-apt-repository ppa:popsul1993/ppa
sudo apt-get update
sudo apt-get install foobnix

OpenDNS And Google Public DNS

OpenDNS and Google Public DNS are free, global Domain Name System (DNS) resolution services, that you can use as an alternative to your current DNS provider.

Edit Connections....

In my case : Wired > Edit > IP4 Settings

At Method open the dropdown menu and select Automatic (DHCP) addresses only.

In the DNS servers field, enter the following IP addresses, separated by a comma.

For OpenDNS :,

For Google Public DNS :,

Restart Networkmanager ( might not be needed ) :

sudo service network-manager restart

Restart your browser...

To check run the next command in a Terminal :

nm-tool | tail -n 8

OpenDNS checker :

Adding Slingshot And Show Desktop To Plank

Slingshot is normally started by clicking Applications in the top panel, but you can add a starter in Plank as well :

sudo nano /usr/share/applications/slingshot.desktop

paste the following lines :

[Desktop Entry] 

Save and close.
See :

Alternative icon for the launcher :

In Files navigate to /usr/share/applications and drag the Slingshot icon to Plank and release when seeing a + sign....

For adding Show Desktop  open System Settings > Tweaks > Plank > Show Desktop Icon.

October 19, 2013

Pantheon Session With Compiz

You can create a different session running Pantheon desktop with compiz as window-manager.

First we need to install compiz :

sudo apt-get install compiz compizconfig-settings-manager compiz-plugins-extra

Navigate to /usr/share/xsessions and create a file pantheon-compiz.desktop  :

sudo nano pantheon-compiz.desktop

Paste into the file the following lines :

[Desktop Entry]
Name=Pantheon compiz
Comment=This session provides elementary-compiz experience
Exec=gnome-session --session=pantheon-compiz

Use Ctrl+O to File Name to Write, just hit Enter and then Ctrl+X to Exit.

Then navigate to /usr/share/gnome-session/sessions and create a file pantheon-compiz.session :

sudo nano pantheon-compiz.session

[GNOME Session]
Name=Pantheon Compiz

Again use Ctrl+O to File Name to Write, just hit Enter and then Ctrl+X to Exit.

Log out...

Link :

If your button-layout got messed up, start dconf-editor ( package dconf-tools ) and check the settings at :
org > gnome > desktop >wm > preferences > button-layout.

To be able to make a screenshot of  the login screen :

sudo apt-get install xserver-xephyr

UPDATE : WARNING : next tool could destroy all your dconf settings !  Do not use....

Run the next command during a normal session :

lightdm --test-mode

enlarge the window and make a quit type Ctrl+C in the terminal.

Update :
I found out that Plank did not work nicely with compiz. Minimizing windows will not always move the windows out of sight in the direction of the panel ( as wanted  ), but  also to the upper left corner.
I replaced Plank with Docky :
sudo apt-get install docky

System Settings > Tweaks > Cerbere > select Plank and remove (-), then add (+) Docky.

Window decoration theme : ( greybird-git )

Some of my settings in ccsm ( compizconfig-settings-manager ) are :

Window Management > Place Windows > Placement Mode > Centered
Window Management > Scale > Bindings > Initiate Window Picker For All Windows > TopLeft
Extras > Screenshot > Initiate > Super Button1
Utility > Enable Scale Addons
Utility > Workarounds > check Keep previews of minimized windows
Effects > check Animations Add-On
Desktop > Expo > Expo edge > BottomRight
General > General Options > Key bindings > Show Desktop > BottomLeft
Desktop > check Show desktop
Accessibility >Opacity, Brightness and Saturation > Opacity > Increase Opacity ( mouse ) > Alt Button4
Accessibility >Opacity, Brightness and Saturation > Opacity > Decrease Opacity ( mouse ) > Alt Button5
Accessibility >Opacity, Brightness and Saturation > Brightness > Increase Brightness ( mouse ) > Super Button4
Accessibility >Opacity, Brightness and Saturation > Brightness > Decrease Brightness ( mouse ) > Super Button5

If you like to use Emerald Window Decorator just follow this guide.