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.
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.
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
I had a thoroughly vexing (and to be honest, somewhat scary) experience today where the Command + Tab keyboard shortcut used to cycle between program windows suddenly stopped working.
Thankfully, the Interwebz saved the day yet again. It was ScreenSharing borking it!
Relevant posts at the bottom of this page:
Design by Simon Fletcher. Powered by Tumblr.
© Copyright 2010