Running a Makefile in Parallel

Programming

December 19, 2011

Tags:

When you have a large makefile, it can take hours for it to finish. One way to speed up the execution of a makefile is to run it in parallel.

The -j <# of jobs> option specifies the number of makefile recipes to be executed in parallel.

For example,

make -j 10 all

This runs 10 makefile recipes at a time. I have experienced up to an 80% improvement in turnaround time with this option!

Installing RPM’s on a jailed shell

Programming

December 15, 2011

If you have access to a jailed shell and want to install an RPM to a local directory then here’s how.  This method works for relocatable and non-relocatable RPMs.  I used this method to install gcc on my shared web server.  I only have jailed shell access on this server so I had to find a way to get a GCC installed somehow.

  1. Create installation dir:
    mkdir gcc_install; cd gcc_install
  2. Download the package:
    wget ftp://rpmfind.net/linux/fedora/linux/releases/16/Everything/i386/os/Packages/gcc-4.6.2-1.fc16.i686.rpm
  3. Convert to cpio archive and extract it:
    rpm2cpio gcc-4.6.2-1.fc16.i686.rpm | cpio -idv
  4. Run it locally!

Dynamically opening files in Vim

Programming

December 13, 2011

Tags: ,

A lot of times I have a need to dynamically open files in Vim.  For example, I want to open all of the files that contain the word “html”.

Here’s a neat way of doing that in Vim:

vim `find . -name “*” | xargs grep -l html`

Note the use of backticks. This works well for me!

The Name of the Wind

Books

March 18, 2009

It is likely that I would have never heard of The Name of the Wind if it wasn’t for GRRM’s live journal post where he compared his long delay in writing his next ASOIAF novel to Patrick Rothfuss’s equal struggles with his sequel to The Name of the Wind.  As soon as I entered Patrick’s site, I realized that he had already published a novel, a fantasy novel that was supposedly quite epic.

So, I decided to take a look at the The Name of the Wind’s amazon page to get a feel for the overal consensus of the novel.  Surprisingl, most reviewers and including one fantasy author had given the book very good ratings.

That was all I need.  The next day I was fully engrossed by Kvothe’s life story, his ups and downs, his struggles and his perservernce.  Patrick Rothfuss created a realistic character, one who had a myriad of problems, but who was also gifted and a geniune hero.    Unfortunately, The Name of the Wind is the first of a trilogy and the book did end slightly abruptly, with many questions that remained unanswered.  However, from the Author’s point of view, this may be a good thing as I’m eagerly anticipating the second novel.

F.E.A.R 2 Review

Games

March 18, 2009

Ever since the release of FEAR 2′s demo, I have long been anticipating the full game.  I was finally able to give the game a roll this week-end.  For the most part, I found the game to be a good experience.  Unfortunately, after having played high calibur games like Dead Space and Gears of War 2, I felt that FEAR could have been a bit better in almost area.  That does not mean to say that the game was horrible, because it wasn’t.  It was a enjoyable experience, but the same experience could have been done 3 years ago.  As the times change, games and expectation evovle.  FEAR 2 did not evolve that much.

Back to basics

Programming

January 1, 2009

The Nintendo DS is a pretty cool piece of hardware.  I didnt know much about until early this week when I decided I wanted to start learning how to create homebrew programs for the DS.  My findings revealed that the DS has two processors, an ARM7 and an ARM9 chip.    The architecture seems really weird at first and a bit daunting but the more I read about it, the more everything is starting to make sense.

One of the reasons why I’ve researching the DS is because I’m going to be creating a Left 4 Dead clone called Left 2 Die.  I’m making use of the very good homebrew toolchain available and the libnds API.  The libnds library is probably complete crap compared to the official DS API, but it is pretty good.  It is a bit low level so as a programmer, you will have to do a lot of research before implementing something.  But it’s great fun and I’m hoping to get a DS soon!

UFC 92 Recap

Sports

December 28, 2008

Yesterday was a good night.  Three of the fighters I was cheering for won!  Quinton ‘Rampage’ Jackson took out Wanderlei Silva with a devastating left hook.  With the knockout victory, Rampage was able to avenge his two earlier losses to Wanderlei.

In the second fight, Frank Mir simply dominated Minotauro Nogeria.  He unleashed a series of 3 punch combos on Nogeria.  Nogeria was left wandering what to do after the first round.  Frank Mir came into the second with the same level of ferocity as in the first and finished Nogeria with a ground a pound.

In the main event, Rashad Evans faced off with Forrest Griffin.  In the first two rounds, the fight was essentially a draw.  But in the third round, something sparked Rashad Evans.  Evans landed a great blow to Griffin’s face, that sent him to the ground.  Then Evan’s finished Griffin with a series of punches to earn himself the Light Heavyweight Championship.

Ubuntu struggles

Programming

December 28, 2008

Ubuntu is one of those platforms that has a lot of potential, and yet it just can’t compete with Windows XP in terms of stability and software compatability.  In the last couple of days, I have been attempting to setup Ubuntu to my liking.  The problem is I’m always confronted with huge issue.   Initially, I installed the 64-bit version of Ubuntu, but to my surprise certain IBM products like Lotus Notes didn’t have 64-bit binaries!

