Ostyman's Rumblings

Month

January 2012

12 posts

http://www.commandlinefu.com/commands/view/10106/remove-a-line-from-a-file-using-sed-useful-for-updating-known-ssh-server-keys-when-they-change → commandlinefu.com
Jan 30, 2012
Unborking SMB client on Mac OS X → jamsignal.blogspot.com

This is the second time this has happened to me, so I wanted to record a solution that doesn’t require a reboot that took me quite a while to find.

Here’s what happens:

So you’ve been happily connecting to SMB shares via the Finder using smb://my.server.egg1, when all of sudden, it tells you it can’t connect to the server anymore. The rude little git doesn’t even ask you for your credentials; it simply tells you to get bent.

If you look in Console.app (which I *highly* recommend when your Mac is Acting Weird), you’ll see something like this:

1/18/12 4:04:36 PM /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent[12396] smb_mount: mount failed to my.server.egg/Share : syserr = Broken pipe

Last time this happened, I think I fixed it by restarting my MacBook. But that’s SO MUCH WORK, so instead I spent a good 1/2 hour2 finding a means to beat the system and fix it without reboot.

All you need to do is find the NetAuthAgent process (via ps in Terminal or in Activity Monitor) and KILL IT WITH EXTREME PREJUDICE.

Voilà!

Many thanks to the nice folks at the linked blog for putting this solution out there.

1 The .egg TLD was founded by the venerable Homestar Runner.
2 Don’t talk to be about cost-benefit analysis. I’m not going to listen, and that’s not the point.

Jan 18, 20121 note
#problemsolved #osx #saveforlater
http://ostertoaster.wordpress.com/alfred-extensions/ → ostertoaster.wordpress.com

Added @jdfwarrior’s Extension Updater support for current Alfred.app extensions.

Jan 8, 2012
“Financial statements are like fine perfume; to be sniffed but not swallowed” —Abraham Brillof
Jan 7, 2012
Single line shell command to wipe QFX files from downloads

for i in `ls -1 /Users/Username/Downloads/*.QFX 2> /dev/null`; do srm -m $i; done

Script for cron on OSX. Can be adapted for any file pattern.

Could also be done with xargs.

UPDATE

The case-insensitive way to do this is as follows:

for i in `find ~/Downloads/ -maxdepth 1 -iname \*QFX\*`; do srm -m $i; done

Added bonus of no stderr to suppress since we’re using find as opposed to ls.

Jan 7, 20127 notes
#shell #cron #osx #saveforlater
Jan 7, 201228 notes
Play
Jan 7, 2012
“

I guess giving advice is easy compared to taking it. Know your fundamentals (algorithms, data structures, machine architecture, systems) and know several programming languages to the point where you can use them idiomatically.

Know some non-computer field of study well — math, biology, history, optics, whatever. Learn to communicate effectively in speech and in writing. Spend an unreasonable amount of time on some difficult topic to really master it. Try to do something that might make a difference in the world.

”
—

Bjarne Stroustrup’s advice to young programmers (via jmbr

)

Good advice!

Jan 6, 201216 notes
"Dead Drops is an anonymous, offline, peer to peer file-sharing network in public space. USB flash drives are embedded into walls, buildings and curbs accessable to anybody in public space. Everyone is invited to drop or find files on a dead drop. Plug your laptop to a wall, house or pole to share your favorite files and data." → deaddrops.com

Dear god—sounds like a security nächtmare! Interesting installment concept though. Kind of like geocaching.

Jan 6, 201212 notes
For loops in Terminal for over-engineered laziness

Task

Create 11 folders in sequence in a given directory:

Week 1
Week 2
…
Week 11

Bash

Pop open Terminal.app, then issue the following command:

for i in {1..11}; do mkdir “Week $i”; done

Extra Bits

This works in reverse as well if you need it to:

for i in {11..1}; do mkdir “Week $i”; done

Jan 4, 201212 notes
#nerd #shell #bash #saveforlater
Jan 4, 2012189 notes
Play
Jan 4, 201211 notes
Next page →
2011 2012
  • January 12
  • February 6
  • March 11
  • April
  • May 1
  • June
  • July
  • August 1
  • September 1
  • October
  • November
  • December
2011 2012
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December 5