Stupid SSH Tricks: A Better Hosts File
I’ve been noodling with SSH to make my life easier at work. One thing I found out about was how to make host aliases in your SSH config file. (It’s usually located at ~/.ssh/config). And it’s pretty easy to do. Here’s an example:
Host webhost User host_user HostName example.com IdentityFile ~/.ssh/some_id_dsa
The reason this is better than your hosts file (/private/etc/hosts) is because you can do things like scp ~/somefile.txt webhost:~/upload.txt and scp, since it uses ssh, will realize you want to do this: scp -i ~/.ssh/some_id_dsa ~/somefile.txt [email protected]:~/upload.txt
If you do a lot of sshing and scping like I do, you’ll find this extremely convenient. And if you use ssh keys, it makes working on multiple machines as easy as working on a local machine.
Remote diff
I just had a problem to solve: Compare two server config files on two servers to make sure they’re the same. Rather than using scp to copy the file from one machine to another, I used ssh’s ability to run commands remotely to get the contents of the file and piped it into diff. Here’s an example:
ssh user@server1 'cat /path/to/config/file.conf' | diff /path/to/other/config/file.conf -
I’ll leave it as an exercise for the user to write a shell script that will do this automatically, though it should be fairly easy to do.
Pennsylvanian Moments
In , Michael Moore says:
Pennsylvania, the state that gave birth to this great country, has a chance to set things right. It has not had a moment to shine like this since 1787 when our Constitution was written there.
I disagree. I think Pennsylvania has had a couple great moments since the Constitution. , for example, was the turning point of the Civil War. And the , where a solid blow was struck against the anti-American intelligent design movement, was decided in my hometown of Harrisburg.
So securing Obama’s nomination and eventual victory isn’t the only great moment Pennsylvania has had since the Constitution. It’s just the most recent.
Nash McCabe – “I’m 52 and unemployed, but I’d rather talk about lapel pins”
had a great post about why some woman from Latrobe got to ask Obama a question. According to them, her first appearance on the national stage came from a NY Times article where we learned that, even though she’s 52, unemployed, and living in a small town, she only seems to care about whether her president wears a lapel pin.
She’s exactly the person Obama is talking about when he says that people in small towns are bitter and cling to things like religion or guns or lapel pins. It’s not that their bitterness makes them love these things. It’s that they’re so disenchanted with government that they don’t think it can fix the big things, like the economy, so they focus on the little things.
In other words, she is an example of the attitude Obama was talking about. Maybe ABC was trying to be ironic when they let her on to ask her question. Or maybe they were just their usual clueless selves.
Replace Perl Path in Movable Type
A while back I had to set up Movable Type on a system where the Perl binary wasn’t in the usual location. So I wrote a quick and dirty shell script that you can run on a directory to replace the perl call (usually /usr/bin/perl) with whatever you want, as long as it’s an executable.
Note: This code comes with the usual caveats. Don’t come crying to me when you run it on a production instance of your blog and you lose your job and your wife leaves you and you end up in a van down by the river. Read the script and check your work.
An Open Letter to Representative Monique Davis
In case you hadn’t heard, A Democratic state representative from Illinois, Monique Davis (D – Chicago), has, well, I think
Rep. Monique Davis (D-Chicago) interrupted atheist activist Rob Sherman during his testimony Wednesday afternoon before the House State Government Administration Committee in Springfield and told him, “What you have to spew and spread is extremely dangerous . . . it’s dangerous for our children to even know that your philosophy exists!
“This is the Land of Lincoln where people believe in God,” Davis said. “Get out of that seat . . . You have no right to be here! We believe in something. You believe in destroying! You believe in destroying what this state was built upon.”
Audio of this bigotry and my letter to her after the jump.
… continue reading.
Who’s that guy?
About 18 seconds into the video, just next to Obama’s right shoulder, I think I know that guy!
That’s my little brother. He stood in line for six hours to get that seat. Oh, and the speech is good, too. (Screencap after the break.)
… continue reading.
Daddyhood
Yes, I know I haven’t updated in a while. Here’s why:
![]()
That’s my daughter, Ily. (It’s pronounced “eye-lee” goddammit.) Since she’s been born, my life has been really different. Awesome, but different.
“Growing Up in the Universe” – Now Available for Free Online
This is just a quick note to let people know that Richard Dawkins has decided to make every episode of his lecture series “” available online for free!This lecture series is a great primer on science and the rational explanation of the existence of life, the universe and everything. It’s even got an appearance by the late, great Douglas Adams. If you’re a reasonable person, or if you’re a theist who wants to see how anyone can not believe in god as the source for all things, these videos are a great resource. I’d suggest you download them using to be nice and save Richard some bandwidth.