Personal Blog of Ryan Gibbons

A Placeholder for my Ramblings

Notes on Using Svn With Git (Git-svn)

Overview

I’ve been using git svn for a while now. And I gotta say, if you are stuck using SVN as your central repository, then useing git-svn is the only way to continue to work. You get all the benefits of git while developing on your local host and you only lose some of the cross machine / developer benefits from using SVN as the shared server.

Basic Workflow

git svn

git svn branch

git svn dcommit

Finally the Switch

Welcome Back

I’ve finally got around to finsihing the migration of Wordpress to Octopress. I could post how I didn’t, but all I really did was follow this wiki page from the Jekyll repo. I guess if you need help, feel free to leave a comment and I’ll help out where I can.

I didn’t switch of anything bad with Wordpress, just wanting something different and didn’t want to work with an entire RDBMS and language stack again. So this looked cool and fun.

I did take this oppurtunity to clean out old post and just carry over a handful of posts that still seem useful. I’ve disabled comments on these because I they are still really old and I don’t have access to those enviroments to provide support. Again, if you need help with one, just hit me on on twitter and I’ll do what I can.

DD-WRT & My New Asus RT-N16

I’ve haven’t used a manufacturer’s  firmware on my router in YEARS. Seriously since like 2003 or 2004. I started of using OpenWRT, which was the first one out there of this kind. It allowed you to run Linux on your Linksys router. This was freaking awesome. I used, loved it, and might of fried one or two routers in the process :/ Since then there have been several different spin offs and IMHO, better ones out there. For the last several years I’ve been running DD-WRT on my Linksys WRT54G (The same one that I originally put OpenWRT on, fried, and then fixed). I found myself need to extend my wireless network, but not in the normal since of wireless. I need to turn a switch into a wireless client so I could have a hard wired connection on the other end. I started searching for a new router, one that would last me a while, and more importantly. One I could hack. The short of a very long process for me, I settled on a ASUS RT-N16. This thing is loaded, 32MB of storage, 128MB of ram, and480 Mhz processor. It supports B, G and N. Pretty nifty. I got it, fired it up. And spent just enough time in the Asus firmware to load up DD-WRT. I took my old Linksys and converted it into a wireless client. So no, it is just one huge switch. What I have is the wireless portion of it is just like the wireless in a laptop, and it connects to my router. Then all the ports on the back are just like a normal switch. I can now plug my desktop computers in my office up to it, and they are all on my network. It’s a pretty slick setup. The connection between the Linksys router (now switch) and the Asus router is a bit flaky at times. And this is because of a multitude of reasons. The biggest being the number of walls the signal has to travel through. But I am working on fixing that one (moving the Asus router out of the bedroom one day). The other problem is the DD-WRT firmware on the Asus router. The router requires a beta release of DD-WRT running the 2.6 kernel. Older versions used the 2.4 kernel. But to support a wider ranger or routers (including this Asus) they had to use the 2.6 Kernel. There are still some bugs, and some things are quite working like they are suppose to, but that is why it is a beta release. Overall, I am very happy with everything. As long as I can resist the temptation of tinkering with them. The connection remains really stable.

NFS and Subversion, It Can Work!

There are a lot of blogs and articles out there about SVN and NFS. You can search google and easily find a lot of information about them. But I never found anybody that felt like they found a definitive answer.

In my case I kept getting an error about not being able to find and available lock, the error looks something like svn: Can't get exclusive lock on file '/repo/db/write-lock': No locks available It turns out it is actually pretty easy to fix. And for those that don’t want to read further, all you have to do is add the nolock option to your nfs mount. My fstab entry now looks like this192.168.1.154:/volume1/svn /media/svn nfs rw,nfsvers=3,nolock 0 0. That’s all I use, and now my svn is working over nfs, safely I might add.

