dnite’s ‘old’ Blog

For my new blog, head over to http://blog.dnite.org

  • Moved Out!

    Thanks for stopping by my blog! It's been fun over here at Wordpress.com but I've moved to bigger, better things. My new blog is located here! Hope to see you there!

  • Advertisements

Archive for the ‘Ubuntu’ Category

Transmission on Ubuntu Edgy

Posted by dnite on November 16, 2006

I miss my uTorrent. I could (and have) run uTorrent in wine while running Linux, but that just sucks. So I went looking for a better client. I don’t like BitTornado, or the included bittorrent client that comes with Edgy. They’re ugly and I don’t feel like they work very well. So I found Transmission. Transmission is very light weight. Very simple. It just works. I have recently read that some private trackers have banned Transmission, because it does (or maybe used to?) update the tracker more often than it’s suppose to, but unless I see any big problems (which I will report here) I am going to use it because I like it. For those of you who want to use Transmission with Ubuntu Edgy and are ripping your hair out because you can’t find a good repo. Here it is. Took me a while to find it, but I like using the repo, because it gets updated pretty often.

deb http://acorbeaux.free.fr/ubuntu edgy transmission

Add this repo to your /etc/apt/sources.list and then run the following.

sudo apt-get install transmission

There you have it. A up to date version of Transmission. Run it with the following and your all set. The first time you try and open a torrent in firefox after installing Transmission, click the dropdown, select Other and enter the command below with /usr/bin/ before it and it should stick.


Happy bittorrent.. ing..


Posted in Linux, Ubuntu | 5 Comments »

More Ruby on Rails with Ubuntu… (rails.vim)

Posted by dnite on November 10, 2006

UPDATE: I have updated this entry on my new blog at blog.dnite.org. That link is a direct link to the updated article.

I wrote an article not too long ago about installing Ruby on Rails on Ubuntu (Edgy) quickly and easily. The one section I left pretty ‘in the air’ was definitely the IDE. I feel that Linux has the biggest choice when it comes to editor options.

If your using Windows, you’ll probably use RadRails. It’s feature rich. It does everything you need. And windows Java machine just seems to work more efficiently, in my experience, than the ones for linux. If anyone wants to give me some hints to improve my java machines performance, go right ahead. On the mac. You have TextMate. Mac’s also have a lot of options, but from what I’ve heard and seen. Very seldom do you develop Rails applications on a mac without using textmate.

Now, for Linux, you have a variety of things to choose from and I’ve dipped my hands in a few of them. First, I tried RadRails. RadRails is what I used in windows and it was familiar to me. Since it runs on all 3 platforms, I figured I’d give it a shot in Linux. The problem was, that it just seemed a lot slower than it ran in Windows. I’m not exactly sure why this is, but speed and reliability were the reasons I went looking for a better alternative. I did some research and found that some people used jEdit. But getting jEdit to work in Edgy was a chore, do I didn’t even try. gEdit was also another option. It highlights syntax. It can take plugins. It’s a pretty light weight editor. I tried this for a couple of days, but it just didn’t feel right.

Over in the #rubyonrails IRC channel on irc.freenode.net, I heard about vim and a plugin called rails.vim. I’d given vi a try a long time ago. But never a substantial try. It was always really confusing to get into right away. It’s just not like most other editors. But I figured I’d give it a shot anyways. After a week or so of working with Vim and rails.vim, I’m pretty sold. I’m not 100% comfortable with it just yet, but I can definitely see the potential. I find myself hitting ESC and starting to type :wq when quickly editing something in gEdit or something. Rails.vim takes vim a step further and adds a ton of nice Rails features. Here’s what I did to get into and start enjoying using vim in a couple of days.

First and foremost. Make sure you have Vim installed. Pretty simple. The vimtutor command is optional but VERY VERY recommended if you’ve never used vim. Take the half hour to complete the tutor and you will understand vim a lot better.

sudo apt-get install vim-common vim-runtime vim-gnome

Now that you have vim installed, let’s install the vim ruby gem that gives you all the nice syntax highlighting and other cool ruby features. When you run vim-ruby-install.rb, it gives you the option to install to your home folder. I picked this option, so make sure you don’t run this with sudo.

sudo gem install vim-ruby --remote
(select option 1 when it asks where you want to install. /home/username/.vim)

Now you should have Vim installed with some nice ruby stuff. Let’s go ahead and make a startup file to get rid of a few vim annoyances. Create a new file called .vimrc in your home directory (~/.vimrc) and add the following.

set nocompatible
syntax on
filetype plugin indent on
set mouse=a

runtime! macros/matchit.vim

augroup myfiletypes
autocmd FileType ruby,eruby,yaml set ai sw=2 sts=2 et
augroup END

Now, all we have to do is download rails.vim. Head over to rails.vim and download the latest version. There should be a plugin directory and a doc directory in this archive. Extract it to your .vim folder and your all set. The last thing you have to do is enable the rails documentation.

:helptags ~/.vim/doc

