Lost OpenVPN Connection to TomatoVPN

This is directed toward a pretty specific audience, so this probably won’t be too useful for many people. If you have TomatoVPN with OpenVPN set up, sometimes the OpenVPN server will go down, and you’ll lose access. It’s happened to me many times where all of a sudden, I get a disconnect and an error like the following in my logs:

Feb 15 11:34:34 localbox ovpn-client[2621]: TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Feb 15 11:34:34 localbox ovpn-client[2621]: TLS Error: TLS handshake failed

Due to this, I’ve come up with a routine to work around the problem. First, you need to make sure you can SSH in from outside your network. The settings I use look like this:

Assuming you can still SSH in, the process to restart the OpenVPN server is pretty simple. Just use the option -D and specify a port, to set up a proxy for your web browser.

ssh -D 1800 root@yourtomato

After that, configure the proxy on your local machine or browser to use localhost on port 1800, and you should be able to reach Tomato on its LAN IP.

Posted in IT | Leave a comment

Switching from SVN to Git

Last week I came across a post on Slashdot about Git, stating that Eclipse had picked up Git as a supported alternative to Subversion. It was particularly interesting to me, as I had just been checking out alternatives to Subversion, like Mercurial, even going so far as setting up the server and installing Rhodecode to handle management. I figured that if Eclipse was supporting Git though, I should give it a try. I went through the quick, but painful process of setting up Gitorious on my server and started adding test repositories and seeing what it could do. I was pretty well impressed and decided to move to that platform, especially after seeing how much better EGit worked than MercurialEclipse.

In SVN, I had set up a repository for each general area of coding I do, one for personal stuff, one for freelance work, and so on. In those, I had folders for each project. In the projects, I had folders for each version, basically a snapshot of the code at a landmark date. I looked and tried many different programs to convert them to git, but ultimately couldn’t find anything that worked. I took an alternate route: set up an empty Git repository for each project, copied the versions in, tagged them, and copied the next highest version in. I lost a lot of my history, but thankfully that didn’t really matter to me as long as I had the landmark versions.

It took me an entire day to copy and set up all my projects, but I’ve noticed myself committing more often with more descriptive comments and just pushing when I’m done, since it’s so much faster and less troublesome than SVN. I’m definitely no power–user, but I never really was with SVN either. I also really like the idea of each clone being an entire repository in itself, in case something were to happen to my main repositories. Overall, I’m glad I chose to make the change.

Posted in Coding | Leave a comment

WordPress e-Commerce Store

I’ve recently been working on store sites for a client. This client asked me to work on another store for him, and during my initial data-gathering process, I suggested that we give WordPress and an e-commerce plugin a try. I prefer WordPress’ simplicity over the complicated mess that Joomla is, but granted, every software has a niche where it can shine.

Anyway, I took a look through the available plugins for e-commerce and settled on the widely used WordPress e-Commerce. I installed it, set up a few test categories and items, and handed an admin password over for the client to give it a try and see if it was agreeable. As it turned out, there was a problem in the plugin where you couldn’t switch the editor from HTML to Visual or vice versa. Loaded up Firebug and found it wasn’t properly including a certain JavaScript file. I also noticed that it wasn’t properly uploading photos, and not applying category photos. Digging through the logs, I found it was trying to write to a not created directory, ./wp-content/uploads/wpsc. Created the directory, changed some permissions, and reinstalled the plugin. Everything was good again and the client was happy with the choice.

Exciting? Not really. I’m just glad it was an easily fixable problem, but I’m still not exactly sure why the JavaScript was failing when there isn’t any in the directories it created.

Posted in Web | Leave a comment

WordPress SFTP Part 2

Note: This is an update of my previous post about enabling SFTP for WordPress available here.

I updated to Ubuntu 10.04, also known as Lucid Lynx, on my server and SFTP in PHP applications stopped working. Turns out that the pecl build isn’t compatible with the version of PHP shipped with 10.04, as far as I can tell. I tried reinstalling it, but it wouldn’t build. Thankfully I found out that there’s a package of it available in the repos.

Here’s the new method to enable SSH in PHP, which makes SFTP in WordPress work again.

user@computer:~$ sudo apt-get install libssh2-php

Restart Apache and you’re on your way. Way simpler than before is just a nice bonus.

Posted in IT | Tagged , , , , , | Leave a comment