Twitter Updates

Wednesday, 29 October 2008

ruby flick-1.0.2 gem and rake docs

When running 'gem server' flickr-1.0.2 gem did not have any docs available (on OS X10.5 at least). So to add the flickr rdoc into the gem server :

find the location of your gems, you can use locate.
$locate flickr

$cd /Library/Ruby/Gems/1.8/gems/flickr-1.0.2
$rake rdoc
/Library/Ruby/Gems/1.8/gems/flickr-1.0.2/doc/* /Library/Ruby/Gems/1.8/doc/flickr-1.0.2/rdoc

Now start the gem server and the rdoc link should be active.
$gem server

Tuesday, 28 October 2008

Display command output from bash script

To directly display the output from a command in a bash script (do not forget to set executable on the file $chmod u+x Where is the name of the script file.


#List home directory (note the back ticks)
echo `ls -l ~`

#Store command output as a variable
i=`ls -l ~`
echo $i

Sunday, 26 October 2008

Ruby Gems & gem_server

The default Leopard Ruby installation does not include the gem_server by default.
NB: it is now called gem server (no underscore)

I performed a gem update then the gem server worked.
$ gem update --system

$ gem server

gems are Ruby libraries that add functionality to the basic install.

Some gems require you to build the documentation. in this case cd to the gem location and call
$rake docs
$rake rdocs

you can view a gems doc directly by pasting the gem docs folder into your web browser.

Thursday, 23 October 2008

.bashrc history tips

Some usefiul lines in my .bashrc

#Reload Bashrc
alias reload='source ~/.bashrc'

#Save history correctly when using multiple terminals
# Dont save duplicate lines or blank lines in to history
export HISTCONTROL=ignoreboth
export HISTSIZE=1000
#Append changes to history instead of overwrite full file
alias exit='history -a && exit'

An alternative to the line above is
# make it append, rather than overwrite the history
shopt -s histappend
Advantages of the alias exit it will group the output of each terminal in the history file, rather than a all terminals adding there input on the fly.

Wednesday, 22 October 2008

Linux Flickr command line(broken)

Installing a linux flickr command line uploader

$ cd ~/Bin
$ wget
$ tar -xvz FlickrUploadr-1.0.0.tar.gz

could not find the pyhton xmltramp package under apt get so had to manually add it

$ cd /usr/lib/python2.5/site-packages/
$ sudo wget

Now to configure the uploader
$ cd ~/Bin/FlickrUploadr-1.0.0
$ sudo python install

Now Run Uploader
$ Uploadr
and WHOO Segmentation fault just what I wanted. But I was calling it from a no Xwindow terminal.

Any way my flickr page

Monday, 20 October 2008

MS Visio Block Connection Points

In Visio it is easy to move and add extra connection points to an object.

Just select the 'Connection Point Tool' from the drop down menu next to the normal arrow tool.

You can then click and drag the pre-drawn connection points or CTRL-Left click add new connection points

Friday, 10 October 2008

rtorrent Views

I just discover views in rtorrent. My favourite terminal torrent client.
Just pressing keys 1-7 will show different sorted/filtered lists of your torrents.

Original source

1: Main (sorted by name but new torrents are added to the bottom of the list)
2:Name (alphabetical I think)
3:Started (a filtered Name)
4:Stopped (a filtered Name)
5:Complete (a filtered Name)
6:Incomplete (a filtered Name)
7:Hashing (a filtered Name)