How to flash factory image on any Nexus device to return to stock


A couple of days ago, Google released the Android 4.4 KitKat factory images for the Nexus 4, 7 (2012/2013) and the Nexus 10. The factory images were already available for download on the day the device went up for sale on the Play Store. Factory images are a great way of completely resetting your Nexus device and putting them back to stock.

If you have rooted, flashed a custom ROM on your Nexus device but now want to go back to complete stock, simply follow the steps below. Do note that the below steps will completely wipe your Nexus of any data, so make backups. Also, you will need to have an unlocked bootloader to flash the factory image.

Step 1: Download the ADB/Fastbootfiles and the USB drivers for Windows based PC first. The the latest factory image for your Nexus device can bedownloaded directly from Google’s website.

Extract the contents of the ADB/Fastboot ZIP file inside a new folder called ‘google’ on your desktop. Extract and transfer the contents of the factory image inside this folder as well. The list of files will include a ZIP file containing the codename of your Android device, two files with “flash-all” names, and a bootloader image file. All the extracted contents of the factory image should be inside the same folder as the ADB and Fastboot file, otherwise you will get a file not found error.



Make sure to install the ADB drivers as well if you are running a Windows based PC.

Step 2:  Now, reboot your Nexus device in bootloader mode. This is usually done by switching off the device, and pressing the Volume down + Volume Up + Power button simultaneously. If that does not work, try the Volume down + Power button combination.

After the device has booted into bootloader mode, connect it to your PC.

Step 3: Open a new Terminal or Command Prompt window, and navigate to the ‘google’ folder that you created in Step 1. Before we start flashing the factory image, we need to make sure that your Nexus device is being detected by the PC.

fastboot devices

If you are using a Mac, then you need to prefix a “./” before every Fastboot command. So, the above command will look something like this on a Mac -:

./fastboot devices

The above command should confirm if your device is indeed being detected by your PC or not. If it is, then proceed to the steps below. If not, repeat the steps above again. Make sure that you have properly installed the drivers and are inside the correct folder.



If you are running Windows, copy-paste the following command in the command prompt window -:


On a Mac, copy-paste the following command -:


The script will then automatically flash the full factory image on your Nexus device. Once the factory image has been fully flashed, your device will automatically reboot. Keep in mind that the first boot might take some time so please be patient.

The flash-all script included in the factory image might not work for all. It has always been pretty unreliable and has only worked once for me in the last 2 years. If you are in the same boat as me, you will have to flash each partition manually on your device. This is slightly cumbersome though.

The command to manually flash a partition via fastboot is “fastboot flash partition filename.img”. In the factory image that you extracted in Step 1, you will notice there is another ZIP file. Extract the contents of that ZIP file inside the ‘google’ folder.


Now, its time to manually flash the partitions to your Nexus device. We will first begin with the bootloader.

fastboot flash bootloader filename.img

Then, we will flash all other partitions. They don’t necessarily need to be in the same order as I have listed them below. The names of the image files in the factory image will clearly indicate the partition they are intended for as well.

fastboot flash boot filename.img

fastboot flash radio filename.img

fastboot flash recovery filename.img

fastboot flash userdata filename.img

fastboot flash system filename.img

If you want to relock the bootloader of your device after flashing the device, put the device back in fastboot mode. Then type in the following command in the Terminal or Command Window you had opened earlier -:

fastboot oem lock

This will re-lock the bootloader of your Nexus device, restoring your warranty and putting the device back to complete stock.

Install ESXi 5.5 with Realtek 8111/8168 NIC

Install ESXi 5.5 with Realtek 8111/8168 NIC

Posted by on Tue Sep 24th, 2013 (edited on Sun Feb 16th, 2014) in ESXi, Network 28 Comments

ESXi 5.0 and 5.1 all worked fine with the common Realtek 8111/8168 series of network adapters, typically found in a variety of consumer-class motherboards. What to do in the home lab? Suddenly you can’t even install ESXi, even though you have a perfectly workable system that happens to already have Realtek onboard. Such as my very own vZilla? Yes, with 5.5, you’ll get the dreaded “No compatible network adapter found please consult Hardware Compatibility Guide for supported adapters” message. Even though you likely won’t find this chipset on the HCL, this article gets you clear of that hurtle, offering two approaches.