So I had to go back and install the 32-bit version of Ubuntu just so I can get these IBM products working.  But during the installation, Linux had to stop responding.  On restart Ubuntu went literally insane by emitting weird Authorization Error message boxes.  So now I have to reinstall the whole OS again and hope the installation goes without issues.  I really want to get this thing working but damn you, Linux.

Review: Left 4 Dead

Games

December 28, 2008

Left 4 Dead is great fun

Left 4 Dead is great fun

I have been playing Left 4 Dead for the last couple of weeks.  It’s one of those games that will surprise you.  I was reluctant in getting this game, since I didn’t see anything really interesting about it.  However, the game has been praised by numerous people so I decided to give it a chance, and oh yeah, Valve was behind it so it must be pretty good, right?

Well, let me tell you something.  Left 4 Dead is amazing.  The game mechanics are so simple that you wouldn’t expect this game to be that amazing.  Yet somehow, the joy of killing hordes of zombies is truly unmatched.  Add three other human players to the mix who you will be helping and fighting alongside of, and this game is really a great achievement in gaming.

9/10

Review: A Fire Upon the Deep

Books

December 26, 2008

Tags:

A Fire Upon The Deep, 1992, Vernor Vinge

A Fire Upon The Deep, 1992, Vernor Vinge

The last couple of days had me reading one of Vernor Vinge’s epic novels, A Fire Upon the Deep.  Since I have read Vinge’s other great novel, The Deepness In the Sky, I came into A Fire Upon the Deep with fairly high expectations.  Thankfully, A Fire Upon the Deep does not disappoint.  The novel innovates in several ways.  One of the more interesting aspects of it is the depiction of the Milky Way Galaxy, which is separated into three zones.  The three zones are the Unthinking Depths, the Slow Zone, and the Beyond.   Each zone has wildly different characteristics.  For example, in the Beyond faster than light travel is possible, but it is not possible in the Slow Zone.  Due to the reliance of faster than light travel in many Beyond civilization, entering the Slow Zone can have a negative impact on any technology that is dependent on faster than light travel.

The novel begins in the Beyond, where a group of research discover an ancient relic.  Little did they know that the ancient relic, known as the Blight, would destroy them and all of their home civilization.  However, one family did manage to escape.  The family eventually landed on a relatively benign world that came to be known as the Tines’ world.  However, much to the surprise of the resarchers and their family, the world was populated.  Packs of dog lookalikes, known as Tines, ambushed their landing site, killing the two adults in the spaceship.   Two children were captured, one by the ambushers, known as the Flencers, and the other by Peregrine (a pack of tines) and Scriber.  Peregrine and Scriber got a hold of Johanna, a child of 14 years, and were able to escape from the Flencers and enter Woodcarver territory.

The story then shifted focus on Ravna, a citizen of Sjandra Kei, who was granted a trip to Relay for research purposes.   This is also where Pham Nuwen, the hero of The Deepness in the Sky, makes his return.  However, he is not the same Pham Nuwen as the one you would be familiar with.  No, Pham Nuwen was the mishmash of many human parts.  This lead him to even doubt his own memories.  But even so, he was given Old One’s memories.  Old One was a so-called Power, a artificial race that achieve transcendent status.  However, the Blight would soon destroy Old One and all that was left of it was in Pham’s memory, which he would call godshatter.  Ravna would later discover a signal being emitted by the grounded spaceship on the Tines’ world.  She would establish communication with one of the children there, Jefri, the youngest child.  At that point in time, the high beyond was already in danger of the oncoming Blight.  The Blight was obliterating everything on sight, but in doing so, it was looking for something.  That something was the spaceship on the Tines’ world.  Ravna recognized this and was able to get a spaceship to the Tines’ world.  In it was Pham Nuwen, Ravna, and two alien species known as Skroderiders, which were plants that rolled around on wheeled skrodes.  However, they were chased by a fleet of 140 spaceships, all of which were of the Blight.   Pham had little time to use his godshatter when he finally managed to get some time with the escaped spaceship.  His godshatter enabled him to modify the zone boundaries, moving the slow zone far into the beyond.  The end result was that the chasing fleet of Blight would be halted.  However, Pham would die.  The godshatter ate him whole.

As you can see, A Fire Upon the Deep is an experience like no other.  Vinge not only focus on the heart of the story, but on the characterization of the Tines’.  Reading about the Tines’ was interesting due to their pack-like behaviour.  Human-like behaviour would only be possible if a pack consists of 4 to 6 members.  But what it even more interesting was that their discovery of Radio would change their lives forever.  The reason is because originally they would have to move in packs, if there were to collide with another pack, consciousness would be lost.  If a member steered too far, intelligence would be reduced.  However, with radio technology, all of these problems would be remedied.

The book as a whole was greatly interesting, with Vinge exploring new areas of science fiction.  However, the book is not without its faults.  I did find that the zones of the galaxy seemed a bit far-fetched to be believable.  The dialogue was also not the greatest or most believable.  Also, I found some of the prose to be a bit turgid.

However, it is definitely worth the read.   8/10