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 :

STEP 1 : INSTALL GOOGLE EARTH
sudo apt-get update && sudo apt-get upgrade
cd ~/Downloads
wget https://dl.google.com/dl/earth/client/current/google-earth-stable_current_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/main/l/lsb/lsb-core_4.1+Debian11ubuntu6_amd64.deb
sudo dpkg -i --force-all lsb-core_4.1+Debian11ubuntu6_amd64.deb
sudo dpkg -i google-earth-stable_current_amd64.deb
STEP 2 : REMOVE DEPENDENCY HELL (lsb-core)

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
STEP 3: CHECK GOOGLE EARTH WORKS

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

STEP 4 : MAKE PANARAMIO PHOTOS TO WORK:

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 http://www.sundru.net/wordpress/sundrumisc/ge7.1.1.1580-0.x86_64-new-qt-libs-debian7-ubuntu12.tar.xz

||Credit for this library goes to amirpli@gmail.com - 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

We need something new for Humans to Do

So various news articles and chats with friends and family prompted me to write this post, this article is a general thought blog and not a citation of facts.

400 BCE- 1900’s – Live Stock, Farming

Small groups of people living of the land, bartering and exchanging goods for monetary units. This by far is the longest phase of the human state.  Note the level of acceleration on all further states.

1900 – 1950 – Late Industrial Era
Cotton , Railroads and the wars usher in the industrial era of our times. Many new advances are made in Chemical, mechanical and electrical fields.

1950-1990- Post Industrial

Outsourced manufacturing , Parallel development in multiple fields Atomic , Medical , Electronics Energy, generation provides for the cities of the Post industrial human state.

1990- 2015 The Digital Age
Brick and Mortar establishments fall to virtual super highways and automation in multiple sectors, Retail, Manufacture, Banking, redefining social interactions spurring jobs creation in tech sectors and automation.

2015 – 2040 Robotic Age/Virtual Age

Now thinking into the future analysts expect a robotic age where even the most menial tasks are automated. No doubt this would bring in a huge industrial complex and a new variety of jobs.
I think this is the age when our fundamental human existence starts being challenged, and we need to transcend humanity *somehow* it raises a lot of questions and am sure a sci-fi movie exists for every one of these.

  • What happens when your every whim is taken care of ?
  • What happens when a human thought process is considered too slow for any action (this is already happening ex: NYSE)
  • What happens to institutions of social consequences. Family, Fundamental interactions with other humans are lost or becomes an inconvenience.
  • What happens when products of human intelligence overtake biological evolution.

This can go on and on but this post was not about a Skynet scenario, how do we evolve from this point on? and how do we find the equilibrium to give us time, so biological evolution can catch up (or maybe we cheat and enhance our own DNAs?). This is where some inspiration from Star Trek and Isaac Asimov’s foundation  may come in handy both of these look into the future and suggest possible outcomes over the millenia.

But here is the rub, every scenario looking far ahead requires us to grow up, to be moving out of our cradle “Earth” and not fear whats ahead.  No scenario allows for indefinite pillaging of our planets resources.

  • We need to find ways to spread across space.
  • Finding  “the way” to spread needs to become the next industrial complex after the 2015-2040 Robotic Age.
  • The human combined collective intelligence needs to focus on that task.
  • Governments needs to recognize the need and agree.  (This is part of the human kind growing up process)
  • Enabling technologies are critical, there is no way we are getting past our Solar system without finding a new “exotic” particle. I think Governments to a certain extent realize this with the CERN initiative. If this fails only options would be multi generational ships into space.
  • We need to balance the human social institutions and interactions. Not everything should be driven from “convenience”.

