Creating a remote git repository from an existing local one.

This is here to remind me how to create a remote repository if I have an already existing repo and I want to have a backup on a remote server. This is probably only useful if you have a small repo as it will require the copying and checkout of the whole thing.

This first thing to do is create a bare copy of your repository

git clone --bare repo repo.git

Then copy the clone to the remote server

rsync -avz repo.git username@remote_host:/var/repos/

Move the existing code out of the way and clone the remote location

mv repos repos_orig
git clone ssh://remote_host/var/repos/repo.git repo

Finally, check that the new clone is complete and working and remove the original copy.

Posted by neomorphic Thu, 29 Oct 2009 02:48:00 GMT


LG42LH40 Lip-sync problems & how to fix

I just bought one of these televisions (LG42LH40) and everything was fine until I plugged in the HDMI cable. Then the lip-sync problem started to annoy me like crazy. So I googled around and found the following little snippet of advice. It seems to have solved the issue, apart from a little tweaking to get the number set correctly for my particular set. Shame this doesn't show up more frequently on the net as there seem ot be a lot of people having problems getting this working. It also seems that LG tech support doesn't know how to do this either.
LG 42LH40 42-Inch 1080p 120Hz LCD HDTV, Gloss Black 1) press and hold the menu button on the side of the TV then press and hold the menu button on the remote until the display says "Enter Password" 2) enter four zeros from the remote control to get past the password screen (you should now see an "IN START" menu with all kinds of information listed) 4) look at the lower left corner where there should be a numbered menu -- menu option 4 should say "System" 5) use the down arrow until the word "System" is highlighted (pressing the number '4' will not take you down the menu) and press the enter key (you should now be on the System menu near the middle of the screen) 6) press the down arrow to option 9 "Lip Sync Adjust" and then press the left arrow to adjust the value to zero (mine was set to 20 from the factory) 7) press the return key to get out of the menu and bingo, you're done!

Posted by neomorphic Thu, 24 Sep 2009 01:59:00 GMT


subversion/screen conflict

So, it looks like I might have found a bug in either screen or subversion on OS X 10.5.6

I tried to update a checkout of one of my rails apps on my mac mini only to be confronted with the following:

	jody@tiny:~/Code/ruby/old/rsvp$ svn up
	Bus error

I thought this was odd as I have never changed my version of subversion. Then I thought, "have I ever checked out code from a repository while I was in a screen session"? The answer was no, so I quit the screen session and tried again:

	jody@tiny:~/Code/ruby/rsvp$ svn up
	At revision 236.
	

So, it would seem that whatever screen does when I am in a screen session is not compatible with subversion. Now to see if there is anybody out there that will know why this happens.

Posted by neomorphic Sat, 07 Feb 2009 23:29:30 GMT


connectiontimeout time

Apache have released their latest httpd server version 2.2.10. While I am happy to have all the bug fixes that this provides, the biggest bonus for me is the addition of the connectiontimeout directive to the mod_proxy module. This directive allows me to distinguish between the length of time it takes to connect to the proxy server and the length of time it takes to return a response. This is a big deal for my setup as I have a lot of legacy applications behind my proxy that take a long time to return (in the order of minutes). This means that I have never been able to set the timeout on the proxy to less than 2 minutes. Having a high timeout has had a negative impact on the user experience when one of the machines behind the proxy breaks down. If the user is unlucky and the proxy tries to connect to that dead server, then they will have to wait for 2 minutes before the server fails over and they get a response. The connectiontimeout directive allows me to set a really low timeout in the order of 2-3 seconds, greatly reducing the time required for the proxy to decide that the backend machine is not available. Now the user will get a response from a machine that is working within 2-3 seconds instead of 2 minutes. I think you'll agree that is a vast improvement.

Now for the bad news. It would appear that you have to set the connectiontimeout directive for each member of a balancer group as opposed to setting it for the group. So my balancer group that looks like this:

	<Proxy balancer://liveresin >
	  BalancerMember  http://192.168.1.1:8000  route=1
	  BalancerMember  http://192.168.1.2:8000  route=2
	  BalancerMember  http://192.168.1.3:8000  route=3
	  BalancerMember  http://192.168.1.4:8000  route=4
	  BalancerMember  http://192.168.1.5:8000  route=5
	  ProxySet  lbmethod=byrequests stickysession=JSESSIONID
	</Proxy>
	

now looks like this:

	 <Proxy balancer://liveresin >
	  BalancerMember  http://192.168.1.1:8000  route=1  connectiontimeout=3
	  BalancerMember  http://192.168.1.2:8000  route=2  connectiontimeout=3
	  BalancerMember  http://192.168.1.3:8000  route=3  connectiontimeout=3
	  BalancerMember  http://192.168.1.4:8000  route=4  connectiontimeout=3
	  BalancerMember  http://192.168.1.5:8000  route=5  connectiontimeout=3
	  ProxySet  lbmethod=byrequests stickysession=JSESSIONID
	</Proxy>
	

