It is both foolish and arrogant to assume that because we don’t understand something it must be divine. — Daniel Miessler
After months of successfully resisting pressure from a number of friends, I am finally entering the world of Poker. I have a friend that is at the highest levels of the game and he is going to personally train me — which I understand is the way to go.
So it begins…
Let me lay out my first goal. I want to be able to make $1,000 a month within 6 months, but while still pursuing other interests (table tennis, infosec/computers, writing, etc). That’s rather modest, to be sure, but that’s my goal. I’ll adjust it as reality presents itself.
Let us pray that our reason will subjugate our superstition, that our intelligence will check our illusions, and that we will be able to hold at bay the evil temptation of faith.
xargs vs. exec {}There is a bit of a debate in some circles about using xargs vs. the -exec {} option that’s built into find itself. To me, however, it’s not much of a debate; -exec isn’t nearly as good as xargs for what I use find for. I tend to use it to perform tasks involving many files. “Move all these files there”, “copy all those directories there”, “Delete these links.”, etc.
This is whereThat’s all nice and stuff, but you probably want to see it in action, right? Let’s run some numbers. Below is a listing of 1,668 .jpg files on my OS X system using both-execbreaks down andxargsshows its superiority. When you use-execto do the work you run a separate instance of the called program for each element of input. So iffindcomes up with 10,000 results, you runexec10,000 times. Withxargs, you build up the input into bundles and run them through the command as few times as possible, which is often just once. When dealing with hundreds or thousands of elements this is a big win forxargs.
-exec and xargs:
# time find . -name “*.jpg” -exec ls {} \;
real 0m6.618s user 0m1.465s sys 0m4.396sHmm, that’s not bad — seven seconds for over around 1,600 files, right? Let’s try it with
xargs.
# time find . -name “*.jpg” -print0 | xargs -0 ls
real 0m1.120s user 0m0.594s sys 0m0.527sThat’s one (1) second vs seven (7) seconds. Seriously;
xargs is the way to go.
I just finished moving my email infrastructure to the new server (Gentoo + Deathgod Box of Doom). I had to wrangle quite a bit with SMTP-AUTH this time, and found very little help out there that didn’t have to do with using MySQL for the authentication piece. For me (and probably many others), that’s just overkill.
So after figuring out how to do it I decided to do a writeup on it. I would very much like to save others from having to go through the same thing I did. Plus, when I inevitably forget a step someday I’ll have this to refer to:
I got to see something really cool the other day. Some guy was being paid to hand out fliers at a mobile phone store here in Queens and the guy running the place saw what he believed to be the guy wasting time talking to friends.
So he moves out to where he’s in line of site of the guy (while still in the store, which had customers in it) and he opens his arms all the way out. “Hey! What I am payin’ you foah…” (think Sopranos). The guy, as if scripted, comes back with, “Why you bustin’ my balls?” (Sopranos) And he’s yelling this. Again, in front of customers.
People barely noticed, except for me. It was awesome.
So I am staying in Queens, which is markedly not New York City. I thought it was virtually the same, but it’s not. Not even virtually.
Well things are about to change. Our main contact up here got us a wicked cool place in uptown Manhattan. We’re right by central park and the Mac store, and we are getting everything taken care of. Laundry, expenses, tons of nice dinners, etc. This guy is hooking us up.
So the days of being stranded in the outskirts of the city are done. For the next two months I’m going to be in the thick of it. Taking the subway to work, being a stone’s throw from everything in the city, and absorbing the energy the way it was intended. Life is good.
I think one of the things that separates those who are successful from those who struggle is the ability to make use of existing resources — especially information.
Those who can do this effectively end up doing like a tenth of the work while yielding double the output. Those who don’t spend their lives reinventing simple tools, and as a result achieve just a fraction of the results.
Being successful is largely a matter of having a better system for doing things, and this is a major part of it.
It occured to me recently that having what I belive to be an “opinion” is actually a pretty high standard. I know this isn’t true in the strictest sense of the word, i.e. according to the dictionary anyone can have one, but I disagree.
The vast majority of “opinions” are nothing but echoes of peoples’ latest influence. They are parrot songs that were particularly catchy for whatever reason. I think a true opinion is one that stands on a solid base of knowledge and then branches from there.
I was struck with this while debating a friend about the fall of America. I found myself giving the whole “fall of Rome” argument. I’ve heard the argument a number of times, and it’s always made sense to me, but what do I really know about Rome? Not much of anything.
So do I really have an opinion about what caused the fall of Rome? No. No I don’t. What I have is the ability to echo a very small portion of someone else’s opinion, which I find rather intellectually hollow.
Don’t make that mistake, and call others when they make it. It’s not a real idea until you’ve already benefited from existing knowledge and then have something new to add based on that understanding. Until then you’re just posturing.
tcpdump Primerlsof Primerfind and xargstr Command