“But man had been created with a hole in his heart, a hole that no possession, power, or knowledge could fill.” – Hell Boy II

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).

    Steps:-

    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

    i915
    bbswitch

    6. Edit the bumblebee configuration file.

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

    1. line 22:

    Driver=nvidia

    2. line 55:

    KernelDriver=nvidia-352

    3. line 58:

    LibraryPath=/usr/lib/nvidia-352:/usr/lib32/nvidia-352

    4. line 61:

    XorgModulePath=/usr/lib/nvidia-352/xorg,/usr/lib/xorg/modules

    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

    http://askubuntu.com/questions/452556/how-to-set-up-nvidia-optimus-bumblebee-in-14-04

    Censoring and protecting home internet for parents / kids

    Have a daughter becoming a teenager and having more than 3 gadgets, figured will do my best to keep her annoyed by restricting internet access 🙂

    Here’s what to do to create a safe and censored home internet connection, this works for all devices connected to a router with a few exceptions.

    You can also use a software like NetNanny but if u have a like a few hundred devices kids use at home, iphones, ipods, pcs, android devices, laptops, ps3 etc and you don’t have the patience to install software on every one of them then below would help.

    Things you need to know

    1. Prevent visiting adult websites directly thru urls or clicking links

    This is done by registering up at opendns.com

    •   Create an account @ opendns.com and create a network – you basically register your home public ip as a protected network. they also provide a small client which updates the network ip dynamically on opendns if u have a dynamic ip
    •   On your primary router @ home go to control panel and update the DNS ip provided by opendns, so now all dns requests go to opendns.
    •   Set the security level you want on opendns, they automatically filter lots of domains you dont want your kids to see.

    2. Censor keywords or prevent pages with keywords they shouldnt visit.

    • If your router has “Content Filtering” you are in luck , else you may not be able to do this.
    • This is important cause if anyone is searching for like restricted keywords on google we wont be able to prevent results from showing up. The previous step can only block whole domains.

    3. Localized safe locks on inviddual websites like youtube – this depends on control these sites provide.

    • Youtube provides a safe lock for mature content, Login in as you and set the safety toggle and “lock it” this has to be done for every browser on every pc/laptop and is a pain to do.
    • Other websites you dont want your kids to see, block them in opendns.com control panel.

    * fine print – none of these methods are 100% fool proof, if you are kids know more about computers and networking they can get around these.

    2014 Jeep Grand Cherokee – User Review

    *first off the disclaimers – I am not paid to write this review.
    2014 Jeep Grand Cherokee User Review..
    @ 1112 miles

    s
    s

    Pros : 

    • Amazing transmission .
    • Shifts when you expect it.
    • Dare i say it on a jeep.. Great mpg on the V6 atleast.
    • Interiors are done very wll, nothing feels tacky.
    • the new larger uconnect is ok.
    • Love the lcd screen in the center of the Dash.

    What could be better :

    • For a vehicle priced this much could have a better sound system, sound quality feels average. maybe jeep can fix with a software update !
    • Was wishing the sound stage was higher than it is.
    • the Uconnect screen could do with a higher resolution to keep up with the rest of the quality interiors.
    • the suspensions feels a little bouncy, probably needs more damping.
    • Would love to have traffic overlay on Uconnect Nav, like google maps does instead of sirius xm traffic.
    • the paint coating on the voice activation buttons are easily scuffed off with nails.

    <<UPDATE 04/23/2013 >>

    Uconnect head Unit is bricked, pissed off. Dealer is shipping new head unit from Chrysler. Like posted in the other thread Chrysler/Dealer is replacing the entire Head Unit !!!
    8PM EST 04/24/2013
    Symptoms :
    “Phone Requires Service Message pops up”
    “GPS Unit showing wrong location on NAV”
    “Compass pointing in the wrong direction”

    @3500 miles –
    Head units fixed for a while and humming along.Thanks Chrysler! No issues

    @4000 miles – the rear tail light conked out, waiting on part to be shipped.
    wasnt a part problem was a software update needed , go figure.

    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 SRC=xxx.xxx.xxx.xxx DST=199.45.32.38 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
    $host="localhost";
    ## Log location , change to wherever your iptables file is located 
    $log_loc="/home/someplace/kern.log";
    
    ## 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 );
    @logparse="";
    
    open (FILE, $log_loc);
     while () {
     @current_line="";
    	 chomp;
    	 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/) 
    			{			 
    			 $proto=$values[17];
    			 $spt=$values[18];
    			 $dpt=$values[19];
    			} 
    			else 
    			{
    			$proto=$spt=$values[16];;
    			 $spt=$values[17];
    			 $dpt=$values[18];
    			} 
    		}
    		else {
    			if ($values[16]=~ /PROTO/) 
    			{
    			$proto=$values[16];
    			 $spt= $values[17];
    			 $dpt= $values[18];
    			} 
    			else {
    	 		 $proto=$values[15];  		
    			 $spt= $values[16];
    			 $dpt= $values[17];
    			}
    	}
    
    	@current_line = 
    	   ($dt,
    	     $values[6], #IN
    	     $values[7], #OUT
    	     $src_ip, 
    	     $dest_ip,
    	     $proto,
    	     $spt,
    	     $dpt);
     	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;
     exit;
    

    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 http://www.linuxliveusb.com/ 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

              update-grub 
          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
    http://opensource-sidh.blogspot.com/2011/06/recover-grub-live-ubuntu-cd-pendrive.html

    PS3 Android Bluetooth remote sixaxis controller App BlueputDroid

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

    Screenshot_2013-01-27-18-45-21

    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

    http://galaxynote2root.com/galaxy-note-2-root/how-to-root-galaxy-note-2-easiest-method/

    * 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.

    https://play.google.com/store/apps/details?id=berserker.android.apps.blueputdroid&hl=en