Category Archives: Tech-Stuff

Google Earth on Ubuntu 16.04 Xenial Xerus

Due to lsb-core package deprecations Google earth takes a few more mins to install on Ubuntu 16.04 Xenial Xerus.
Follow steps below to install :

sudo apt-get update && sudo apt-get upgrade
cd ~/Downloads
sudo dpkg -i --force-all lsb-core_4.1+Debian11ubuntu6_amd64.deb
sudo dpkg -i google-earth-stable_current_amd64.deb

lsb-core depends on a lot of packages this will start annoying you on any further updates.
To shut up lsb-core depends from calling out follow steps below.

cp /var/lib/dpkg/status ~/
sudo vi /var/lib/dpkg/status

If you are not comfortable with vi open in your favorite UI editor.
locate below line

Package: lsb-core
Locate section called "Depends" under above package. Delete all package dependencies after 
leaving only "Depends:"
Be careful you are doing this under the lsb-core package only.
save the file or in vi :wq

Launch google-earth or from unity launcher
make sure everything works.


At this point panaramio photos do not load correctly, you will have a white screen when you click any picture inside google earth .
Follow steps below to resolve

cd /opt/google/earth/free
sudo wget

||Credit for this library goes to - 2013 and Ryan C. Gordon -2006||

For security verify md5sum: 6d1f5cff1c9e1831798fd1270b90f501
[UPDATE 05/30/2016] : This assumes  you have a 64 bit OS, for 32 bit install see Per de Place Bjørn (thanks !) comment below.

sudo tar xvf ge7.1.1.1580-0.x86_64-new-qt-libs-debian7-ubuntu12.tar.xz
sudo apt-get install libfreeimage3
sudo apt-get install libgstreamer0.10-0
sudo apt-get install libgstreamer-plugins-base0.10-0

Leave a note if this helped

