Command Line Wizardry 2.
Today, I thought I might just write about some general commands that help navigate files safely.
Now, the commands in the arsenal of what we’ll be using are:cat, more, grep, awk, sed, and vim
Friday, February 12th, 2010
Today, I thought I might just write about some general commands that help navigate files safely.
Now, the commands in the arsenal of what we’ll be using are:cat, more, grep, awk, sed, and vim
Friday, February 12th, 2010
So with the System Administration work I do now I write a lot of convoluted commands. I think there is a kind of poetry involved with it. So here are some commands I’ve used recently and a synopsis of their purpose
grep -liR --exclude='cow' foo /bar/* >> foobar.txt &
Grep searches the content of files to match a pattern. liR tells it to only output the filenames that match, ignore the case of the pattern to match, and to search recursively through files and directories. The exclude pattern does that, anything that is ‘cow’ is ignored. Finally the output is appended to the foobar.txt file. That little & at the end tells it to run in the background. Helpful if you have more work to do.
Next is this: rsync -avvze 'ssh' --stats --exclude-from='foobar.txt' foo.bar:/foo/ /foo/
Now for those who don’t know rsync. It is an amazing program. It’s purpose is to perform network file copies intelligently. Specifically it will only move the differences between files. It can do nearly anything under the sun related to that task.
This command in particular is going to copy everything from the remote server foo.bar to the local directory on the computer we run the command from. Now, along the way it will compare files between the two and only move ones that are different. The –excludes-from will read a file of things to ignore in this process. The -avvze ’ssh’ does a couple of things. The two v’s increase the output to level 2, the e tells rsync to tunnel everthing through ssh, the z compresses all the data before it sends it, and the a is a shortcut for a lot of other options that make it really great for making backups.
Now, the reason I put those two commands together is simple. You can use the grep command to find files that you don’t want to move, lets say they have sensitive login information. Those files you don’t want rsynced are listed in a text file that you can use on the rsync command so that they will be ignored. So rsync will copy everything but those files, so the sensitive information is preserved.
Clear as mud, right?
Thursday, February 4th, 2010
There was a time when I was not very socially adjusted. Some people (Mom) might still think that. However, at some point I figured out that more people respond to a solid conversation more than discussing, “Big-O,” for various algorithms.
“Big-O” is not something you do with your girlfriend. Not in this case anyway.
Despite all of my efforts, I still get pretty cranky inside about plenty of things thanks to my need for clean and elegant solutions. The classic boundary problem is one that gets me frazzled all the time.
If I said that I was going to be at your house at 12AM Saturday, when would you be expecting me? Would you wait around at 11:59PM Friday in joyous expectation, or would you expect to see me late Saturday night?
Sure, there is an answer to that question, but the problem is that most people don’t use it correctly. Instead a lot of people use midnight to describe the second scenario and 12AM to describe the first.
I swear I’ve had debates at work about what day the actual midnight showing was for a movie. That isn’t to say they’re stupid, but rather it’s an unclear problem that nobody has reconciled yet.
In my wacky mind I think of 12:01AM the official start of the next day, 11:59PM as the last minute of the last, and 12AM the oddball minute where people go insane and start chanting, “Ia Ia.”
Kudos to whoever gets that reference.
Aside from all of that though, I really love our new place with our ample amounts of stuff. I’m especially enjoying cooking. I tolerate a lot of cooking shows, enjoy Alton Brown, and grovel at the feet of Jacuqes Pepin. The man is a wizard.
Thursday, December 17th, 2009
So I’ve been having problems sleeping lately. That is fine, except I’m tired and cranky during the day. Oddly enough, that is about the right demeanor for used car shopping, which is what is occupying my time.
By the by, the movie, “The Code” isn’t so great. It has got some A-List actors, but it tried way to hard and failed.
So my ideas. First, I thought about creating a website. I’m sure it exists already, and I don’t think I have the energy to do it, but what it would be is a central resource for gamers.
Wow, breakthrough stuff. I know.
What I really want it to function as, is a social networking site for gamers to find other people, their million different names, stats, and games that they have, so they can have a better time playing games with people they like.
So your profile would have bare bones information about you, and then all of the various games you had on various platforms and poll whatever statistic collecting sites there are, for live updates of those players’ informations. That way, everything is in one place and people can check up on friends, rivals, and clans.
The other idea is for a game that I should have made by now, but I didn’t have the angles worked out. Of course it is a zombie game.
Now, there are humans and zombies in a procedurally generated town/city. There is a certain number of humans that can exist based on map size. They are naked and helpless. They have to forage for food, water, and supplies, while being attacked by zombies. Their scores will be based on survival and zombie kills.
The Zombies are endless, but there will really only be a certain amount roaming at a time. The zombies can be either human controlled, or player controlled. The beauty of this is that the zombies serve as a lobby while you wait for your turn to be a human.
Those who wait can see a top down map of everything except where humans are, and jump into a zombie that isn’t in use and run around doing their best to find and kill a human. If they die, the kick out to the map, and another zombie starts.
I have lots of other ideas to make the game interesting by restricting player-to-player communication, and various other sensory issues.
If I were a better man, I would create a team and make this game.
Monday, July 13th, 2009
First up, I’m on Twitter.
Take a deep breath.
While on there, I found a great little article I wanted to share. If you’re not up on the nerd, you might not get it.
By the way, its a hoax.
Anyway, I finished my video game resume, and after the upcoming bachelor party I’ll be kicking ass and sending it out to all of the companies that my dearest friends have thoughtfully sent to me.
I also recently heard the Dave Ramsey show on the radio during my 18 hour car ride. The man makes sense. Check it out if you are interested in your finances.
Thursday, July 9th, 2009
© 2010, Ryan. All Rights Reserved.
WP theme by GetTemplate.com