Software fix #1:  Inject the 5.1 driver into the 5.5 installation media.

How’s simply adding the driver from 5.1 back into your installer ISO image sound. You know, the driver that VMware has apparently taken away from 5.5. While this fix could be seen as a slight hack, it’s hardly dangerous, and can be convenient if you just want something that works. You’re likely unsupported in the home lab anyway. You’re basically just front-loading a VIB (driver bundle) that VMware’s own procedure talks you through the same approach, Installing async drivers on ESXi 5.x (2005205), Jul 24, 2013. It’s just that the VIB is about a year old, and hasn’t been tested by VMware on ESXi 5.

The demand for info on this is clearly there, with 2 excellent conversations going on right here at TinkerTry, and numerous discussions around the web on this common issue. The fix is pretty straight forward. I found a timely article just yesterday which has nicely explains how the ESXi Customer tool does its gentle massage of the ISO, even from Windows 8.1. It’s titled Adding Realtek R8168 Driver to ESXi 5.5.0 ISO by Erik on Sep 23 2013, where he points us to the correct file.

Here’s a copy of the exact VMware_bootbank_net-r8168_8.013.00-3vmw.510.0.0.799733.vib file. For Chrome, that’s done by Right-clicking the URL above, then choosing Save As…That’s the exact file I used for my RTL8111E.

While Erik is talking about the 8168, it’s the same driver family as the 8111, as seen on Realtek’s site. I’ve tested that this injection method works fine with 5.5 and my ASRock Z68 Professional Gen3 motherboard and it’s 2 RTL8111E ports in my 2011 vZilla virtualization whitebox. See screenshot I just took above. Injection took mere seconds, and I then used Rufus to take the ISO and a make bootable USB flash drive out of it, in about 2 minutes, demonstrated here. That same flash drive is used to boot from USB, then chosen as the installation target. Elegant, quick, no CD/DVD burning needed.
See also:
Finally, and alternative injection technique that uses just PowerCLI 5.5:
Installing VMware ESXi 5.5 on the Gigabyte Brix by Phil Wiffen, Sep 23 2013.


Software fix #2:  Add the VIB to an existing ESXi 5.5 installation

Assuming you somehow got ESXi 5.5 going already, say with another brand of NIC, then the below article should get you through simply adding the VIB,
Realtek 8169 NIC in ESXi 5.5 not detected by default – install a VIB by Vladan Seget on Sep 30 2013.

VMWare vSphere Remote Access via SSH Tunnel

Recently I had a need to remotely connect the VMWare vSphere Client to an ESXi 5 host. I hadn’t got a VPN setup on that particular network yet, and my main remote access was usually to one of the VMs (which didn’t happen to be running at the time – yes, I know, bad move on my behalf…).

Thankfully, I had a couple of Linux server on that network of which I had SSH access to. This meant that I could easily setup a SSH tunnel from my local desktop, to that SSH server, which then forwarded the packets to the ESXi host. This should take less that 60 seconds to setup.

Using PuTTY, I set the server IP just like usual, then proceeded to add some settings to the Connection > SSH > Tunnel menu. The three ports vSphere client needs are 443, 902 and 903. One at a time, add these port numbers to the “Source port” field and the IP:Port to the “Destination” field. The IP address you use is the local IP of the ESXi or vSphere host, such as

It should look something like this:

PuTTY Port Tunnelling for vSphere

Connect your SSH tunnel and login. If you point a web browser towards https://localhost/ you should see the ESXi welcome screen (where you can download the client software). This means the tunnel is working. However, having this isn’t good enough. If you try and connect to vSphere using ‘localhost’, it will chuck a wobbly and refuse to connect.

Instead, we need to go into the hosts file for your computer and create a record and point it back to localhost. This file is located at C:\Windows\system32\drivers\etc\hosts. You may need to grant yourself file permissions to write to this file in Windows 7.

