Quick Tip: delete line with sed

Running a bunch of vulnhub vms frequently, I’ve found a need to quickly delete a line from my ~/.ssh/known_hosts file. So I learned this:

$ sed -i ‘’ ‘/pattern/d’ filename.ext

This edits in place a given <filename.ext>, dropping any lines that match the <pattern>. Took me about 20 minutes to figure out that an eccentricity in the BSD version of sed requires the extra empty quotes. Originally I was trying the following, which should work on Linux, but not OS X.

$ sed -i '/192.168.56.101/d' ./known_hosts
sed: 1: "./known_hosts": invalid command code .

I found the solution in the comments of a stack overflow answer. I’m sure there’s a good reason it works differently in BSD vs GNU, but it’s not worth my time to learn why at this particular moment.

 

Books 2015 61-7976

I grew up idolizing pilots, particularly fighter pilots, and with them the space program. I have a very clear memory of visiting the JPL when I was five or six years old. Someone there was giving my dad a tour and I was able to tag along. Other cool places I learned about flight were airshows. It was always a big deal to go see the Blue Angels when they were nearby. I think part of it was Navy pride, and part of it was my dad’s memory of living at NAS Pensacola, the winter home of the Angels. I was born in Pensacola, but the only memories I have of it were vacations there later in life.

We moved to Ohio in 1989, and the absolute best part of it was moving minutes away from the United States Air Force Museum. 3 hangers FULL of airplanes, spacecraft, and all the associated memorabilia, videos, stickers, models, dioramas and displays. A few years later I remember staying home from school to go sit on a hill and watch one of the last Blackbirds fly in. 61-7976 is the tail number, and I’ll never forget the feeling. Even from a mile or more away, the sound shook you. This is an aircraft that cruised with the afterburners on. It flew at three times the speed of sound. I still cannot believe I was lucky enough to see one in the air.

Over the weekend I was stuck at a car dealership, as one gets sometimes when you need necessary repairs on short notice. Bored, and looking for something to pass time that wouldn’t drain all my batteries, I found Sled Driver: Flying the World’s Fastest Jet on my hard drive. I’m not sure where I acquired it, but it was great timing. This book chronicles the section of its author’s career driving the “Sled”, the “Habu”, the “Blackbird”, the SR-71. The author recounts every step, from volunteering, interviewing, training, and finally flying the fastest airplane built by humankind. I’ve always known about the machine scientifically, it’s fast. Really Fast. It leaks fuel on the ground, because its skin was designed so expand under the friction of the air as it cruised at two or three times the speed of sound. This book tells you the human elements. How stressful it is to understand that you cannot make mistakes. Every mission the pilot holds the life of himself and his RSO(Reconnaissance Systems Officer) in his hands. I think the author wisely avoids much discussion of the actual missions, but instead focuses on relating what its like to sit in that cockpit, hurtling forward faster than a rifle bullet. For four years, that was this man’s day job. I’ve had a couple of jobs in life, but I don’t think I’ll ever do something like that.

I was born at a time when America was just getting comfortable with the idea of going into space. We had been to the moon, and the Space Shuttle was just really getting her start. At the same time the cold war was raging, so the military and NASA got all the money they could ask for. Since then the Cold war has ended, and NASA feels forgotten to a kid that grew up drawing of space as something both science fiction and science fact. You can debate the politics of the situation all day long, but the SR-71 was a monument to human achievement. It was designed, planned, tested, built, and put into production(they built thirty two of those crazy machines) at a time when computers were not a commodity device. I’ve had access to more computing power for almost my entire life than the entire project team designing the fastest airplane every built.Reading this book makes me hope that the legacy of my generation can hopefully come up with some achievement more meaningful than another version of Flappy Bird, or another slick source code version control system.

Books 2015 IWT

Today’s summary is about “I Will Teach You To Be Rich” by Ramit Sethi. Despite what sounds like a sleazy title, I will count this book among the best I’ve ever read in terms of actionable content, written for YOU to get results. Yes, I’m sure that Ramit is very happy people like and buy his book, but from the first page to the last, he is encouraging the reader to look beyond their current state, and to get better.

This book isn’t about how to earn sick piles of cash to sleep on. It’s most basic message is that you can make your money work for you, so that you are able to enjoy a rich life. How you define a rich life is your own journey. Remit believes, and I with him, that worrying about which bill is paid when, which account to use for what, and managing your finances down to every tenth of a cent is in no way a rich life. Money is important, and having increasing amounts of it is not a bad goal. This book is super cheap and if you’re really that broke, half it’s content is available from Ramit himself in many places online. However, it’s worth a buy. This is the second book I’ve purchased as an adult for another person. It’s the first book I’ve done that after reading. It won’t be the last.

Remit doesn’t bullshit you. Learning to deal with money takes work. Unlearning or changing bad or outdated habits is hard. I’m just starting my journey following his ideas to automate my finances and the rewards are dramatic. They’re also a lot of work. Don’t be lazy. Try harder.