M-x Kelsin

Posts

Bash Completion in OS X

Date
Friday, January 22, 2010 at 12:13 pm
Tags
bash apple os-x

I realized today that I don't have bash completion turned on in OS X. A quick search for the file I'm used to in Ubuntu (/etc/bash_completion) didn't turn up anything. I quickly found that bash_completion is available in mac ports (which I use a lot). I quickly ran "sudo port install bash_completion". The text that was printed after the install advised me to put a line into my start files which I added into my bashrc. Now bash completion works great.

An easy way to check if you do have bash completion turned on is to try and autocomplete a directory name after typing cd on the prompt. For example, in my ~/Documents folder I had one file and one directory starting with M. If I type "cd M" and hit tab I will see the file and the folder if I don't have completion and only the folder if I do.

Rewriting Commit History

Date
Thursday, November 19, 2009 at 10:04 am
Tags
git

Recently at work I was working on a small bug fix git branch that had MANY small commits doing relatively the same thing. I really wanted to go through and clean up the commit messages to make them uniform and actually needed to change some of the commits too.

By google searching I found this stack overflow question that gave me my answer. This user wrote about how using git rebase --interactive can be used to specify any number of commits to edit. You basically call git rebase --interactive COMMIT where COMMIT</code> can be <code>HEAD^ to just do one commit, or any SHA1 or branch reference as normal. Git will open your $EDITOR with a file listens all commits in question. You can then edit this temporary file to tell git what commits to let you edit and which ones to drop completely or merge into the commit above them (which you can do manually via edit as well). Then git will play through your commits that you've said you want to edit one at a time, and drop you into a shell to let you do anything you want. Sometimes you want to edit just the commit message so you just git commit --amend and change the message. Other times you want to undo the last two commits and redo them git reset HEAD^^ and then edit and commit again.

Also just to remember this (recently discussed at work as well):

# undoes the last commit and places changes as changes
# in the working tree.
git reset HEAD^

# removes the commit changes completely (not form the git
# data store, but completely from your working tree at least)
git reset --hard HEAD^

# puts the changes into a "staged" state. This makes it
# east to add to a commit while you have many other edited
# files in your tree (Maybe even more changes to a changed
# file that you don't want to add into this commit)
git reset --soft HEAD^

Demon's Souls Mini-Review

Date
Tuesday, October 13, 2009 at 8:34 am
Tags
games ps3 rpg

I've only played the first level of Demon's Souls so far but it's very fun.

I started a Knight Templar and Caitlin started a Thief. Both play very differently and start with different gear / weapons. It's very clear that the many pre-reviews of this game that talked about the weapon system being fun were pretty accurate.

So far the graphics have been great, the game play is great. The game IS HARD. You die a lot on your way to figuring out how to beat obstacles. I had to give in to some of my OCD and just realize that this was part of the game. The game is made with the idea that you WILL lose all of your souls multiple times while trying to play a level. In a sense the game can be thought of as a Japanese shooter in disguise. You practice and practice at the levels until your skill at the game improves and is able to play it flawlessly. It's awesome!

Instant PhpBB3 Speed Improvements

Date
Friday, October 2, 2009 at 6:47 pm
Tags
debian server php

Recently at work we've installed a php accelerator onto one of our php apps. We were having load problems on the box (Moodle installs) and the accelerator helped solve the problem. This got me thinking and I decided to install an accelerator on my Linode in order to speed up my World of Warcraft guild forums (a phpbb3 install)

After doing some reading I decided to try out Xcache. I don't have ANY opinions on which accelerator is better (this isn't the one we chose at work for Moodle). I chose this one for the SOLE reason that Debian Lenny had it in the repository. Installing it was DEAD simple:

sudo aptitude install php5-xcache
sudo /etc/init.d/apache2 restart

Can't get any simpler. Now my phpbb forum pages load INSTANTLY. It's absolutely amazing and awesome.

This is making me want to move this blog over to the Linode very fast!

Irssi with Growl