The name you pick isn’t important. As you can see, I called mine ‘esxlocal’. It could easily be ‘lizlemon’ or ‘joshlyman’. It just needs to point back to

Hosts file vSphere Port Tunneling

Once you’ve added this, you can open up the vSphere client and connect using the host name you just set in the hosts file and your usual credentials.

VMWare vSphere Client - Connection Window

This is all you need to connect. You should now have full access to the vSphere console, allowing you to administer your ESXi servers remotely.

AppleTV + SSL + PlexConnect

Preflight Checklist

Before you begin…

Setup your Host

Mac Windows Linux
Mac Win Linux

Setup your aTV


Apple updated the trailers channel recently and broke everyone’s PlexConnect by switching it over to fetching certain resources via HTTPS. Game over right? Well, no.

To fix it here is what you will need!

  1. Apple Configurator (10.7+ Mac only) or iPhone Configuration Utility (Windows or 10.6 Snow Leopard)
  2. A microUSB cable to attach to your AppleTV
  3. Updated PlexConnect software (follow the instructions carefully!)

Okay, let’s go.

Create the Cert

Open a terminal window ( on Mac) and run the following command

openssl req -new -nodes -newkey rsa:2048 -out ~/Desktop/trailers.pem -keyout ~/Desktop/trailers.key -x509 -days 7300 -subj "/C=US/"

This will create two files on your desktop: trailers.key and trailers.pem. Next run this:

openssl x509 -in ~/Desktop/trailers.pem -outform der -out ~/Desktop/trailers.cer && cat ~/Desktop/trailers.key >> ~/Desktop/trailers.pem

At this point you will have 3 files. We’ll be using them shortly.

Windows Notes You can install OpenSSL for windows and then run the following commands in a cmd prompt window. This will work with a default OpenSSL win32 install, but you need to run cmd with administrator privileges (right click run as administrator):

C:\OpenSSL-Win32\bin\openssl.exe req -new -nodes -newkey rsa:2048 -out C:\trailers.pem -keyout C:\trailers.key -x509 -days 7300 -subj "/C=US/" -config C:\OpenSSL-Win32\bin\openssl.cfg

You’ll also need to run this command

C:\OpenSSL-Win32\bin\openssl.exe x509 -in C:\trailers.pem -outform der -out C:\trailers.der

and finally run this (the word “type” is part of the command, paste this entire command into your cmd prompt)

type C:\trailers.key >> C:\trailers.pem

Create the Profile

Apple Configurator Method (iPhone Configuration Utility people scroll down!) configurator

Turn supervision on and you should see a section called “profiles” appear. Click the plus sign and select “create new profile…” profile-create

Name it whatever you’d like and then click “Certificate” on the left. Click “Configure” and then select the “trailers.cer” we created earlier. At this point click save and your profile is created.

iPhone Configuration Utility Method (SKIP TO INSTALL THE PROFILE IF YOU USED THE APPLE CONFIGURATOR METHOD screenshots are for Mac but the Windows version should work similarly) Open the app up and click Configuration Profiles on the left, then click new. Fill in the Name and Identifier with whatever names you want and then scroll down on the left pane and choose Credentials. Click Configure and add the “trailers.cer”. (Windows users, you will need to double click trailers.der and install it to your local certificate store before you do this. Once you’ve done that you should see the certificate show up when you click configure) At this point you’ll have something that looks like this: icu-profile

Install the Profile

Apple Configurator Method (iPhone Configuration Utility people scroll down!) Turn supervision back off and now click Install Profiles. You must now connect your AppleTV to your computer using the microUSB cable. You must have the AppleTV plugged into power when you do this or else it will enter recovery mode. Once it sees the device click next and select the profile you want to install. install Click next and once you see the giant green check mark you’re good to go!

