108 points · by weaksauce · 16y ago · 58 comments
Fast access to the shell that defaults to the working directory of the currently used file from say xcode and you can paste in the current working file(s) as arguments to whatever you want to run. There is an option to run the command in the overlay app or in terminal.
I recently found out about it because I was looking for xcode git integration and this makes accessing the shell git stuff quick. It's free too.
Eject a volume:
alias eject='hdiutil eject'
Copy the working dir to the clipboard: alias cpwd='pwd|xargs echo -n|pbcopy'
Show current airport status: apinfo='/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I'
Use spotlight to search for a file: spotlightfile() {
mdfind "kMDItemDisplayName == '$@'wc";
}
Use spotlight to search file contents: spotlightcontent() {
mdfind -interpret "$@";
}
Display a man page in Preview: pdfman () {
man -t $1 | open -a /Applications/Preview.app -f
}
I've a few others but they're less generic than the above. Also although the above were sitting in my .profile I probably yanked them from random parts of the inter-webs; in other words, I take no credit for them.EDIT: One more generic one I use fairly regularly:
google() {
python -c "import sys, webbrowser, urllib; webbrowser.open('http://www.google.com/search?' + urllib.urlencode({'q': ' '.join(sys.argv[1:]) }))" $@
}another neat trick is dragging and dropping a file to the terminal and having the filename pasted to the terminal
http://github.com/mxcl/homebrew
I've replaced my MacPorts install with Homebrew and have been pretty happy with it. It's relatively new so not everything is in there yet.
It's probably good software, for all that. He probably understands Unix better than I do, but it still bothers me.
I used Homebrew for a bit, even submitted some recipes, but I've since switched back to MacPorts, in short because:
* MacPorts was once as simple as Homebrew, it's not now for good reasons. Eg, the reason MacPorts uses it's own python is beucase Apple is slow to update their own python, and when they do it happens outside of your own setup so you won't necessarily know you need to rebuild X, Y and Z.
* Homebrew did some silly things like aggressive stripping (which seemed to just be commands pulled from the Gentoo wiki without any real justification) which caused problems a few times when I tried to install things outside of Homebrew (eg, easy_install of MySQLdb didn't work out-of-the-box with the Homebrew mysql libs).
sudo chown -R `whoami` /usr/local
I'd check this out. But I just can't bring myself to do it when they still have that as their default install instructions.I've had to sit a few developers down and teach them how to use commands like strace and truss to show them exactly which file they are trying to f_open and why it fails (usually trying to open a file in read/write mode that is not owned by them and 644 permissions).
Shouldn't this stuff be taught in basic CS101 courses?
My only fear with homebrew is the lack of robust dependency resolution, but in practice I tend to be installing a limited set of devtools, so it doesn't rise to the same dependency hell that gave rise to the modern crop of unix package managers.
> Rudix features a world class collection of pre-compiled and ready to use Unix compatible software which are not available from a fresh installation of Mac OS X but are popular among other Unix environments. Here you can find utilities, programming languages, libraries and tools delivered as standard Mac OS X packages.
I haven't used this, though it may appeal to some.
One of my best finds so far would be butler: http://www.petermaurer.de/butler/
It's basically quicksilver but with less obscure configuration dialogs and without the crashes (quicksilver would crash a lot on me).
Obviously, Shift-Home and Shift-End should be remapped as well so selection would work.
Why? There's a few things that you can't do with a Terminal, such as seeing and easily editing all the info from Get Info at once, or most things involving the use of a contextual menu - especially seeing what programs are in the Open With list (there may be a launch services related command, but you still can't pick one without typing another command (open -a Application file). Multi-file drag and drop is easier than multi-file cp, especially if you don't need a particularly named group of files that you can use a wildcard with - it's easier to shift-click or command-click than to type each one out individually, even if you can use tab completion.
* aliasing cd to end with an open . won't do, because that brings Finder to the front (which you can work around in bash), along with all the other open Finder windows (which you can't), and worse, it opens a new window every time instead of reusing the same one (another can't work around). The last two are because you can't, as far as I know, get a handle on a particular Finder window. I wonder if an AppleScript can get the job done. Hmm...
The "stealth" release of QuickSilver beta 57, from November 2009. It's not perfect, but it crashes far less than other builds in 10.6.2 (for me at least).
I have no idea why it's not on the blacktree site.
That's why Quicksilver has no official site, by the way.
And here's a nice tidbit – TextMate comes with `mate`, a proxy utility you can call with DTerm like so: `mate ./new_file_here`. But XCode doesn't, and won't create a file for you if one doesn't exist. So for XCode I have an function/proxy in my `~/.profile`:
function edit { touch "$1"; open -a Xcode "$1"; }
Bash can be very usefully augmented, for instance you can have a git repo status in your prompt, like so: function wgit_dirty {
git diff --quiet HEAD &>/dev/null
[[ $? == 1 ]] && echo "◆"
}
function wgit_branch {
REF=$(git symbolic-ref HEAD 2> /dev/null) || return
echo :${REF#refs/heads/}$(wgit_dirty)
}
export PS1='\u \W$(wgit_branch)\$ 'I really love the fact that all the power of UNIX is hidden behind a nice GUI(though there are some things that I would like them to fix regarding finder)
'Open a terminal window here'
http://www.makeuseof.com/tag/how-to-show-ical-tasks-events-o...
Gives total real estate for the terminal (works in other apps too)
DTerm is a great tool.