Daniel Insley

This is my personal blog. I enjoy mountain biking, gaming, music, and playing around with new technology. I currently work for Viviti.

All blog posts from March 2008

Installing Git on CentOS 4.6

Posted on March 29, 2008 at 06:29PM

I currently have a VPS that has CentOS installed and went to install Git via Yum, but it didn't seem to have it in the default repos. I've tracked down the following repos and you just need to follow the steps below and git will be installed in a snap:

 $ sudo touch /etc/yum.repos.d/atrpms.repo /etc/yum.repos.d/dag.repo

And then you need to copy the following repository definitions into their respective files:

[atrpms]
name=ATrpms for Enterprise Linux $releasever - $basearch
baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/stable
enabled=0
gpgcheck=1
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms

[dag]
name=Dag
enabled=0
baseurl=http://dag.freshrpms.net/redhat/el4/en/$basearch/dag
http://ftp.heanet.ie/pub/freshrpms/pub/dag/redhat/el4/en/i386/dag/
gpgcheck=1
gpgkey=http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt

Once this is done all you'll have to run is the following command and git will be installed:

$ yum --enablerepo=dag --enablerepo=atrpms install git

Ruby standard out piping problems on Ubuntu

Posted on March 29, 2008 at 06:25PM

I've been having problems where the output of binaries was not being redirected properly from within Ruby when invoked as followed:

  >> `ls -l &> /dev/null`
  => "total 4 drwxr-xr-x 2 dinsley dinsley 4096 2007-05-08 20:00 Peepcode - Rest"

If the shell supports this piping convention, it should return the following:

  >> `ls -l &> /dev/null`
  => ""

Ubuntu currently ships with the '/bin/sh' symbolic link pointing to '/bin/dash' with the reasoning that it executes scripts somewhat faster than bash. There are some drawbacks to this. One of these is that stdout redirection of output from the binary will not be redirected to /dev/null if redirecting it via &>, as it isn't supported in dash.

To fix this, all you need to do is remove the existing symbolic link to dash and replace it with a link to bash instead:

  $ sudo rm /bin/sh
  $ sudo ln -s /bin/bash /bin/sh

TinyMCE syntax highlighted code editor

Posted on March 29, 2008 at 02:01PM

We're currently using the super-improved TinyMCE version 3.0rc1, which apparently has gone through an entire rewrite for the 3.0 release. Aside from making TinyMCE incredibly faster and more efficient, they also implemented an awesome API for easily creating plugins. I decided to test the new API out with an improved code editor that utilizes Codepress.

Image

You can click on the above screenshot to see it in action. I've packed the full Codepress download into the plugin. There was some minor modifications made to the Codepress javascript for styling the iframe, but you should be able to easily drop in an upgraded version without too much of a problem.

I've only been able to test this in Firefox 2.0.0.11, so if you have any problems with any other browsers please leave a comment and I'll try and sort them out. There's only really one other thing I'd like to add to the plugin and that's the ability to wrap the text. There's currently a feature request on Sourceforge for code wrapping inside of Codepress, so maybe I'll poke around and see if I can implement it and submit a patch back to them.

For any problems with the code editor itself, you should contact the authors of Codepress. If there's any problems with the plugin itself then feel free to leave a comment.

The plugin will only work with 3.0rc1 or greater.

Download: advcode_0.1.tar.gz

Displaying all 3 posts


powered by viviti

danielinsley.com