iPhone Configuration Utility Method (SKIP THIS IF YOU USED THE APPLE CONFIGURATOR METHOD screenshots are for Mac but the Windows version should work similarly) Connect your AppleTV to your computer using the microUSB cable. You must have the AppleTV plugged into power when you do this or else it will enter recovery mode. Once it sees the device click on it on the left, then click the Configuration Profiles tab, and finally click install next to the configuration profile you want to install (you’ll only see one. The screenshot below has more just due to how many times I’ve run through this process). icu-fixation Once it says “remove” instead of install you’re all set!

Updating & Configuring PlexConnect PlexConnect needs some new stuff, so let’s get going. First, you’ll need to get the latest code. If you installed PlexConnect via git you can just do a git pull. If not, go to the PlexConnect site and follow the installation instructions again.

Once you’ve done that you’ll need to add two new lines to configuration. To do this just run PlexConnect and it will add the lines below automatically or create the entire Settings.cfg file if necessary. To run it execute sudo ./ or depending on OS just or ./

port_ssl = 443
certfile = ./assets/certificates/trailers.pem

Now we need to move the trailers.pem file so that PlexConnect can find it. Open the directory PlexConnect is in, open the assets directory, create a directory called “certificates” inside it, and then put trailers.pem inside certificates.

Putting It All Together

Moment of truth. Run PlexConnect (sudo ./ or however you choose to run it) and everything should work!

Windows 7 and ATV and ethernet internet connection installation guide

Ensuring that your PlexConnect machine always has the same IP address

In order for PlexConnect to work the ATV has to have its DNS server changed to the IP address of the device running the PlexConnect application. In order to ensure that the device’s IP does not change you need to need to either set a DHCP reservation or static IP in your router for the device and then make a note of it. Click here for a Lifehacker guide on how to set this up.

Configuring your ATV

On the main screen of your ATV select the ‘settings’ button:

5.2 main screen

On the settings screen of your ATV select the ‘general’ button:

5.2 settings - general button

On the general screen of your ATV select the ‘network’ button:

5.2 general - network button

On the network screen of your ATV select the ‘ethernet button’ (if you are connected via wireless then select that instead):

5.2 select network connection ethernet

Make a note of the current DNS server as this is needed for one of the optional steps in the advanced setup options, then click on the ‘configure DNS’ button:

5.2 note current DNS and select configure DNS

On the ‘configure DNS’ screen click on the ‘manually’ button:

5.2 select to configure DNS manually

On the ‘configure DNS’ screen change the IP address to that of the local IP of the device that you are running the PlexConnect application on and then click on the ‘done’ button (if you are using a firmware prior to 5.2 it may ask you to configure the IP address of your router and the subnet mask, leave them unchanged):

5.2 configure your PlexConnect device local IP as the new DNS server value

It should return you to the previous network configuration screen, check that the DNS server is set to manual and that the IP address is now that of the machine that you are running PlexConnect on:

5.2 check DNS server is now pointing at your PlexConnect device

Downloading, installing and configuring PlexConnect

  1. Download Python 2.x (2.7 is the minimum version) from here and install it. NB PlexConnect is not designed to work with Python 3.x. so please ensure you install the correct version.
  2. If you are running a firewall (Windows or otherwise) ensure that you create a rule for python.exe
  3. PlexConnect 0.1 can be downloaded from here. If you want to live life on the bleeding edge and have aTV firmware 5.1 or newer you can download the latest zip from Github here. NB do not expect support on any branches as they are either running test or outdated code.
  4. Once you have downloaded the zip file, place it in a directory of your choosing on the machine you wish to run PlexConnect on and unzip it.
  5. Double-click the “” file to start PlexConnect
  6. You should see output in the command window as PlexConnect starts.
  7. Open the Trailer application on your ATV and you should see the PlexConnect interface appear.
  8. Enjoy

Added an init script to start and stop the Plex Connect services as a proper daemon/service.

Note: To do this I used the ‘screen’ application. If you don’t have screen, install it using yum (or it’s equivalent on other distributions, e.g. apt-get)

yum install screen

Below is the init script. This script is saved as /etc/init.d/plexconnect.

