Monday, January 17, 2011

How to install Kestrel on Ubuntu 10.04

What is Kestrel ?

From https://github.com/robey/kestrel :

Kestrel is based on Blaine Cook's "starling" simple, distributed message queue, with added features and bulletproofing, as well as the scalability offered by actors and the JVM.

Pre-requirements:

In order to install Kestrel, you need to have java, scala as well as sbt installed. I've gathered a few links here and there that explain how to do so. 

Install Java

Follow instructions there : 
http://www.ubuntugeek.com/how-install-sun-java-runtime-environment-jre-in-ubuntu-10-04-lucid-lynx.html

Install Scala:

$ wget http://www.scala-lang.org/downloads/distrib/files/scala-2.8.1.final.tgz 
$ tar -zxf scala-2.8.1.final.tgz 
$ sudo mv scala-2.8.1.final /usr/share/scala 
$ sudo ln -s /usr/share/scala/bin/scala /usr/bin/scala 
$ sudo ln -s /usr/share/scala/bin/scalac /usr/bin/scalac

Instal sbt:

Follow instructions there : http://code.google.com/p/simple-build-tool/wiki/Setup

Install daemon ( http://libslack.org/daemon/ )

$ cd /tmp 
/tmp$ wget http://libslack.org/daemon/download/daemon-0.6.4.tar.gz 
/tmp$ tar -xzvf daemon-0.6.4.tar.gz 
/tmp$ cd daemon-0.6.4 
/tmp/daemon-0.6.4$ ./configure
/tmp/daemon-0.6.4$ make 
/tmp/daemon-0.6.4$ make test 
/tmp/daemon-0.6.4$ sudo make install

Checkout the latest version of Kestrel on github.com

~$ cd /tmp
/tmp$ git clone git@github.com:robey/kestrel.git
/tmp$ cd kestrel
# Build from source
/tmp/kestrel$ sbt clean update package-dist
# enter dist directory
/tmp/kestrel$ cd dist
/tmp/kestrel/dist/$
# copy kestrel folder to /opt/local/
/tmp/kestrel/dist/$ sudo mkdir /opt/local/kestrel
/tmp/kestrel/dist/$ sudo cp -r kestrel-1.2.9-SNAPSHOT /opt/local/kestrel
/tmp/kestrel/dist/$ cd /opt/local/kestrel
# link current version of kestrel to a 'current' link
/opt/local/kestrel$ sudo ln -s kestrel-1.2.9-SNAPSHOT current
# copy startup scripts
/opt/local/kestrel/current/$ sudo cp scripts/kestrel.sh /etc/init.d/kestrel
/opt/local/kestrel/current/$ cd /etc/init.d/
/etc/init.d/$ sudo chmod u+x kestrel
# edit line 21 to pidfile="/var/run/kestrel/$APP_NAME.pid"
/etc/init.d/$ sudo vim kestrel
# verify user permissions are set to user daemon
/etc/init.d/$ sudo chown -R daemon /var/spool/kestrel
/etc/init.d/$ sudo chown -R daemon /var/log/kestrel
# Link /usr/bin/java to /usr/java
/etc/init.d/$ sudo ln -s /usr/bin/java /bin/java
# check kestrel status
/etc/init.d/$ sudo ./kestrel status
kestrel is NOT running.
/etc/init.d/$ sudo ./kestrel start
Starting kestrel... done.
#connect to kestrel
/etc/init.d/$ telnet 127.0.0.1 22133
Trying 127.0.0.1... 
Connected to 127.0.0.1.
Escape character is '^]'. 
STATS 
STAT uptime 185 
STAT time 1295254423 
STAT version 1.2.9-SNAPSHOT 
STAT curr_items 0 
[...]
END

Voila :)

Tuesday, September 7, 2010

Google Logo September 7th.

Today Google's Logo is pretty funny, and so far I haven't been able to click on it :)

I wonder how much time I am going to waste on this today hehe. All I could figure is that it's apparently using HTML 5.

Any more info anyone ?

-- Edit:  just found out that the logo takes around 40% CPU using FF and only 18% using chrome xD

Tuesday, August 31, 2010

GitHub Workflow & Quick Setup


Workflow :


  1. Clone the master version of the app :

    1. git clone git@github.com:username/project.git
  2. If you need to check a different branch than the master, eg : dev
    1. git checkout -b dev origin/dev
    2. type git branch to see which branch you are currently editing. It should now be dev.
  3. When you want to fix a bug the correct workflow seams to create a new branch in the dev branch : 
    1. git branch new_branch
    2. git checkout new_branch  
    3. git branch to see which branch you're in
  4. When your code is ready to be pushed to github :
    1. edit your files eg : vim blah.plop
    2. Add your changes to staging :  git add blah.plop
    3. commit you changes git commit -m 'Message you want to say when you commit #reviewthis @gitusername @maraca email@ltd.com'
      1. By using the tag #reviewthis, it sends an email to the user - only if he has a public email address set up. email@company.com works too.
    4. git push origin master_branch will push your local commits to github.com and request code review to your peer reviews.
  5. Step before merging branch :
    1. Ask your peer reviews for a LGTM (looks good to me). Ask for TAL (take another look) until you get a LGTM.
    2. Fetch data from remote git server : git fetch origin dev
    3. Write unit tests, run them, verify them don't break the code.
  6. Your data is now ready to be merged.
    1. git checkout into the repository you want to merge to : eg dev . git checkout dev
    2. git merge new_branch
    3. Resolved manually all the conflicts if there are any
    4. Commit your data
    5. Tag your merge: eg : v0.2.3
    6. Push your commits and tags
      1. git push origin --tags
      2. git push origin dev


Sunday, April 11, 2010

http://www.pushmyfoot.com

Hi!

After many weeks of hard work, I am proud to release pushMyFoot !
pushMyFoot was designed to allow people who don't have access to a TV to follow the games during the Soccer Worldcup FIFA 2010 !

You can be notified of the latest updates and releases by subscribing on http://www.pushmyfoot.com .

Can't wait to see what you guys think of it !

Cheers,
Martin

Saturday, April 10, 2010

Django i18n not translating

If you are trying to use the i18n functionality of Django, and nothing is happening when you switch language, make sure that your translated files are not in my_django_project/conf/locale/  but in my_django_project/locale/

Martin


Friday, April 2, 2010

Install BugZilla 3.4 on Ubuntu 8.04

sudo apt-get install build-essential

Follow this post : http://ubuntuforums.org/showthread.php?t=1006078

Make sure to configure you cpan with the correct make info -> /usr/bin/make
perl -MCPAN -e shell CPAN> o conf make /usr/bin/make

If you get errors saying can't locate DateTime etc .. install the following :

/usr/bin/perl install-module.pl List::MoreUtils
/usr/bin/perl install-module.pl DateTime::Locale

Done !

Martin

Change the color of ls

Thanks to Phillip Elvis for his useful tips !

The ls colors are controlled by the dircolors command. First, dump the current settings to a file using dircolors:

# dircolors --print-database > ~/.dircolors

Then edit the file ~/.dircolors. This contains all the current settings.

Now edit the ~/.dircolors file. The color you probably want to change is "file". It's set to 00 (probably white). I use 01 (bright white) for that. You can specify a background color too, with xx;xx. The .dircolors file will have instructions in it.

Save the file after editing it. To activate your changes, run dircolors like so:

# eval `dircolors ~/.dircolors`

And then you should have the new colors. Add this line to your .profile if you want these changes every time you log in.

Check the list of colors available there : http://www.cyberciti.biz/tips/where-is-color-of-ls-command-defined.html

Martin