Date
Wednesday, September 23, 2009 at 11:24 am
Tags
irssi os-x

Theres been a lack of posts recently, going to try and correct that but for now here's a small tidbit I just figured out.

I like using irssi for irc but wanted to get a mac notification when I receive a message with my nick in it. So the obvious choice here is to use Growl to handle the notification.

I installed irssi from MacPorts and don't go into detail here about installing MacPorts. It's pretty easy and their website goes through a lot of it.

First step was installing Growl and the perl bindings. You need to install Growl from their site and also download the SDK from the developer section. This is the package that mentions language bindings. Once you get the bindings downloaded you'll need some perl packages in order to install them. You can copy the Mac-Growl directory to a writable location and then run the commands below:

sudo port install p5-mac-glue
sudo gluedialects
sudo gluescriptadds
cd directory/where/you/copyied/Mac-Growl
perl Makefile.pl
sudo make
make test
sudo make install

Git Ignoring already committed (tracked) files

Date
Wednesday, August 5, 2009 at 12:12 pm
Tags
code git

In my current local development environment for work I don't have access to our authentication mechanism. Our rails site uses a cookie from our main site. In order to ignore this I commonly edit my controllers with a line like:

self.current_user = User.find(5)

(This is just a snippet and doesn't include the code that allows for the current_user method, this post is NOT about authentication in rails). This allows me to just work on features without having to do some complicated cookie copying and other stuff I'd rather not mess with.

I use magit on emacs to do my git management and I hate seeing that this controller has a change in it (same with using "git-status"). I don't want to accidentally commit this change either. The simple answer to this is to tell git to mark this file as "not changed". I found this post that told me about this feature. This feature exists in order to help people with slow filesystems but it works great for this use as well:

$ git update-index --assume-unchanged path/to/file

Now the files don't show up in any status commands or when I commit with "git commit -a". These files will cause git to gracefully error when merging in a branch that changes these files (so you can manually handle it) and it will remove this flag if you manually "git add" these individual files.

The problem I ran into is that I want an easy way to check what files are setup like this. I couldn't find a git command to do this already so I added these aliases:

[alias]
    marked-unchanged = !git ls-files -v | grep ^[a-z]
    mu = !git ls-files -v | grep ^[a-z]

Now both "git marked-unchanged" and "git mu" show me a list of files that are set this way so I don't forget. I want to add magit commands to show this and set this as well but that will be another day and another post.

Blue Man Group and then Midatlantic!

Date
Monday, July 13, 2009 at 10:28 pm
Tags
music concert review

So I finally got around to seeing Blue Man Group and I really enjoyed it. I did feel that some sections especially in the beginning were a tad slow. I would have liked to have seen more comedy or music in exchange for some of the drawn out segments. I did enjoy the show a lot however. It was a lot more on the "artsy" side than I originally though it would be. I enjoyed that aspect of it a lot. I felt it had a very nice my-first-artsy-theater-show ring to it.

After the Blue Man Show we ate some dinner at Pizza Pie-er before heading over to the Paradise Rock Club to see some co-workers perform in their band Midatlantic. I have seen them twice before (Once at Great Scott's and once opening for Letter's to Cleo at the Paradise as well) but this was my first time seeing them with a new drummer and new keyboard player (both co-workers of mine).

Their set was pretty tight. I do have to admit that I really like "Fly Me Home" off their first album (when they were stilled called "The Bleedin Bleedins") and was disappointed to not hear it. It's one of those songs where even after the show two nights ago, I left humming Fly Me Home instead of one of the songs performed. But enough about me loving pop hooks, their show was really good.

They have an interesting sound that relies on a lot of electronics. I think one of the reasons I enjoyed them is that guitarist Barry Kelly (fair warning: also a co-worker) doesn't play guitar like most other bands I go see. His parts provide nice counter melodies and licks that work well with the vocal lines instead of providing a rhythmic base. They rely on their electronic parts (as well as bass) for that. Seeing them with a keyboard player was great cause it humanized that part of the show. While it has always been a great part of their sound, it can continue into a great part of their live show as well. It verged on the line of "backing track" before and now that feeling is gone (at least for me).

The new drummer is great and the band doesn't sound like they've skipped a beat with any of these new changes. I liked all three new songs they performed so definitely excited to hear more material and see what ends up on a new album. Having seen the drummer (Rob Fusco) and keyboardist (John Mileham) in their previous bands I know what each can do and I'm excited to see what some of their influences brought into Midatlantic. I definitely wish I could see them over in Ireland later this year!

Nxml for ERB

Date
Wednesday, July 8, 2009 at 8:35 am
Tags
emacs ruby-on-rails

Being unsatisfied with most erb solutions in Emacs I've been using nxml-mode for editing erb and just dealing with it complaining about erb sections. I love nxml-mode for xml/html in general and don't like doing any editing without it.

I've tried using MMM or MoMaMu or whatever it's called that's included with nxhtml mode and it just doesn't do it for me. YA-Snippet with Nxml mode is plenty for me.

Recently I found a blog post that makes sense to try out: More Valid Than You

Since I compiled Emacs custom for Mac OS X (If I haven't blogged about that I need to!) it was easy to apply that patch to my source tree and compile it.

This at least makes Nxml-mode not hi-light every erb section as invalid. It still chokes sometimes but it's much better. If I move to anything else I'll blog about it :)

The Franklin Kite: Explosions and Batteries

Date
Tuesday, July 7, 2009 at 8:42 am
Tags
boston music recording zendrum

Last night I went to the CD release party for a co-workers band: The Franklin Kite. Their new EP "Explosions and Batteries" is available on iTunes (search "The Franklin Kite") and Amazon for those that are interested.

Explosions and Batteries

My co-worker asked me to help record some drum parts on my Zendrum and of course I couldn't say no. I loved their first EP a lot and was excited to be able to do some music again. I played one of the 3(?) drum tracks in Antoinette and provided the drums from around 2:26 till the end on Pilot. The main reason he asked someone to come in and play is that he wanted some fills on the end of Pilot. The result was pretty awesome. The parts have been edited, I just slammed on my Zendrum for a while and John edited out some bad spots and did some arranging of the parts. I was really happy with the results. Seeing the concert last night definitely makes me want to record some songs this weekend!

Overall I'm very glad I got to be a part of this EP since I'm a big fan of the music. I'm enjoying every song on it and can't wait to hear what these guys come up with next!

Git Push Defaults

Date
Tuesday, July 7, 2009 at 8:34 am
Tags
computer git

Recently I've began working locally on my macbook and have installed git 1.6 from the binary package. I haven't noticed anything different from my work servers (v1.5) and my new 1.6 locally except for push defaults. Git likes showing this huge warning about how you can change the way push works now. It does the same thing as it has done previously, just with a giant message about how you can change it if you want.

I found more information about this here: git config push.default matching

After reading that helpful post I decided to set my git config globally:

git config --global push.default tracking

If anyone knows more about this stuff I'd love to hear opinions about tracking vs current. Basically I've pushed things I haven't wanted to push yet with the default "matching" option. I like most git operations to only function on my current branch (especially when dealing with pushing). Current seems to provide that but it will push the current branch to "a branch of the same name" according to the man page of git-config. Tracking says it pushes the current branch "to its upstream branch" which seems more correct to me since I might have tracking branches with different names. I'm hoping that git will complain if I call git push with no arguments on a branch that isn't tracking a remote branch.

Tags

apple bash blog boston bug calendar code computer concert debian emacs email firefox food games git google haskell heroku htmlize intel-i810 iphone irssi keyboard linux music mutt os-x php plugins programming ps3 recording review rpg ruby ruby-on-rails server sinatra sync ubuntu ups wedding widgets wordpress work wow xbox360 xmobar xmonad xorg zendrum

RSS
Valid XHTML 1.0 Strict