I am unhappy with this as I have to set the same directive 5 times. Would it not be better to set it once in the ProxySet directive and then if needed override it for individual nodes. Maybe this is something that can be added in future releases. Anyway, thanks to the apache team for making my servers that much more responsive.

Posted by neomorphic Thu, 30 Oct 2008 13:20:50 GMT


Aiport Express setup not so 'Express'

I decided to buy an Airport Express today as I really wanted to get the most from my stereo and the remote application (warning: crappy iTunes link) on my iPod touch. A lot of the reviews claim that it is really hard to setup and a lot of them claim that it is really easy. I figured that since I am fairly tech savvy it really shouldn't be a problem. I mean how hard can it be to hook up a network enabled device to my existing wireless network? As it turns out, this device caused me loads of trouble during setup. The difficulty was second only to creating a bridged network between two wireless routers from different manufacturers.

First of all you must make sure that the device is allowed to access your wireless network. This was easy to do and took a few seconds on the admin page for my router. Then install the airport utility, also easy. Finally open the utility and setup your airport express and you are done, or are you....

The first hurdle to overcome was getting the express to show up in the list of devices. Not only would it not show up, it just flashed an annoying amber light at me. For some reason it would not show up in the list, unless I enabled the wireless network on my mac mini. When I finally got it to show up it told me I would have to connect to it directly. Fine, I did that and at last I was at a configuration screen. I had two choices at this point, pick 'manual' setup or hit the 'continue' button. Assuming that apple would do the right thing at this point, I hit continue. A few dialogs popped up asking me how I would like to configure the device and I choose to add it to my existing network as opposed to create a new one. It found my network and entered the WEP key. "All good" I thought to myself, but sadly no. The device started flashing amber again and dropped off the network never to be seen again. This resulted in the application of a paper clip to the reset switch and restarting the airport utility again.

Ok, second attempt. This time, I decided not to trust apple to do the right thing and went for manual configuration, the option I should have chosen in the first place. This time I was allowed to configure the network by hand and make sure that everything worked. I add the ssid, wep key and password then hit the 'update' button. Huraah, it worked and I had a working Airport Express. Now all I had to do was play some music by selecting the speakers from the drop down list on the bottom right of the iTunes window... but there was no drop down menu. There didn't seem to be any advice in the manual so I resorted to searching google for an answer. Finally someone suggested that I need to look in the advanced tab of iTunes and make sure that the 'Look for remote speakers...' option was ticked. Sure enough it wasn't, but ticking it suddenly provided me with a drop down menu. Selecting the speakers and hitting play brought music to my ears.

All in all the Airport Express is a great little piece of kit, but don't even think you are going to have an easy time getting it to work on your network, unless it is the only device providing wireless access, or you own apple base stations. Anyway, I am off to listen to some music in my living room and play with the remote app.

Posted by neomorphic Sat, 06 Sep 2008 23:07:01 GMT


Ignoring the Git

I hate it when I run git status and all those files I don't want in version control show up in the 'Untracked files' list. The obvious answer is to create a .gitignore file, but I really don't want to do it by hand, because it just doesn't seem lazy enough. So, I present to you a way to generate the .gitignore file without having to type any of the file names:
 git ls-files -o --exclude-standard >> .gitignore
The first part of the command will generate a list of all the files that are not under version control and the second part just appends that list to the .gitignore file. Nice, easy and really lazy.

Posted by neomorphic Fri, 29 Aug 2008 02:20:38 GMT


It's my pty and I'll cry if I want to.