# Provides:          plexconnect
# Required-Start:    plexmediaserver networking
# Required-Stop:     plexmediaserver networking
# Default-Start:     3 4 5
# Default-Stop:      0 1 6
# Short-Description: This is the Plex Connect daemon
# Description:       This script starts the Plex Connect
#                    Python scripts in a detached screen.

# Using the lsb functions to perform the operations.
. /lib/lsb/init-functions

# Process name ( For display )

# Daemon name, where is the actual executable
DAEMON_OPTS="-S PlexConnect -d -m /usr/local/lib/plexconnect/"

# pid file for the daemon

# If the daemon is not there, then exit.
test -x "$DAEMON" || exit 5

case $1 in
  # Checked the PID file exists and check the actual status of process
  if [ -e $PIDFILE ]; then
   status_of_proc -p $PIDFILE "$DAEMON $DAEMON_OPTS" "$NAME process" && status="0" || status="$?"
   # If the status is SUCCESS then don't need to start again.
   if [ $? = "0" ]; then
    log_success_msg "Starting the process $NAME"
    exit # Exit
  # Start the daemon.
  # Start the daemon with the help of start-stop-daemon
  # Log the message appropriately
  if start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --startas $DAEMON -p $PIDFILE -- ${DAEMON_OPTS}; then
   while read line ; do [[ $line =~ ([0-9]*).PlexConnect ]] && echo ${BASH_REMATCH[1]} ; done < <(screen -ls) > $PIDFILE
   log_success_msg "Starting the process $NAME"
   log_failure_msg "Starting the process $NAME"

  # Stop the daemon.
  if [ -e $PIDFILE ]; then
   status_of_proc -p $PIDFILE "$DAEMON DAEMON_OPTS" "Stoppping the $NAME process" && status="0" || status="$?"
   if [ "$?" = 0 ]; then
    start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
    /bin/rm -rf $PIDFILE
    log_success_msg ""Stopping the $NAME process""
   log_failure_msg "$NAME process is not running"
  # Restart the daemon.
  $0 stop && sleep 2 && $0 start
  # Check the status of the process.
  if [ -e $PIDFILE ]; then
   status_of_proc -p $PIDFILE "$DAEMON $DAEMON_OPTS" "$NAME process" && exit 0 || exit $?
   log_success_msg "$NAME process is running"
   log_failure_msg "$NAME process is not running"
  $0 restart
  # For invalid arguments, print the usage message.
  echo "Usage: $0 {start|stop|restart|reload|status}"
  exit 2

Now you need to make sure the script has the correct permissions and add it script as a service / daemon so that it starts automatically. Then start the daemon. To do this, make sure the permissions are correct and use update-rc.d. If you are using the root user you do not need the 'sudo' command at the front of the commands below.
sudo chown root:root  /etc/init.d/plexconnect
sudo chmod 755  /etc/init.d/plexconnect
sudo update-rc.d plexconnect defaults
sudo /sbin/service plexconnect start

Your Chromebook As The Ultimate Travel Device

Your Chromebook As The Ultimate Travel Device

If you’re trying to decide what sort of lightweight device to get for your next big trip, you may consider checking out Chromebooks. But why choose a Chromebook for travel specifically? Because, when it comes to travel, they are spot on.

No Data On Your Device

Since Chromebooks are designed to be used mostly online, you’re not lugging around a device full of applications and files. This means you’re not likely to lose all your coveted photos if someone steals your laptop. It also means no-one at border security will be able to arrest you for pirating software or entertainment (if you’re the sort of person who has that stuff on your computer).

Most importantly, the Chromebook setup means no-one can get access to your data – neither thieves nor border security. Border security could ask you to log in, but if you’re really concerned about this, you could reset the device or remove your account yourself before going through border security. A thief would have to break into your Google account in order to get anything sensitive out of having your laptop in their possession. Meanwhile, you could reset your password and would soon be able to replace your Chromebook, with everything just as it was.

Chrome travel touristeye   Your Chromebook As The Ultimate Travel Device

Either way, there is not a lot of data stored locally, so this is ideal for travel. Security of your data is one of the most important things to keep in mind when you’re travelling with a laptop.

Offline Access

