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
Alright, I’ll say it. I have a man crush. Though I also need to clarify that the gender isn’t really relevant other than to make people raise an eyebrow.
Now then.
What I’m talking about, or rather, who I am talking about is Jacques Pepin. I’m sure I’ve written about him before, but he is the closest famous person (Depending on how you define famous) that I have ever had an obsession with.
For those of you who don’t know, he is probably the greatest chef that is in the public eye. The reason you probably don’t know him is that he has only ever been on PBS and not on the Food Network.
Anyway, he did a show a few years ago with Julia which is where most people have seen him, but he’s been around much longer. He was the main chef for 3 heads of state in France, helped out in a few restaurants and is a freaking wizard.
Seriously, watch him make an omelette and tell me you could ever do better.
I bought his complete book of techniques which is fantastic. It shows you how to hold, use, and maintain your knives, how to chop, julienne, and dice, how to make puff pastry, sugar baskets, and chocolate sculptures.
So far I am working on the basic bread recipes and techniques and roasting and carving chickens. I have gotten pretty good at the whole process, and that makes me feel good.
I had some friends and my family over to have my chicken. It was a new experience because I cooked 2. I figured that since there were 6 of us, one 3 lb chicken wouldn’t cut it. I was kind of wrong. Some how, one of the chickens was barely touched.
Nevertheless, I trussed the two chickens, roasted and basted them, and then carved them the way Jacques recommends. My mom told me she woke up in the middle of the night wanting more. I don’t know if I’ve had such a good compliment.
Anyway, if you have any interest in cooking, check him out. He is worth obsessing over.
Monday, February 1st, 2010
Well, this will be the last post from my blog that appears on Facebook (Unless I screw up anyway). I’m happier with the feeling that I can write what I want in two distinct places instead of my bad language permeating to everyone I have ever met on Facebook.
This may or may not have anything to do with the alarming amount of older relatives that are showing up.
Wednesday, January 27th, 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
© 2010, Ryan. All Rights Reserved.
WP theme by GetTemplate.com