January 2012
12 posts
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.
Added @jdfwarrior’s Extension Updater support for current Alfred.app extensions.
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.
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!
Dear god—sounds like a security nächtmare! Interesting installment concept though. Kind of like geocaching.
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