Chromebooks have built-in media players, so you can load up a USB full of music or video for watching while you’re in transit. With seamless access to your Google Drive account, you could also potentially add files you will want to Google Drive, then download them when you can during your trip. Check out Google’s full list of supported media files for Chrome OS.

Chromebook offline apps   Your Chromebook As The Ultimate Travel Device

You can also use apps like Gmail offline to write email while you’re disconnected. There are dozens of other useful offline-enabled apps for Chrome, too. Check out everything you need to know about switching to a Chromebook and check out Google’s guide to apps you’ll need for your Chromebook.

Chrome Travel Apps

Chrome has a great line in useful travel apps and extensions to use. Before your trip, you can use Chrome extensions to help you learn the language, you can use Hipmunk and TouristEye to help you plan the trip, Mapnificent to check our the transit situation of your holiday destination, Al-Jazeera to keep up with news in English. You can also use Google Street view to check out the airports before you arrive. Also check out our Geek bucket list and international travel guide sites while you’re preparing.

Chromebook Travel Touristeye   Your Chromebook As The Ultimate Travel Device

Gadgets To Have With You

Matt has written a great guide on using a Chromebook to work anywhere cheaply, detailing useful peripherals you should consider getting for your setup. In particular, consider getting a mobile hotspot device and a pocket router. Those things could be really handy when travelling. Especially if you hope to make money while you travel.

huwaeiie5331   Your Chromebook As The Ultimate Travel Device

What do you think of Chromebooks? Would you consider them ideal for travelling or not? Why?

What would happen if the sun disappeared?

If the sun disappeared, for eight-and-a-half minutes we’d have no idea that the sun had gone. We’d still see it – lingering, like a ghost – in the sky above Earth’s day side. As soon as the last of the sun’s light reached us – eight-and-a-half minutes after the sun itself disappeared – the sun would blink out and night would fall over the entire Earth.

Not until that instant would Earth sail off in a straight line into space. Einstein’s special theory of relativity tells us that no signal in the universe – not even the tug of gravity – can travel faster than the speed of light – about 300,000 kilometers, or 186,000 miles, per second. Though free from the sun’s gravity, we’d be traveling at the same speed as before – about 18 miles, or 30 kilometers per second. So Earth would be traveling at the same speed as always into eternal night.

If you were on Earth’s night side when the sun disappeared, you might not notice anything … at first. But then the night sky would begin to change. For example, if there were a full moon – which shines with reflected sunlight – its light would disappear a few seconds after the sun’s light blinked out. Over the course of several hours, the planets would wink out one by one, as they reflected the last of the sun’s light to us.

How to change SID on Windows 7 and Windows Server 2008 R2 using sysprep?

sysprep3 In last post I described how to check SID on Windows 7 and Windows Server 2008 R2, today I’ll describe you how to change SID on Windows Server 2008 R2 and Windows 7 using sysprep. I see many of you are looking how to change SID using NewSID, but New SID is not officially supported by Microsoft. You could use NewSID on Windows Server 2008, but when you try to use it on Windows Server 2008 R2 it won’t work, actually, it will “destroy” operating system. I didn’t test it on Windows 7, but still my advice is to use sysprep. Changing SID using sysprep is also very simple, just follow few steps as described below…


I tested sysprep on Windows Server 2008 R2 Datacenter edition, but same steps apply for Windows7 also.

First, click to Start->Run, type sysprep and press OK.



This will open sysprep folder which is located in c:\Windows\System32. Open sysprep application.



This will open System Preparation Tool 3.14 window. As a System Cleanup Action select Enter System Out-of-Box Experience (OOBE). Important: select Generalize if you want to change SID, it’s not selected by default. As Shutdown Options select Reboot.



It will take some time for sysprep to finish, so grab a cup of coffee and wait.



After rebooting you’ll have to enter some data, for example, Country or region, Time and currency and Keyboard input.



Also, you’ll have to accept EULA. And that’s it. After booting, in Server Manager you’ll see that everything is changed, if you had some settings set now they’re changed.



Now you can again use PsGetSid to check that your OS has new SID.