MPOV

my point of view (programming stuff mostly)

Tulsa Ruby Workshop

We're gearing up for the upcoming, very first Tulsa Ruby Workshop.
Media_httpmpovwordpresscomfiles200803picture1thumbnailpng_affkbrinbcsagpv
Of course, all you need to know is on the website, but in short, it's a beginner's conference all about Ruby and Rails. If you're new to Ruby and/or Rails, this is for you (if you're in or near enough to Tulsa, Oklahoma that is). Tell everyone you know!

OneBody: Using Git

I still plan on writing the final part in the Git series on this blog, but in the meantime, on a related note, we now have a page up on the OneBody wiki about Using Git. It includes some instructions for using Git on Windows and some other commands that may be helpful to noobs.

FireFox 3 Beta

Oooo I really like the new Firefox 3 beta. It's zippy and it looks great.
Media_httpmpovwordpresscomfiles200803chromepng_wjzutyiebytivod
My only beef was the new fancy address bar... Being an uber web geek, I tend to recognize things by their URLs instead of page titles, so this was slowing me down to much:
Media_httpmpovwordpresscomfiles200803addressbarpng_ffintioqovgytrd
So, to get things back all barebones FF2 style, I installed this and set browser.urlbar.matchOnlyTyped in about:config to true. Much better.
Media_httpmpovwordpresscomfiles200803addressbar2png_hrvbzgbaoxwvxtx

Rails Routes Weirdness

Just to save you a half-hour of your life, I thought I'd share that you should never create a named route called "directory" -- it will break Rails migrations and other rake tasks in mysterious and hard-to-track-down ways.

Git for People Who Know Svn, Part 2

For Part 2 of our 60-second Git tutorial, we’ll look at some super simple branching and merging.

git branch tells you which branch you’re on.

git branch -a lists all branches, even remote ones.

git checkout mybranch checks out the branch you want.

git checkout -b newbranch creates a new branch from the one you’re on, and checks it out for you.

git checkout master && git merge mybranch merges changes from one branch to your master branch. If you don’t yet want to commit the changes, you can do git merge --no-commit mybranch instead.

So far, we’ve only talked about local git usage. Isn’t it cool that you can do so much without even having a server set up with our repo? I think so.

Part 3 will include pulling and pushing your changes to remote repos.

Update: Yeah, ok, so I never got around to writing part 3. Back when this was written, super simple Git how-tos were less plentiful. Now, we have git-scm.com, Why Git is Better than SVN, and of course GitHub’s help site.

Git for People Who Know Svn (Things I've Learned, Part 1)

First, the mental hurdles:You don’t need a server to have a git repository. All your commit history is available locally and quickly, with simple commands. Same with branches and tags. Git “checkout” and “commit” are commands you run locally. Svn “checkout” and “commit” are really more like “pull” and “push” with git.

Now, the commands:

rails myapp && cd myapp && git init && git add . && git commit -a creates a repo and makes the first commit (but still nothing is sent to any server; all work is done locally in your own repository)

echo "my app rocks" > README && git add README && git commit -a makes another commit

git rm path/to/remove && git commit -a

git reset --hard HEAD returns your repo to last committed state (warning: cancels working changes) I’m still fighting with this one. It seems the best way might be to do a git checkout -f instead.

That’s it for the first part. Part 2 will be next.

Advanced Ruby on Rails

I've been reading the book Advanced Rails by Brad Ediger. I first met Brad way back in 2006 when we were first trying to get our local Ruby user group going. He is a very smart fellow, and his newest book is definitely evidence of that. There's a lot in there that's over my head, but that's nothing a few rereads can't solve. :-)The book has everything from optimization to deployment, from security to metaprogramming (my brain is still spinning from that one). Brad does an awesome job of including plenty of code and real-world examples.If you use Ruby on Rails for fun or profit, this book is definitely a must-buy.And, believe it or not, this something-other-than-perl-and-php book can be found in local bookstores (Brad V. found this one at the Tulsa 71st B&N):
Media_httpmpovwordpresscomfiles2008022thumbnailjpg_nctjdfrtkedjaim

OneBody Blog

OneBody now has a real, bona fide blog of its own. Thanks to WordPress.com, creating a new blog is waaaay too easy, evidenced by the fact that I now have 37 (just kidding).

Our little project continues to grow and improve. I’m still waiting on that influx of talented, eager volunteers to make it awesome, though :-) For now, it will continue to be Tim’s pet project, though I refuse to stop referring to the development “team” as “we” and “us.”

Google Search Everywhere Except a Site

Just saw this in my referrer logs… You can search on Google for all occurrences except in a certain site.

Many know about adding site:timmorgan.org or similar to only search within a certain domain. Well, maybe it was obvious, but now I know you can do -site:timmorgan.org to search everywhere but that domain. Nice.

Backup Your Gmail Account Messages With Ubuntu and Fetchmail

Long title, I know. Here’s how I did it…

1
2
3
sudo apt-get install fetchmail postfix
cd ~
vim .fetchmailrc

Add the following to the file (replacing everything in CAPS appropriately):

1
2
3
poll pop.gmail.com with proto POP3 and options no dns
  user 'YOUR_GMAIL_ADDRESS' there with password 'YOUR_PASSWORD' is 'YOUR_UBUNTU_USERNAME' here
    options ssl

Now:

1
2
chmod 710 .fetchmailrc
sudo vim /etc/crontab

Add the following to your crontab file:

1
10 7 * * 1 YOUR_UBUNTU_USERNAME fetchmail -k

This will run fetchmail every Sunday and grab your email. It seems either fetchmail or gmail limits each connect to something around 400-500 messages, so to get started, you can run fetchmail -k a few dozen times to download all your mail, then let crontab do the rest on a weekly basis.

Your mail is downloaded to a single mbox file in /var/spool/mail/YOUR_UBUNTU_USERNAME. Being a single file makes it nice for backing up, moving, etc. I hear Thunderbird can easily read the file, and I think Apple’s Mail.app can as well.

Just makes you feel good having all your mail backed up, now doesn’t it?