Linux Quickies

  • “Unable to Connect to RDP Server” in Remmina or Other RDP client – most probably your keys have changed.
    rm ~/.freerdp/known_hosts
  • Quick Folder sizes
    du -h --exclude "./.*" --max-depth=1
  • Find files by Users, Group, Time
    find /home -user sundru –name sun.txt
    find /home -group sungrp –name sun.txt
    find /home -ctime +30 –name sun.txt - file changed older than 30 days
    find /home -cmin -30                - files changed within last 30 mins
  • Awk and Grep
    grep "somestr" sun.txt | awk '{print $1}'
    ls -l|awk '{print $9}'             - unsafe for filenames with spaces.
    find . -maxdepth 1 -type f -printf '%f\n'  - safer
  • Replace String in a bunch of files
    method 1 : grep -rl matchstring /home/ | xargs sed -i 's/matchstring/replacestr/g'
    method 2 : perl -pi -e 's/you/me/g' file1 file2 file3
  • Seapine Test Track ( ttstudio protocol  or any custom protocol ) xdg-mime registration on new Xenial Xerus 16.04
    sudo apt-get install libappindicator1
    sudo apt-get install libfreeimage3
    sudo apt-get install libgstreamer0.10-0
    sudo apt-get install libgstreamer-plugins-base0.10-0
    sudo apt-get install libglib2.0-0
    sudo apt-get install libglib2.0-bin
    sudo apt-get install libfreetype6:i386
    sudo apt-get install libfontconfig1:i386 libsm6:i386 libfreetype6:i386 libglib2.0-0:i386
    sudo apt-get install libxrender1:i386
    sudo apt-get install libfontconfig1:i386
    sudo apt-get install libstdc++6

    Check your tturlredirector.desktop file (remove absolute path reference)

    sudo vi /usr/share/applications/tturlredirector.desktop
    sundru@DONKEY2: -_002

    Default the handler

    xdg-mime default tturlredirector.desktop x-scheme-handler/ttstudio

    Test your mime handler

    tturlredirector ttstudio://someurl:99//testdb/rqmt?number=8475

    Real test from a browser or console :

    xdg-open ttstudio://someurl:99//testdb/rqmt?number=8475
  • Asus ZenBook Pro – Ubuntu 14.04 Nvidia Intel Dual Graphics bumblebee configuration -Optimus Primus

    This worked perfectly on a Asus Zenbook Pro Ux501Jw running GTX 960M in secondary GPU mode (Optimus).


    1. First step after installing Ubuntu is to install all updates. You may use the software updater or simply run:

    sudo apt-get update && sudo apt-get upgrade

    2. Add the Xorg-edgers ppa using

    sudo apt-add-repository ppa:xorg-edgers/ppa
    sudo apt-get update

    Important Step =>

    sudo apt-get upgrade && sudo apt-get dist-upgrade

    3. Now Install bumblebee and Nvidia drivers using

    sudo apt-get install bumblebee bumblebee-nvidia primus nvidia-352

    4. Add the current user to the bumblebee security group.

    sudo useradd -G bumblebee yourusername

    For Ubuntu 15.04 only: you need to manually enable to bumblebee daemon using

    sudo systemctl enable bumblebeed`

    5. This will take care of the Installing the required software on your system. We need to configure it.We start by enabling bbswitch and intel i915 Driver.

    sudo -H gedit /etc/modules

    Ubuntu 15.04: the file is /etc/modules-load.d/modules.conf

    Add these two lines to it


    6. Edit the bumblebee configuration file.

    sudo -H gedit /etc/bumblebee/bumblebee.conf

    1. line 22:


    2. line 55:


    3. line 58:


    4. line 61:


    7. In addition to this there is another file that needs to edited.

    sudo -H gedit /etc/modprobe.d/bumblebee.conf

    Add this line at the end.

    blacklist nvidia-352

    Now you may reboot. After reboot, check using sudo apt-get install mesa-utils if mesa-utils is not already installed.

    $> optirun glxinfo | grep OpenGL
    OpenGL vendor string: NVIDIA Corporation
    OpenGL renderer string: GeForce GTX 960M/PCIe/SSE2
    OpenGL core profile version string: 4.3.0 NVIDIA 352
    OpenGL core profile shading language version string: 4.30 NVIDIA via Cg compiler
    OpenGL core profile context flags: (none)
    OpenGL core profile profile mask: core profile
    OpenGL core profile extensions:
    OpenGL version string: 4.5.0 NVIDIA 352
    OpenGL shading language version string: 4.50 NVIDIA
    OpenGL context flags: (none)
    OpenGL profile mask: (none)
    OpenGL extensions:

    This should tell you that nvidia-352 driver in use.

    Please note that nvidia-352 is the latest driver at the time of writing this.

    Abdridged from

    Coffee break hack -> Iptables parse logs and write to DB for analysis

    ## Perl Script 
    ## Sundara J (2013)  IP tables parse log script for further analysis.This is a script to parse output of iptables in kern.log or other locations 
    ## this script lets you analyze iptables logs more easily and writes the pertinent info to a mysql DB which can be used to analyse data further.
    ## A line in the log file looks like below 
    ## Feb 17 07:09:20 xxxx kernel: [41789.436510] IN= OUT=WAN DST= LEN=80 TOS=0x00 PREC=0x00 TTL=64 ID=17671 DF PROTO=UDP SPT=60040 DPT=53 LEN=60
    ## MySQL Create Table SQL Run this in your db -> 
    ## create table log (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,logtime DATETIME, chain1 varchar(100),chain2 varchar(100), src_ip varchar(100), dest_ip varchar(100), protocol varchar(100), spt varchar(10), dpt varchar(10));
    use DateTime;
    use File::Temp;
    use DBI;
    ## mysql user database name
    $db ="somedb";
    ## mysql database user name
    $user = "root";
    ## mysql database password
    $pass = ""; 
    ## user hostname : This should be "localhost" but it can be diffrent too
    ## Log location , change to wherever your iptables file is located 
    ## if your log file format changes you might want to adjust the index values to yours on $values[index] 
    %mon2num = qw( jan 1 feb 2 mar 3 apr 4 may 5 jun 6 jul 7 aug 8 sep 9 oct 10 nov 11 dec 12 );
    open (FILE, $log_loc);
     while () {
    	 my @values = split(" ");
             my @time_split=split(":", $values[2]);
    	 my $dt = DateTime->new(
    		      year       => 2013,
    		      month      => $mon2num{ lc substr($values[0], 0, 3) },
    		      day        => $values[1],
    		      hour       => $time_split[0],
    		      minute     => $time_split[1],
    		      second     => $time_split[2],
    		      nanosecond => 500000000,
    		      time_zone  => 'America/New_York',
    	# if not mac then SRC
    	if ($values[8] =~ /MAC/)
    	 $src_ip = $values[9];  # SRC IP
    	 $dest_ip = $values[10]; # DEST IP
    	} else
    	 $src_ip=$values[8] ;  # SRC IP
    	 $dest_ip = $values[9]; # DEST IP
    	if ($values[16] =~ /DF/)
    			if ($values[17]=~ /PROTO/) 
    		else {
    			if ($values[16]=~ /PROTO/) 
    			 $spt= $values[17];
    			 $dpt= $values[18];
    			else {
    			 $spt= $values[16];
    			 $dpt= $values[17];
    	@current_line = 
    	     $values[6], #IN
    	     $values[7], #OUT
     	push @logparse, [ @current_line ] ;
     close (FILE);
    ## Write to the DB  
    $dbh = DBI->connect("DBI:mysql:$db:$host", $user, $pass);
    for $var (@logparse)
    	for $var1 ([ @$var ])
    	$query = "insert into log values('','@$var1[0]','@$var1[1]','@$var1[2]','@$var1[3]','@$var1[4]','@$var1[5]','@$var1[6]','@$var1[7]')";
    	$sqlQuery  = $dbh->prepare($query) or die "Can't prepare $query: $dbh->errstr\n";
    	$rv = $sqlQuery->execute or die "can't execute the query: $sqlQuery->errstr";	
    $rc = $sqlQuery->finish;

    Ubuntu – Recovering from Boot Problems after a new Windows install

    Assumptions :

    1. You had a Linux partition
    2. For some reason you re-installed windows and now cant boot into Linux
    3. You cant boot into linux even if you select the specific HDD in BIOS boot options

    You will need :

    1 Either a USB boot version of ubuntu or Live CD you can boot with

    To create USB Memory Boot Stick :
    A. Download your ubuntu .iso file
    B. if you are on windows install LiLi from here and create the boot USB drive.

    To restore Boot :

    1. Boot From you USB stick.

    2. Now we will have to mount the local drives.

    3. Find out from fdisk or parted the parition where Linux is located.

    4. Mount the ubuntu partition drive

                sudo mount /dev/sdXX /mnt  (example 'sudo mount /dev/sda1 /mnt')

    5.Only if you have a separate boot partition:

                sudo mount /dev/sdYY /mnt/boot.

    6. Mount the virtual filesystems:

                sudo mount --bind /dev /mnt/dev
                sudo mount --bind /proc /mnt/proc 
                sudo mount --bind /sys /mnt/sys

    7. To ensure that only the grub utilities from the LiveCD get executed, mount /usr

                sudo mount --bind /usr/ /mnt/usr 
                sudo chroot /mnt  

    8. If there is no /boot/grub/grub.cfg or it’s not correct, create one using

          or  update-grub2

    9.Now reinstall Grub

                grub-install /dev/sdX  (e.g. grub-install /dev/sda. Do not specify the partition number.   

    10. Verify the install

                sudo grub-install --recheck /dev/sdX

    11. Exit chroot : CTRL-D on keyboard.
    12. Unmount virtual filesystems:

                sudo umount /mnt/dev 
                sudo umount /mnt/proc
                sudo umount /mnt/sys 

    If you mounted a separate /boot partition:

                sudo umount /mnt/boot 

    13. Unmount the LiveCD’s /usr directory:

                sudo umount /mnt/usr

    14. Unmount last device:

                sudo umount /mnt

    15. Reboot.

                sudo reboot.

    abridged from

    PS3 Android Bluetooth remote sixaxis controller App BlueputDroid

    Recently came across this gem of an app for remote control of PS3 over bluetooth.


    The App is called BlueputDroid by Beserker this allows your phone to become seamless interface device over Bluetooth and has the option to simulate either a BT keyboard or a PS3 sixaxis controller

    Of course your android phone needs to be rooted .. If you are on one of the Galaxy Devices you can use this method to root it is by far the easiest

    * fine print – I claim no responsibility about it working properly, except say that it worked fine for my Galaxy Note 2 SGH-I317 on AT&T running 4.12 android.