Setting up servers inside an etch chroot can lead to some interesting problems. The most recent problem for me happened when I tried to install the perl module IO::Tty. During the test I would keep getting the following error:
chrt:webdev2:~/.cpan/build/IO-Tty-1.07# make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-Iblib/lib" "-Iblib/arch" test.pl
1..4
Configuration: -DHAVE_DEV_PTMX -DHAVE_GETPT -DHAVE_GRANTPT -DHAVE_OPENPTY -DHAVE_PTSNAME -DHAVE_PTSNAME_
R -DHAVE_PTY_H -DHAVE_SIGACTION -DHAVE_SYS_STROPTS_H -DHAVE_TERMIOS_H -DHAVE_TERMIO_H -DHAVE_TTYNAME -DH
AVE_UNLOCKPT
Checking for appropriate ioctls: TIOCNOTTY TIOCSCTTY
Checking that returned fd's don't clash with stdin/out/err...
trying getpt()...
pty_allocate(nonfatal): getpt(): No such file or directory at /root/.cpan/build/IO-Tty-1.07/blib/lib/IO/
Pty.pm line 24.
trying openpty()...
pty_allocate(nonfatal): openpty(): No such file or directory at /root/.cpan/build/IO-Tty-1.07/blib/lib/I
O/Pty.pm line 24.
trying /dev/ptmx...
trying grantpt()...
IO::Tty::pty_allocate(nonfatal): grantpt(): No such file or directory at /root/.cpan/build/IO-Tty-1.07/b
lib/lib/IO/Pty.pm line 24.
trying unlockpt()...
trying ptsname_r()...
IO::Tty::open_slave(nonfatal): ptsname_r(): No such file or directory at /root/.cpan/build/IO-Tty-1.07/b
lib/lib/IO/Pty.pm line 24.
trying to open /dev/pts/3...
IO::Tty::open_slave(nonfatal): open(/dev/pts/3): No such file or directory at /root/.cpan/build/IO-Tty-1
.07/blib/lib/IO/Pty.pm line 24.
pty_allocate(nonfatal): open(/dev/ptmx): No such file or directory at /root/.cpan/build/IO-Tty-1.07/blib
/lib/IO/Pty.pm line 24.
trying BSD /dev/pty??...
Cannot open a pty at test.pl line 42
It turns out that this is due to the /dev directory not being configured correctly. The solution was not easy to find, so I shall post it here along with a link to the post that provided me with it, in the hopes that it will get bumped up the search listing. The answer, well there are two.
      	
      	cd /dev
      	./MAKEDEV pty
      	
      This creates a bunch of pty entries in /dev that can then be used when required.
      	mount -t devpts -o rw,gid=5,mode=620 none /dev/pts
      	
      This will mount /dev/pts and allow processes to create their own tty as needed.
I went for the 'MAKEDEV pty' option as I didn't want to mount /dev/pts everytime the machine was rebooted. So, there you have it. Now you wont cry when your pty isn't going the way you want it to.

Posted by neomorphic Thu, 21 Aug 2008 20:37:00 GMT


Blogging from TextMate

I don't know about you, but I don't really like editing my blog posts in the default text area that comes with most blogging software. They provide a rich text interface through some clever javascript, but it doesn't really feel right. As a programmer I want to be able to use my editor of choice. That would of course be vi. However, as I can't be bothered to try and figure out the magic runes involved in getting vi integrated with my blog, I thought I would try out TextMate. It has a bundle all ready to go. You just need to configure the xmlrpc location of your blog and fire up a new window. For those that need a little help getting started, there is a nice screencast on the TextMate blog. Once you have a new window open, you just write your post and upload it to your server. At least I hope so. Did this make it to your feed reader :-)?

Posted by neomorphic Mon, 18 Aug 2008 11:32:59 GMT


Typo Filters

I have been using typo for a while now and noticed that others had managed to get syntax highlighting working in their blog, but I couldn't find out how from the man pages. As per usual, a quick look on google has turned up the goods. For a quick review of the filters that you can use to format your text in typo, have a look at Scott Laird's article entitled 'Introduction to Typo filters'.

EDIT: I just found some help documentation for the text filters buried within the admin interface at http://yourblog/admin/textfilters

Posted by neomorphic Mon, 18 Aug 2008 10:16:00 GMT


Getting GitHub working with a new repository

So I thought I would try out git and github and see what all the cool kids are talking about. The initial setup was really easy. I got my first repository setup within minutes and was committing without any problems. Then I created a clone on my laptop and continued working. The problem arose when I tried to get this work back into the central repository and then back to my desktop. The git push was fine, but the git pull kept failing giving me the following:

neo$ git pull
You asked me to pull without telling me which branch you want to merge with, 
and 'branch.master.merge' in your configuration file does not tell me either.
Please name which branch you want to merge on the command line and try again 
(e.g. 'git pull &lt;repository&gt; &lt;refspec&gt;'). See git-pull(1) for details on the refspec.
If you often merge with the same branch, you may want to configure the following 
variables in your configuration file:    
branch.master.remote = &lt;nickname&gt;
branch.master.merge = &lt;remote-ref&gt;
remote.&lt;nickname&gt;.url = &lt;url&gt;
remote.&lt;nickname&gt;.fetch = &lt;refspec&gt;

Having a quick search around the net, told me that I needed to update only the branch.master.remote and the branch.master.merge. Since I am merging with the 'origin' branch, I run:

neo$ git config branch.master.remote origin

Then to get the merge to work correctly I set the following:

neo$ git config branch.master.merge refs/heads/master

This tells git to merge the remote changes into the master branch. Once done a simple

neo$ git pull

should do the trick.

Posted by neomorphic Mon, 07 Jul 2008 02:00:00 GMT


Older posts: 1 2


weewar.com corner