Archive for February, 2008

Creating Commands with xargs

Saturday, February 23rd, 2008

I have a couple of folders with a ton of compressed files in them. I’m not talking about 10 or 20. No I’m talking about a couple thousand. Instead of spending all eternity uncompressing the files, I did some research into how one would go about having the command line do all the glorious work for him.

One of the requirements was that I didn’t want to decompress any Japanese files, which were indicated by ‘(J)’. However, if the file was American, European, and Japanese, then I did want the file decompressed. Another problem I had was that the indication of the type of file was clear. It could have either been UE, EU, JUE, UJE, or UEJ.

I wanted to keep the files separated, so I created another directory called dir2, which is the directory I’m in when I run the following command:

$ ls -1 /home/paulus/dir1 | grep -E ‘.*\((E|U|EU|UE|JUE|UJE|UEJ|JU|UJ)\).*\.zip’ | xargs -d’\n’ -L 1 -I ‘{}’ unzip ‘../dir1/{}’

The first command is a very well known command to anyone who has used a *nix distribution. This is listing the files in /home/paulus/dir1. The -1 is printing a list of files with one item on each line. The output is piped to the grep command.

The grep command gets a little messy with the regular expression. The . (period) is the beginning, the * (Asterisk) is saying “anything from the beginning to the first parentheses.” We have to use the back slash to escape it, otherwise it will be interpreted as a condition.

Notice how the second parentheses is not escape, that’s because we’re using it like we were if we were doing an if statement. From ‘\(’ to ‘\)’, we are using an if statement. So, return true if E or U or EU or UE or JUE or UJE or UEJ or UJ or JU are found. The ‘.*’ is saying anything after the ‘()’, then we have the extension, so we’re only looking at zip files.

Now that the regular expression is out of the way, we can move on to the xargs command. The xargs is used to build and execute command lines from input. Some programs don’t like to get data piped into it, such as the case of unzip. With the -d‘\n’ parameter, we are saying that each line is a separate argument and we are limiting one argument per command by the use of -L 1 parameter. -I ‘{}’ is saying that we are going to replace {} with an argument, such as one of the file names received from stdin. We finally get to the point where we can use the unzip command as if it were on the command line. xargs will execute ‘unzip ../dir1/{}’, but the actual command that gets sent is unzip ../dir/file.zip, where file.zip is one of the arguments that it was passed.

Ultimate Weapons for Castlevania: Curse of Darkness

Wednesday, February 13th, 2008

I wrote this little guide because I got annoyed when I learned that I didn’t steal material from a one time only boss or realized that I should got back a few stages to spend a half hour trying to get that one material that I needed. I wanted the most powerful weapons and strongest armor in the game. This is a very quick and dirty break down on how to get the weapons.

(more…)

Discovering your Past Lives

Tuesday, February 5th, 2008

This weekend I finished Discovering Your Past Lives by Gloria Chadwick. I was rather disappointed by the book overall. Perhaps it was because I was expecting more out of it, something more scientific. She did touch on what Alpha and Beta brain waves were and through out the book she kept telling the reader to get ‘into Alpha.’ That was the extent of the science.

According to the Author, she makes claim that behaviors, how we talk, books we read, dreams we have, interests, hobbies, talents, and weather we like are all indications of who we were in a past life. Even the jokes we make and how our home is like indicates who we were in a past life. One of the more known is the Birthmark theory. Typically a birthmark is an indication of tramma that you suffered in a past life. One of the most entertaining claims is that deja-vu is a definite sign that something around you was apart of your past life, whether it be a person, place, or thing. I read an article by Rick Nauert Ph.D. There is a mechnism in the brain that distinguishes similar yet distinct places. When we visit a place, neurons in the brain fire creating a blueprint. So next time we see the place, the same neurons fire. When we come into a new place, that is very similar to a place that we’ve already been, some of the same neurons fire as well as new neurons creating the sensation of deja-vu.

The next major subject of the book is Karma and why we are destined to be reincarnated. We are reincarnated to perfect our souls by learning lessons. If we let someone down in a past life, we must learn that lesson by living it in another life. Frankly, I believe that’s stupid. I don’t think I need to learn a lesson by having to live it. Personally the idea of us dying, poking around in the interuim deciding what lessons we want to learn in the next life is completely absurd.

“Karma is the universal law of cause and effect.” It IS cause and effect, it doesn’t take a rocket scientist or deep philosopher to come up with that. The cause and effect can be felt from the time an event takes place to whenever it runs out of steam.

Perhaps re-incarnation isn’t what Gloria thinks it is. Perhaps re-incarnation is something along the lines of us living, then dying, our decaying bodies being used as food for plants, and those plants are consumed by pregnant women who then use that food to sustain the babies still in the womb. Perhaps there is a collective conscience that we all share and that we are nothing more than devices that access that database and utilize it’s resources to how we feel we can benefit from the situations.

If you are looking to discover who you are, then I don’t recommend you read this book. The way that the author describes how to retrieve past life memories is weak and can easily be suggested. To me it’s more about having a buffet of information laid out in front of you and you get to create who you were in a past life. Until there is a method of learning of a past life, if one actually exists or not, we will never know who we were.