With rails.vim installed, you can launch vim from your project directory and have a lot of new functions. If you try :Rmodel user (which tab completes very nicely), it opens up app/models/user.rb. :Rcontroller blog will open up app/controllers/blog_controller.rb. Everything works just like you would expect it to. You can tab complete the commands and the filenames. If you don’t know what file your looking for, leave the filename off and start hitting tab. You’ll just cycle through all the models or controllers or views. :Rextract will take a currently highlighted section of your code, and automatically create a new partial file while replacing the current selection with the render :partial call. Also, if you move the cursor over another controller name or model name or anything similar and press gf, you will open up that file. It takes a little getting used to but it really works. For a completely list of everything that rails.vim can do, type :help rails. There’s a lot you can do.

Hope that helped out some people! Enjoy!

Posted in Linux, Ruby on Rails, Ubuntu, Web development | 10 Comments »

Pretty Widgets for Firefox for Linux

Posted by dnite on October 28, 2006

So.. The switch to Ubuntu has had it’s ups and downs. But one annoyance I had was the un-styled ‘widgets’ in Firefox look like ass. So, I did some research and found that the people in the MacOSX camp seem to care a lot more about this than the Linux camp. There are a few options for MacOSX to make the widgets look nicer. And I found one person who customized it a little bit to work with Linux. I made a couple minor tweaks and repackaged it and am now sharing with all. This version has only been tested with Firefox 2.0, and if your not using Firefox 2.0 yet, I’d suggest upgrading anyways. Download it here! Enjoy!


Posted in Linux, Ubuntu | 1 Comment »

Ruby on Rails on Ubuntu

Posted by dnite on October 24, 2006

This post has moved over to my new home. blog.dnite.org. Head over there for any updates or whatever.

It seems as though all the information for getting a full Ruby on Rails system up and running in Ubuntu is pretty scattered about the web, so I thought this makes a perfect opportunity to go ahead and condense it all in one place. From start to finish.. Here we go..

Install Ruby

First we need to install ruby and a few extra things so we don’t have issues later. just installing ruby will work to some degree, but things will break later.

sudo apt-get install ruby ruby1.8 ruby1.8-dev rdoc ri irb

Install MySQL

A lot of Rails folks like to use sqlite.. i haven’t tested it but I believe that’s as easy as ‘sudo apt-get install sqlite3’. Could involve more steps though. Here’s what I did to install MySQL.

sudo apt-get install mysql-server libmysql-ruby

Then, just to be safe, lets add a password for root.

mysqladmin -u root password NEW_PASSWORD
sudo /etc/init.d/mysql restart

You may want to go ahead and create your databases now, or save it for later…

mysql -u root -p

Install Ruby Gems

Ruby Gems will install a majority of Rails and any other cool stuff we need specific to Ruby. There’s no package of it availiable for ubuntu (as of right now) so you’ll have to download it yourself. The current version as of today is 0.9.0, but make sure that’s the most current version before following the steps below exactly by going to http://rubyforge.org/frs/?group_id=126. If it’s not, then just replace the url below with the url to the most current version.

wget http://rubyforge.org/frs/download.php/11289/rubygems-0.9.0.tgz
tar zxvf rubygems-0.9.0.tgz
cd rubygems-0.9.0
sudo ruby setup.rb

Install Rails

Next it’s time to install Rails. If you followed all the directions till now, it shouldn’t be a problem. I have run into the problem of rdoc spilling out a bunch of errors if you failed to install that. I’ve also read that you have to be in your home dir to perform this step. Not sure if that’s true, but it couldn’t hurt.

sudo gem install rails --include-dependencies

Install an IDE (optional)

You should now have a fully operational Ruby on Rails install right now. The next step would be to choose how you want to work on your web applications. Linux has a whole slew of editors you can use. Vim is a popular choice among the rails novices. If your looking for something a little more user friendly and easy to get into, RadRails is very nice for this. There is no package for RadRails, but lucky enough, RadRails is enclosed in a single folder you can toss just about anywhere and run from there. I extracted it to /opt/radrails and created a small file to run it in /usr/bin… This is all completely up to you. However you feel most comfortable working.

EDIT: I actually did a new piece on using Vim as your ‘IDE’ for rails. Take a look.

Install RMagick (optional)

Another problem I ran into was getting ImageMagick and RMagick installed and working right in ubuntu. If you will be needing photo manipulation support for your web app, use these instructions for installing RMagick.

sudo apt-get install imagemagick
dpkg -l | grep magick

You will see a list of the imagemagick packages that were installed. There should be one that starts with lib and ends with a number. Mine was libmagick9, so below, if you have anything but libmagick9, replace the number below.

sudo apt-get install libmagick9-dev
sudo gem install rmagick

rmagick takes a little while to build. So go grab something to eat or drink.


Looking back, getting Ruby on Rails is not all that hard to do in ubuntu, but having information that was either old or scattered in many places made it a pain in the ass for me. So I hope someone comes across it helps them out a bit. I’m pretty sure I got all the instructions right, but if something happens to not work, leave a comment and I’ll try and help.

It would figure that the first day that wiki.rubyonrails.com is down in.. forever? is the day that I chose to try and install rails on ubuntu myself. Most of this information is up there, but I went ahead and added the last part about image magick there, So check out wiki.rubyonrails.com.. You can get just about anything there. x=)

Posted in Linux, Ruby on Rails, Ubuntu, Web development | 14 Comments »