For those looking for a bit more explanation (which is what I couldn’t find). SVN dev’s prefer you not to use the Berkeley DB over NFS. So make sure you are running a new enough SVN so it uses the FSFS backend not the BDB. The next, it is my understanding that SVN uses file locks to protect the files during checkout and checkin, to prevent them from being over written. NFS uses NLM locking and it is used so that all clients of that nfs export no about the file lock. Apparently subversion is compatible with this locking mechanism. Adding the nolock option to the mount point as the client uses a more basic locking mechanism that only provides protection only form programs running on that machine.

What does all this mean, it means I am able to mount my svn share on a nfs export, but only that one machine can really access this export to guarantee consistency in our repository. You do lose some of the benefits of it being over an NFS share, you couldn’t do any type of load balancing over multiple SVN frontend servers, but it does allow our NAS to hold our repository and puts me one step closer to consolidating our storage.

While I didn’t provide a new answer, I am providing the reasoning behind the answer as I can see it. Something I couldn’t find out there on the Internet.

Redmine Follow Up - LDAP and AD Authentication

In a previous post about Redmine I mentioned that I was having problems with LDAP and 2003 Active Directory authentication. Now I considered myself to have a fair amount of LDAP and Active Directory experience. I have set up samba PD and set up PAM to auth against LDAP. Even to grab user credentials. I’ve written scripts to pull users from ldap for initial setups in other applications, etc, etc. But for the life of me I couldn’t get redmine to auth against AD.

I probalby spent about 5 hours debugging Redmien to find the error. I had logger.info lines all over the place (I’m a ruby newbie), I’m debugging the mysql queries, if statements, everything I can think of. After 1) understanding Redmine and 2) understanding ruby, I was able to start norrowing it down. The SQL queries were fine, the initial ldap bind was fine, but it was authenticating.

I ended up finding out that the problem was with the ldap_conn.search() fucntion. I wasn’t executing correcting. They seemed to using it as kind of an if statement, so I was trying to ouput the status, but wasn’t getting anything. I thought this was my lack of knowledge of ruby. I forced the ldap_bind to fail, so I know for a fact the ldap_conn.search would fail, and it did, but this time it would return false. But when everything else seemed to work find, ldap_conn.search would return nothing. I was stumped. I had no clue what to do. I went home that day feeling defeated. I talked to Brian and he made fun of me, like any good friend should, and told me it was user error. I laughed him off and went on my. Next day at work though ended up proving him right. I ended gettign the bright idea to cdump out all the variables being used. I read that when the ldap search function was giving a filter string that was the written out the way it wants, it silently fails. I looked through them all, and they all looked okay, fiddling with them for a bit didn’t do anything. Then I dumped them again , and it hit me, like a pallet of falling bricks .. yes it hurt as bad also.

My username field for the ldap search as set to sAMAccountName , what you can’t tell from this is that it was actually ‘sAMAccountName ‘, with a space at the end. So the filter ws being set to sAMAccountName =ryan.gibbons. While you would think this might work, it doesn’t, but whats worse is that redmine let this pass, and ruby-net-ldap didn’t doesn’t handle invalid filters at all. Hence my post below about Data Cleansing.

So hopefully this post will help others out there having similar issues. I’ve learned my lesson for the week, only question is how long will I remember it. Tomorrow I will go submit a bug to hopefully have this error fixed. Yes even computer nerds and programs fall victim to PEBKAC.

Redmine - Lean and Powerful Project Management

I’ve started to use Redmine a bit in my personal business to help manage the few projects that go through my doors. A buddy, Brian Wigginton, turned me on to it. We have spent several nights looking for a good app that can manage, tasks, issue and project workflow from beginning to completion. After trying out several different ones ( i.e. OPProject, Trac, Achievo, and even dokuwiki ) based on multiple technologies ( i.e. java, python, php, and ruby). We ended up with Redmine, which is based on Ruby on Rails. The install wasn’t too bad (we spent most of the time working with phusion passenger, which being a fan boy of mod_fcgid, I highly recommend.) The database design seems pretty straight forward and it has all the features we were looking for.

OnePoint Project (OPProject) was an amazing it. It was java based and we deployed it over a tomcat-6 server. For a strict project management app, I think this one wins hands down. The interface is clean and sharp. Even know little about Project Management, I was able to find my way around the system and get some basic things set up. It manages resources and time. And again, the Gantt charts were very easy on the eyes.

