Russel William Go

I code for food.

Windows PC and Raspberry Pi Direct Connection

There are two computers on my desk that are connected to the same wireless network – a Windows laptop and a Raspberry Pi connected to a large LED display. It’s nice to have all these things on one desk but switching computers is not fun. So I set out to find a way to eliminate the problem by being able to connect to the Raspberry Pi through Windows.

One way to go about this is X11 forwarding through SSH. I can run my Python programs just fine and see their GUI but display refresh rate is awful; not to mention making X11 forwarding work is not exactly a walk in the park.

Then I tried VNC. Huge improvement over X11 forwarding but refresh rate on my VNC window is laggy sometimes, probably due to the wireless connection. So I decided to connect the Pi directly to Windows using an Ethernet cable to get better, less laggy connection. The outcome is just what I was looking for. There are tutorials detailing the process – some complicated, some are not – and they mention steps that are not really necessary. The gist of the whole thing is to give the Pi an IP address and make it remember that on every reboot.

Here it is –

  1. Plug one end of the cable to the Ethernet port on the PC, the other end to the Raspberry Pi, then switch both computers on
  2. Wait a few seconds while PC and Raspberry Pi get to know each other
  3. Then figure out the Pi’s IP address. Hover over the networking icon on the taskbar (thing beside speaker icon) and a bubble will appear. If you see “eth0: Configured” then the direct connection is working OK. If not then unplug the cable and repeat steps 1 and 2. Make a note of the IP address because you will need it in the next steps. [Note: the Pi will list all available connections – wired and wireless – so if you see “wlan0: Configured” it means the Pi is connected to a wireless network]
  4. Make the Pi remember its IP address so you don’t have to figure it out everytime you want to connect
    • Open a terminal window and edit a file:
      • sudo nano /etc/network/interfaces
    • Find the line that’s relevant to eth0. It will look something like this:
      • iface eth0 inet manual
    • Change it to:
      • iface eth0 inet static
      • address [insert IP address found in step #3]
      • netmask
  5. Save your edit and exit nano – press Ctrl+O, then Enter, and Ctrl+X
  6. Enter sudo reboot to restart the Pi
  7. On Windows, download and install TightVNC –
  8. Open TightVNC and connect to the Pi. In the “Remote Host” text box type the Pi’s IP address, then a colon and a port number, like so
  9. Click “Connect” and you will be prompted to input a password. If you have not changed the default password, type in “raspberry”; otherwise, use the new password
  10. Hit Enter or click “OK”

For a headless Pi setup, you can disconnect all connected peripherals except the Ethernet cable and use the display as your PC’s main/external display – because you will certainly appreciate the benefits of having more screen real estate.

Enjoy! :-)


Mac OS X Mavericks: How to move the dock from one display to another

One feature that I like about OS X Mavericks is support for multiple displays. If you are a developer this is useful stuff. OS X versions prior to 10.9 supported multiple displays; however, Mavericks does it properly this time. Displays now behave independently of the other. This means each display now has its own menu bar and applications entering fullscreen mode no longer render the other display unusable. Displays, sort of, get their own dock, too. Although moving it from one display to another takes some getting used to.

Moving the dock to a second display is not straightforward but it’s easy to do. Assuming you are using an Apple Magic Mouse, you can tell OS X to move the dock to the active display by following these steps:

First, click the desktop or any window on the display where you want the dock to move to. This will make the menu bar go active. 

Then, place your finger on the mouse while moving the cursor towards the bottom of the screen. The dock will them pop up.

Easy, right?

Hit two birds with one stone by doing a physical activity

I’m loving Dubai. The climate in the city during this time of year is cold and nice so I decided to walk around the school block right across the building I live in for two hours. The school’s perimeter is about 1.2 kilometers and circling it takes me on the average about 12 minutes to complete. So, doing the maths, in two hours I would have walked 12 kilometers non-stop. Not bad for a beginner like me. (Actually, my RunKeeper says the distance I walked is longer although I am inclined not to believe it. Looking at the map it produced, I see zigzags which is not true because I walked in a straight direction and not in a zigzag-y manner. It must be the phone swinging back and forth or the GPS going nuts.)

Anyway, what I wanted to do with this blog post is share a tip when the best time to think things through is.

For instance, you have plans for the week ahead and couldn’t find the perfect time to think. Well, here’s a solution. Try a physical activity such as walking or running. Put your walking shoes on, play some funky music and hit the pavement. While you’re sweating yourself to a lean and mean body, try focusing your mind on something that’s bothering you (in a positive way, of course). I find that I am able to concentrate more on my plans for the next day whenever I am outside walking towards home or exercising.

So, there. Let me know if it helped you.

Happy new year!

I must have eaten something weird today for I suddenly felt the need to blog.

Yep, you read it right. I will be blogging. Although this blog has been around since mid-2012, I have not posted anything worthy of a blog post, yet.

So, watch this space. 

Here’s hoping to a better and more fruitful new year 2013.

Happy new year everyone!

Blog is mostly empty..

However, don’t fret. Good stuff’s hidden in the links above.

%d bloggers like this: