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



weewar.com corner