Cygwin, git and ssh: ‘cannot spawn c:cygwinbinssh’

Using Cygwin and git on windows, I ran into an issue where git was working fine in a cygwin shell, but I was trying to setup a Jenkins build accessing a git repo, and git from Windows was giving errors like this:

$ git push myremote master
error: cannot spawn c:cygwinbinssh: No such file or directory
fatal: unable to fork

Running shell commands on Windows in Cygwin this was somewhat misleading, as I wasn’t expecting it to be looking for ‘ssh.exe’.

Turns out my GIT_SSH env var was causing the issue, had to replace this:

GIT_SSH=c:cygwinbinssh

with

GIT_SSH=c:cygwinbinssh.exe

and then all was good.

Installing XBMC media center on a HP Mini netbook

I’ve been setting up XBMC media center on an old HP Mini netbook as an experiment to listen to streaming radio via my home theatre setup. I started initially with the XBMCbuntu iso since it was the easiest to setup, but the Ubuntu side of this distro was too slimmed down for my liking. It didn’t come with drivers for the wifi card out of the box, so while I was planning on connecting via ethernet close to my home theatre setup, I still wanted to pickup the netbook and use wifi while working on setting it up.

So my next attempt I went for a full Ubuntu 12.10 desktop install (wifi drivers included), and then followed the manual steps to install XMBC next.

My main interest in XMBC is the Radio Add-on that has a menu of selectable streaming radio stations. My next interest is being able to control the radio selection remotely, either via a web interface or via an Android app. All the web interfaces, including the default interface, don’t seem to let you browse the Radio add-on. I’ve found one Android XMBC remote that does, so this one does what I need:

https://play.google.com/store/apps/details?id=ch.berard.xbmcremotebeta

My next interest is running Spotify on the netbook and also controlling it remotely. Two choices here, either

  • Use a Spotify Add on for XBMC, like Spotimc
  • Or install the Spotify for Linux client, and then use one of the many Spotify remote apps to control it directly

Given that I haven’t had much luck with XBMC remotes controlling XBMC add-ons, I’m going to try a separate Spotify install and then try out one of the remote apps, like this one: Spotcommander. I’ll post an update once I’ve got these installed and configured.

Resetting a password on Ubuntu

If you’ve forgot your user password on Ubuntu, you can easily reset it if you have a recovery option in your Grub menu. Boot into recovery mode, select the root shell option, then use passwd to set a new password for your user. Further details here.

If you get this error:

Authentication token manipulation error

then your drive is mounted in read only mode. If you have an option in your recovery menu to mount in r/w mode, then do that first then drop back into the shell. Otherwise you can mount it yourself with this:

mount -rw -o remount /

More info here.

Ensuring all traffic goes over an OpenVPN connection

By default, the setup guide described here if you follow the simple server and simple client setup instructions will get you a connection to your VPN server that allows you to tunnel connections through to your VPN server itself, but without any additional settings, you won’t be able to route all your traffic through the VPN.

There’s a number of other steps described in the Advanced section, but from trial and error I’ve found these are the minimum you need.

First, on your Ubuntu server, you need to enable ip_forwarding:

echo 1 > /proc/sys/net/ipv4/ip_forward

Next, you need to enable a forwarding rule for your iptables firewall so that traffic on your 10.8.0.0 network used (by default) on your VPN connection gets routed through from the tun0 interface to the eth0 interface:

iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE

Lastly, add this command to your /etc/openvpn/server.conf file to force all traffic from the client to get directed to the VPN server:

push "redirect-gateway def1 bypass-dhcp"

Restart your OpenVPN service:

/etc/init.d/openvpn restart

Now you should be good. You can test where your traffic is going by doing a traceroute to a server (www.google.com for example) before and after starting your OpenVPN connection and you should be able to see your traffic going via two different routes.