Wednesday, May 27, 2009

Sometimes it's the simplest things...

I pulled a svn repository (containing a ton of projects) onto a local filesystem using git-svn and wanted to run "git gc" on each project to see how much space I could free up. (1.1GB down to 800MB btw) - sure I could do it by hand or write a quick script, but how about one line on the CL?
for d in `ls -D`; do cd $d; git gc; cd ..; done
(Those are backticks by the way)

Tuesday, May 26, 2009

Installing RoR on Ubuntu 9.04

Mainly because I always forget... here's the quickest way to get Rails installed on a fresh Ubuntu box.
First, grab everything you need to install the native gems. Then most of the ruby stuff and mysql (it will ask you to choose a root password - don't forget what you pick)
sudo apt-get install build-essential
sudo apt-get install ruby ri rdoc mysql-server libmysql-ruby ruby1.8-dev irb1.8 libdbd-mysql-perl libdbi-perl libmysql-ruby1.8 libmysqlclient15off libnet-daemon-perl libplrpc-perl libreadline-ruby1.8 libruby1.8 mysql-client-5.0 mysql-common mysql-server-5.0 rdoc1.8 ri1.8 ruby1.8 irb libopenssl-ruby libopenssl-ruby1.8 libhtml-template-perl mysql-server-core-5.0 libmysqlclient-dev
Next, grab the latest rubygem from Rubyforge (http://rubyforge.org/projects/rubygems/)
wget http://rubyforge.org/frs/download.php/56227/rubygems-1.3.3.tgz
tar -zxvf rubygems-1.3.3.tgz
cd rubygems-1.3.3
sudo ruby setup.rb
At this point, do:
gem -v
Since this is a fresh install, you'll probably see something like:
slotito@ubuntu-desktop:~/rubygems-1.3.3$ gem -v
The program 'gem' can be found in the following packages:
* rubygems1.8
* rubygems1.9
Try: sudo apt-get install
bash: gem: command not found
If you do, create some symlinks:
sudo ln -s /usr/bin/gem1.8 /usr/local/bin/gem
sudo ln -s /usr/bin/ruby1.8 /usr/local/bin/ruby
sudo ln -s /usr/bin/rdoc1.8 /usr/local/bin/rdoc
sudo ln -s /usr/bin/ri1.8 /usr/local/bin/ri
sudo ln -s /usr/bin/irb1.8 /usr/local/bin/irb
Ok, now for rails and some goodies =)
sudo gem install rails
sudo gem install mysql
sudo apt-get install imagemagick
sudo gem install rmagick
sudo gem install mongrel

Wednesday, May 6, 2009

Installing AIR on Ubuntu 9.04

Go to http://get.adobe.com/air and download the bin file.
cd to whatever directory you downloaded the file into.
chmod 755 AdobeAIRInstaller.bin
sudo ./AdobeAIRInstaller.bin
It will pop up an installer program, click 'Accept', wait for it to finish and click 'Finish"
You're done, easy.

Getting gitjour working with Ubuntu

So... I'm attending railsconf2009 and EVERYONE is abuzz about gitjour so I figured I'd take a look at it. Only problem, it doesn't install out of the box on Ubunutu, you need to add some libs.
me@laptop:~$ sudo gem install dnssd gitjour
Building native extensions. This could take a while...
ERROR: Error installing dnssd:
ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb install dnssd gitjour
checking for DNSServiceRefSockFD() in -lmdns... no
checking for DNSServiceRefSockFD() in -ldns_sd... no
can't find rendezvous library
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.
I couldn't find any resources on how to fix it, so here it goes:
me@laptop:~$ sudo apt-get install avahi-daemon avahi-utils libavahi-compat-libdnssd1 libavahi-compat-libdnssd-dev
me@laptop:~$ sudo gem install dnssd gitjour
Super easy, but couldn't find the solution anywhere... enjoy!

RailsConf 2009