Trac is more of a software management portal. It is based on python, and I deployed it in the past using mod_python (before I knew about mod_fcgid). It is a very strong app for managing software development. It has a strong integration between the repository, bug tickets, and a wiki. It was missing a few of the project managemenent aspects we were looking for, but it works great for basic management of software development.

Achievo describes itself as a flexible web-based resource management tool for business environments. And I would have to agree with that. It doesn’t tie into a software repository like Trac does, but it does provide more project management tools such as gantt charts. One piece I did like, was it’s ability to add clients, and manage projects and task for assigned to those clients. If we were looking for a general business or department management tool, this peice of software would of probably won out.

DokuWiki is just a wiki, with the ability to add plugins. We started using it in the interum as we were trying to find a software package for us to use. You could use this as a basic project management for a group of people, especially a decentralized group. Collabrating on pages for ideas, managing picture, and providing revisions is essentional. There wasn’t any strong project management tools, but getting going, it was extremely usefull. I love the fact that it doesn’t use a database for it’s wiki pages and revisions, but instead plain text. This has always been my love of dokuwiki, and will always make it my first choice for small to medium sized wiki’s.

Redmine is really a plethora of applications rolled into one. It provides Repository integeration, bug ticketing, wiki, forums, customer management (via plugin), and project management tools. We are able to track our time for each project, and with a plugin, see a resources time across all projects. We have a wiki, document section, and file upload for each project. Wiki pages can cross link to other projects, and any one section can refernce another. I.E. a wiki page can reference both a ticket number and a repo revision. We are also able to provide some basic project planning through gantt charts as some of our customers request. Security is strong, and development still seems very active.

We’ve been happy with our initial testing of Redmine, and look forward to really running it thorugh it paces on our next project. I’ve also started installing Redmine at my office as management is now starting to ask for project schedules on some of my long term projects .. woohoo :/. With our personal install, we were able to get LDAP Authentication working with our Zimbra server. At my office, I am trying to get it working with Active Directory. It seems to be working, but is failing on the search. Debugging Ruby is something I am new at .. which is a topic for another post another day!

EDIT::Fixed spelling.

Data Cleansing

Should be enough said, but apperently it isn’t. Yes, I had a dumb user moment, and had a space at the end of one of my inputs. Which the application saved, and passed on to another “plugin” and failed to make the connection, silently btw. The space should of been cleansed out in multiple places, especially a trailing space.

I am pretty sure I learned this in my first year of school, programming 101.

Reminds of a comic .. from xkcd

Exlpoits of a Mom

SHMConfig Enabled Synaptics Through HAL

Finally I got my synaptics drivers to work properly. With the new HAL, you are able to have it hotplug your input devices into X, this means they don’t need to be listed in X. I tested this out on my laptop a few months ago, and it worked. Only problem is I couldn’t pass along the variables for my synaptics touchpad. Well, after months of waiting and research, I finally got it figured out.

I created the file /etc/hal/fdi/policy/11-synaptic-options.fdi, which, in Gentoo, are the user added hal policies, system installed are in /usr/share/hal/fdi/policy/. I then added the following into that file


<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
<device>
<match key="input.x11_driver" contains="synaptics">
<merge key="input.x11_options.SHMConfig" type="string">On</merge>
</match>
</device>
</deviceinfo>

This turns on SHMConfig which allows synclient and gsynaptics to change synaptic settings on the fly. Sadly, in between noticing this taking effect I had moved to a few pre-release applications to get the 3d r500 accelleration with ati drivers. Below are a few application and versions I am running


[ebuild R ] sys-apps/hal-0.5.11-r1
[ebuild R ] x11-base/xorg-server-1.4.99.906
[ebuild R ] x11-drivers/synaptics-0.14.6-r4

Also note, i just notice xf86-input-synaptic-0.15* has been added to the portage tree for the 1.5 prerelease, need to check this out.