Nov
19
2009
If you frequently need to show/hide hidden files on OSX, here’s what I find is the easiest way so you don’t have to do a google search every time to remind yourself of the syntax.
Create a file called ‘showHiddenFiles’
in Terminal, type:
chmod +x /path/to/showHiddenFiles
Make sure the location is on your path. I just use /usr/local/bin since it’s already on my path.
Edit that file with these contents:
#!/bin/sh
defaults write com.apple.finder AppleShowAllFiles $1
killall Finder
Now whenever you want to hide/show hidden files, just launch Terminal and type:
% showHiddenFiles true
– or –
% showHiddenFiles false
And don’t forget you can just type the first few letters (i.e. ‘showH’), then hit TAB and Terminal should auto-complete the file name for you. Then you can just add ‘true’ or ‘false’.

1 comment | posted in OS X
Nov
19
2009
OK, so yesterdays post was alright. It got you making an alias for Terminal. But if you tried it you probably noticed that you lost the alias after you quit Terminal. That’s usually not what you want. Let’s make it stick around.
Assuming you’re using bash:
Launch Terminal
% pico ~/.bash_profile
Add a line with a variable followed by whatever command you what it to perform, such as:
webroot='cd /Volumes/apache/webroot'
CNTRL-X, then press ‘y’ to save the file and exit edit mode
now restart bash_profile;
% source ~/.bash_profile
That’s it!
Now anytime you want you can launch Terminal, simple type % webroot, and you’ll be taken to ‘/Volumes/apache/webroot’
Now will all the typing this will save you, there’ll be more time for beer at the end of the day.

no comments | posted in OS X, Terminal
Nov
18
2009
I launch Terminal many times per day, and usually go to one of a handful of directories right off the bat. I just discovered the handiness of creating aliases in Terminal.
Let’s say you often go to /Volumes/development/depot/mainbranch. Let’s create an alias to that called ‘mb’ for ‘mainbranch’ (this can be whatever you want, of course.
Simply launch terminal.
Type: alias mb=’cd /Volumes/development/depot/mainbranch’
Done!
Now just type ‘mb’ at the command prompt and you’ll be taken directly to that directory!
Sweet!
Note, you can also do the same to launch applications:
alias tx=‘open /Applications/TextEdit.app/’

no comments | posted in OS X, Terminal
Apr
3
2008
The following error kept coming up when trying to install Sqlite3 on OS X (actually, the same thing happened when trying to install Fink too). It was finally resolved by installing the latest XCode packages.
Running ‘sudo ./configure –prefix=/usr/local’
would return:
checking build system type... i386-apple-darwin9.2.2
checking host system type... i386-apple-darwin9.2.2
checking for gcc... gcc
checking for C compiler default output file name...
configure: error: C compiler cannot create executables
See `config.log' for more details.
Here’ all the important stuff from the log:
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2062: checking build system type
configure:2080: result: i386-apple-darwin9.2.2
configure:2102: checking host system type
configure:2117: result: i386-apple-darwin9.2.2
configure:2187: checking for gcc
configure:2203: found /usr/bin/gcc
configure:2214: result: gcc
configure:2452: checking for C compiler version
configure:2459: gcc --version >&5
i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:2462: $? = 0
configure:2469: gcc -v >&5
Using built-in specs.
Target: i686-apple-darwin8
Configured with: /private/var/tmp/gcc/gcc-5367.obj~1/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=powerpc-apple-darwin8 --with-arch=nocona --with-tune=generic --program-prefix= --host=i686-apple-darwin8 --target=i686-apple-darwin8
Thread model: posix
gcc version 4.0.1 (Apple Computer, Inc. build 5367)
configure:2472: $? = 0
configure:2479: gcc -V >&5
gcc: argument to `-V' is missing
configure:2482: $? = 1
configure:2505: checking for C compiler default output file name
configure:2532: gcc conftest.c >&5
/usr/bin/ld: /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../libSystem.dylib unknown flags (type) of section 6 (__TEXT,__literal16) in load command 0
collect2: ld returned 1 exit status
configure:2535: $? = 1
configure:2573: result:
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "sqlite"
| #define PACKAGE_TARNAME "sqlite"
| #define PACKAGE_VERSION "3.5.7"
| #define PACKAGE_STRING "sqlite 3.5.7"
| #define PACKAGE_BUGREPORT ""
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2580: error: C compiler cannot create executables
See `config.log' for more details.
## ----------- ##
## confdefs.h. ##
## ----------- ##
#define PACKAGE_NAME "sqlite"
#define PACKAGE_TARNAME "sqlite"
#define PACKAGE_VERSION "3.5.7"
#define PACKAGE_STRING "sqlite 3.5.7"
#define PACKAGE_BUGREPORT ""
configure: exit 77

1 comment | posted in OS X, SQLite