How to get stock lollipop on your rooted Nexus 7 3G 2012

1

As I had my Nexus 7 3G 2012 tablet unlocked and rooted I didn’t get any official updates anymore.

But I still think the Nexus 7 tablet is the best tablet still I decided to get it a lollipop.

Be aware that everything will be removed from your device.
Your totally responsible for your actions, if you brick your device I can’t help you.
This description is not for beginners and I will not provide every detail of the processes.

Lets go.

  1. Download the google factory android image, look for “razorg” for Nexus 7 [2013] (Mobile), https://developers.google.com/android/nexus/images
  2. Follow the instructions at the top of that page to get the rom flashed, but don’t lock the bootloader again.
  3. Reboot your device to check that everything is working properly. (Be aware that first boot takes a while, be patience)
  4. If you get a image of a dead android with a red sign sticking out of its chest do a factory reset (instructions from google nexus support)
    While holding down the Power button, press and release the Volume Up button once.
    Press the Volume Down button twice to highlight “wipe data/factory reset,” then press the Power button to select it.
    Press the Volume Down button seven times to highlight “Yes – erase all user data,” then press the Power button to select it.
    After the reset is complete, select the option to reboot your device.
  5. Download the chainfire root tool and image: http://download.chainfire.eu/295/CF-Root/CF-Auto-Root/CF-Auto-Root-grouper-nakasi-nexus7.zip
  6. Unzip it and use fastboot to flash it
  7. sudo fastboot boot image/CF-Auto-Root-grouper-nakasi-nexus7.img
  8. It will reboot your device and performs it’s magic (placing su and pacthing the kernel)
  9. Be aware that it can take up to a minute before you see the red chanfire android and the patching starts.
  10. The device will reboot again (Mine did a second reboot just after booting the rom, not sure if that was intended)
  11. The device will boot into lollipop and starts to upgrade the apps (again let it do it’s thing first time boots take a while on android)
  12. Check your rooted by starting the supersu app.

Now you can let your bootloader unlocked or lock it, it’s up to you.
I lock it again just to be on the save side.Have fun with your lollipop.

 

 

OSX enable hibernate

0

As I don’t use my OSX machine very often I like to have it hibernate iso suspend to RAM.

But as the “geniuses” didn’t enable it by default it has to be enabled manually:

sudo pmset hibernatemode 25

Now when you choose “sleep” it will hibernate.

To reset it back to suspend:

sudo pmset hibernatemode 3

 

Using Python virtual environment

2

Nothing special just a reminder for myself.

sudo apt-get install python-virtualenv

mkdir python-virt-env

cd python-virt-env/

~/python-virt-env$  virtualenv venv

~/python-virt-env$ source venv/bin/activate

Now your ready to go

Stop it:

~/python-virt-env$ deactivate

Get a Logitec unifying USB dongle to accept devices in Linux

0

When I bought a Logitec M570 wireless trackball I had trouble connecting it to my Logitec unifying USB dongle from my keyboard  under Linux.

I could just plug in a second USB dongle but that’s not the way to go.

Luckily there are free-software engineers who don’t fear to fight the beast 🙂

A nice fellow named  binky734 dived in and came up with a solution:
I just found an extremely simple way of getting your Unifying Receiver to function on Linux without having to bother with pairing it on Windows first. In fact, I tried pairing my M570 with Windows first, and that did not work.

 

  1. Download this small C program.
  2. Ctrl+Alt+T to open a command line and cd to your download directory
  3. $ gcc -o unifying_pair unifying_pair.c
  4. Unplug your Unifying Receiver and head to /dev
  5. Plug in your Unifying Receiver and wait for it to show up in /dev/. Mine was hidraw0.
  6. $ sudo ./unifying_pair /dev/X where X is which ever device name was in your /dev/ directory for your receiver.
  7. If your mouse is not already on, switch it on now. You might have to do the whole ‘turn it off and back on’ thing, but mine connected right away.

 

Hope this helped!

 

Usefull teamviewer options for remote access

0

