Lee Newton

all the splinters of my mind
RSS icon Home icon
  • Fast Linux CLI tips

    Posted on May 12th, 2009 LRN No comments

    It came up in discussion with Terry Smith recently, just how much of a revelation bash’s tab to auto complete feature is for someone who hasn’t discovered it yet.

    Tab once to have bash auto complete a string on the CLI which has only one possible match in your current path. If nothing happens, tab twice to see possible matches then continue typing to narrow the focus to one possible match, then tab again to auto complete.

    It’s not worth going into any more detail, but if you don’t already know what I’m talking about, next time you’ve got a linux terminal window open, start hitting tab.

    Enjoy.

  • Linux Tip #1

    Posted on May 12th, 2009 LRN No comments

    This one’s really basic, but just because you’re an ace php developer doesn’t necessarily mean you’ve had a chance to discover all the ins and outs of bash and the linux command line. One of the guys in the office recently asked me how to make a change to multiple files in his code base with a single line command. Find and sed are your friends here. Since I’m a huge fun of doing as many things as possible with one liners, here’s the gist of what we did.

    find . -name '*.php' -exec sed -i -e"s#search#replace#g" {} \;

    Find the files you want, run sed on each one of them, edit inline with the included expression, done.

    Big thing to note is sed using ‘#’ for a seperator and not ‘/’ . I believe the man page still talks about using a forward slash, but ‘#’ works.

    The results from your find command are run through the {} so don’t forget that, and a find -exec must be terminated with a \;

    Enjoy.

  • Tips from a sysadmin at b5media

    Posted on May 12th, 2009 LRN No comments

    As part of my on going effort to do anything at all with this blog, I’ve decided to start posting any little linux tidbits that spin out of the day to day here at b5media. This new category is where I’ll slap up anything that folks new to linux, or looking for the odd time saver here or there might appreciate.

  • Cinnamon Gum: Natural Quit Smoking Aid

    Posted on April 15th, 2009 LRN No comments

    It’s been roughly two weeks since I smoked my last cig, the cravings are constant and at times powerful. Now I’ve read in the past cinnamon gum can help when you’re quitting, so I picked up a few packs when I was over my flu and getting back to work.

    Crazy thing is, it seems to be working! I think this has less to do with cinnamon per se, and more to do with finding a way of displacing the habitual / ritualistic nature of smoking. When I crave a smoke, I pop a piece of cinnamon gum. Could just as easily be a dog biscuit I guess, but I’m going to stick with the gum for now.

    The nicotine is gone from your system really quickly when you stop smoking, the habit is the real killer.

  • Moving to the West End of Toronto

    Posted on April 15th, 2009 LRN No comments

    It’s been two weeks since I quit smoking, and in two weeks time I’ll be moving into a new apartment (*cough* loft *cough*) in the west end of Toronto. It’s got a certain symmetry to it. I’m feeling better in time to start feeling much better about where I’m living.

    I’ve been looking for a way to pick up on the posting bit, so will look for a chance to blog here and there as we get closer to moving.

    Very excited about the new place, sooo glad to be getting out of the current place. I’ll leave you with a video which seems apropos in many ways.

  • A Catalyst to Quit Smoking Successfully

    Posted on April 3rd, 2009 LRN No comments

    Everyone knows it’s hard to quit smoking. If you’re mentally prepared to quit, you honestly don’t want to smoke anymore, then you’re already more than half way there. If you’re trying to quit for something or someone else, you’ve got an almost insurmountable task ahead of you.

    Sometimes all you need is a fortuitous catalyst. The last time I was very successful at quitting I’d recently started mountain biking competitively, so the incentive was there to have working lungs. Breaking my leg in an unrelated act of stupidity put a stop to biking long enough for boredom to start me up smoking again. I’ve quit a couple of times since, but haven’t been very successful at staying that way.

    Way back in November of last year I’d started thinking it was probably soon time to quit smoking… again. One of the main reasons I’ve been putting off quitting for so long this time around is the feeling this is probably my last real chance to quit. If I pick it back up again this time, I’m screwed. I’ll be a smoker for life. Enter my latest fortuitous catalyst:

    sosickAfter a couple of days feeling so horrible I couldn’t even contemplate smoking, it occurred to me this was the perfect time to give it another go. Instead of looking forward to feeling repaired enough to light up, why not look for reasons to give it up again? And then this old article bubbled up to the top of the traffic charts at b5media’s newly redesigned destination site, blisstree.com. Seeing the immediate benefits to your body in a very short time after finishing your last smoke was pretty cool.

    So check out the article, and look for a catalyst in your life to help you put down smoking. I’m not saying you should strip down and stand naked in the cold spring rain, or lick the hand holds on the subway ride home this evening… but if you’re looking for a good chance to get enough of a break from smoking to make quitting easier, consider getting sick ;)

  • Tweets, Twits and Twoughts with Stephen Colbert

    Posted on April 3rd, 2009 LRN No comments

    So I’ve been on the Twitter sidelines for some time now, dabbling much as I dabble here with blogging. My friends outside of work are reaching a point of exhaustion with facebook, but are convinced they want nothing to do with Twitter. Twitter’s recent exposure in mass media has managed to clue a lot of people in to its existence, but due to mass media’s general confusion with the service, hasn’t passed on a lot of anything else. I tell them it’s a powerful business tool if used properly, but outside businesses directly connected to new media, that’s sort of hard to quantify. If you’re not using it for business, does the average person really receive any benefit from Twitter not afforded by facebook or any of the other more ’social’ social networks? How will the world at large continue to react to Twitter? I’m hoping the Colbert Nation can help provide an answer.

    During his interview with Biz Stone (cofounder of Twitter) this evening, Stephen Colbert finally picked up his iPhone and started tweeting (@stephenathome), and after the initial flurry of follows, he’s been building his Twitter congregation at a rate of about one a second since the show ended. I jumped on the follow train and plan on watching to see how both the show, the host and the fans react to one and other over the next few weeks.

    While we’re waiting to see how one of the most influential celebrity voices of our times determines what to make of it, check out this hilarious outtake from a recent interview with Colbert where he’s asked if he’s on Twitter.

  • The Frakkin End

    Posted on March 20th, 2009 LRN 10 comments

    To the people who are totally disappointed with last half of the BSG finale… why? What were you hoping for? It’s the job of good science fiction to comment on current events and the human condition. Correlating the cycle of violence and hate that plagued the BSG universe to all the problems we’re currently dealing with seems pretty apropos to me. Did you need one last twist? Did you get bored while saying farewell to and wrapping up all the characters?

    All right angel Caprica and angel Baltar could have had a slightly less cheesy departing moment, writing could have used a little last minute tweaking, but the warning of a repeat to what’s happened before and equating our madly technology and consumer driven culture to the rise of the Cylons was a perfect ending IMHO.

    What’s your opinion?

  • Hilarious Durex Ad

    Posted on January 23rd, 2009 LRN No comments

    I’ve had no time for blogging lately but I had to drop this out there, too funny.

  • Mirror’s Edge: A Sliver of an Ending

    Posted on December 21st, 2008 LRN No comments

    Where’s my damned ending?? The parkour aspects of Mirror’s Edge are no end of fun, but the combat system was half baked, ill advised and irritating to say the least. I trudged my way through the final chapter of this game, infested with snipers and requiring do-over after do-over and for what? The final show down was over before it began and cut to credits practically before I realized I’d succeeded. Hands down the fastest and most unsatisfying wrap up I’ve ever seen in a video game, further exemplifying how confused and lacking direction the “story” for this game really was. Hey Dice, next time you come up with an interesting game play mechanic, take the time to let a coherent game percolate out of it before letting EA yank it out of your hands and slap it on the shelf. Oh ya, and I still hate your guts for the quality of Battlefield 2, but that’s a whole other story.