The information comes from this fine blog: http://www.tonisoto.com/2013/07/launching-teamviewer-remotely-throught-ssh/

  1.  teamviewer --version print version information
      teamviewer --info print version, status, id
      teamviewer --passwd [PASSWD] set a password (useful when installing remote (ssh)
      teamviewer --ziplog create a zip containing all teamviewer logs (useful when contacting support)teamviewer --daemon status show current status of the TeamViewer daemon
      teamviewer --daemon start start TeamViewer daemon
      teamviewer --daemon stop stop TeamViewer daemon
      teamviewer --daemon restart stop/start TeamViewer daemon
      teamviewer --daemon disable disable TeamViewer daemon - don't start daemon on system startup
      teamviewer --daemon enable enable TeamViewer daemon - start daemon on system startup (default)
  2. Now we will check ID number for calling remotely our device and the current status of teamviewer daemon in our computer:
    user@home_machine:~$ /usr/bin/teamviewer –info

    TeamViewer 8.0.17147
     teamviewerd status
     teamviewerd stop/waiting
    TeamViewer ID: 9XXXXXXX7 <-- Your ID number
    
  3. If we don’t remember the password to connect to teamviewer in our home machine we can reset it using this command:
    user@home_machine:~$ /usr/bin/teamviewer –passwd MYnewpassword
  4. Now it’s time to enable the teamviewer daemon and launch (start) it. check that it’s up and running:
    user@home_machine:~$ sudo teamviewer --daemon enable
     mar jul 9 13:29:00 CEST 2013
      Action: Installing daemon (8.0.17147) for 'SystemV' ...
      installing /etc/init.d/teamviewerd (/opt/teamviewer8/tv_bin/script/teamviewerd.sysv)
      System start/stop links for /etc/init.d/teamviewerd already exist.
      /etc/init.d/teamviewerd start
      Starting teamviewerd...


    user@home_machine:~$ sudo teamviewer –daemon start

    /etc/init.d/teamviewerd start
      Starting teamviewerd...

Upload ssh key to a server for easy access

0
cat .ssh/id_rsa.pub | ssh hostname 'cat >> ~/.ssh/authorized_keys'

ssh tunnel to a postgres dbase running on a remote server

0

When wanting to access a remote running postgres dbase I always forget the correct command to set up a ssh tunnel.

ssh -L 65432:localhost:5432 user@server

Rotate video 90 degrees clockwise

1

I’ve have a video shot with a phone and for some reason the maker thought it would be a good idea to keep the phone upright while filming.
So now I’m forced to view the video with my head turned 90 degrees.
It’s uncomfortable so lets turn this video 90 degrees clockwise.

avconv -i inputvideo.mp4 -c:a copy -q 1 -r 23.967 -vf "transpose=1" outputvideo.mp4

Get sqlautocode to work with slqalchemy >= 0.8

1

As the tool sqlautocode doesn’t work with sqlaclhemy >= 0.8 I’ve patched it to get to work.

(of course I’ve send the patch to the maintainers but I fear the project isn’t very alive)

Here’s the patch:

diff -u sqlautocode/ my_sqlautocode/
 diff -u sqlautocode/config.py my_sqlautocode/config.py
 --- sqlautocode/config.py 2014-06-06 10:29:55.000000000 +0200
 +++ my_sqlautocode/config.py 2014-06-06 10:22:56.000000000 +0200
 @@ -140,7 +140,7 @@
 engine = sqlalchemy.create_engine(url)
 test = engine.connect()
 test.close()
 - except sqlalchemy.exceptions.SQLAlchemyError, ex:
 + except sqlalchemy.exc.SQLAlchemyError, ex:
 parser.error('Could not connect to "%s": %s' % (url, ex))
diff -u sqlautocode/declarative.py my_sqlautocode/declarative.py
 --- sqlautocode/declarative.py 2014-06-06 10:29:55.000000000 +0200
 +++ my_sqlautocode/declarative.py 2014-06-06 10:08:09.000000000 +0200
 @@ -14,8 +14,12 @@
 from sqlalchemy.ext.declarative import _deferred_relationship
 except ImportError:
 #SA 0.5 support
 - from sqlalchemy.ext.declarative import _deferred_relation as _deferred_relationship
 -
 + try:
 + from sqlalchemy.ext.declarative import _deferred_relation as _deferred_relationship
 + except ImportError:
 + #SA 0.8 support
 + from sqlalchemy.ext.declarative.clsregistry import _deferred_relationship
 +

Restore grub after windows7 install

0

I get forgetting the steps so here’s a reminder.
When you dualboot with windows and install windows *after* Linux you’ll lose the grub menu and get into the proper OS anymore.
That’s not ideal.
So here the steps to restore the grub bootloader after windows has removed it.

  • Get a Linux live USB/CD/DVD and start it.
  • Start a terminal and type this
    sudo mount /dev/sda1 /mnt
    
    sudo mount --bind /dev /mnt/dev
    sudo mount --bind /proc /mnt/proc
    sudo mount --bind /sys /mnt/sys 
    
    sudo chroot /mnt
    
    update-grub
    
    sudo grub-install /dev/sda
    
    exit
  • reboot

Done.

 

 

Go to Top