Nov/080
NFS shares keep on dropping in leopard?
Had a problem recently with nfs shares disconnecting all the time, much to my annoyance.
Turns out that it’s due to the .DS_Store files on the server, so a quick
find / -name [.]DS_Store -exec rm -f {} \;<
on the server sorted that out.
Now to stop leopard from making them, on the client machine run:
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
this should hold true for samba mounts too.
the DS_Store file is apparently a hangover from OS9. It holds information relating to the remembered view of the folder, so by deleting them all, and stopping new ones you are forcing the default view on all the networked folders, no biggie
Jul/080
Automate a Remote Login Using SSH-Agent
When it comes to remote logins, SSH is a wonderful tool. Not only is it
secure, it supports public/private key logins. Depending on public and
private keys mean even if someone gets your password, without your
private key it won’t do them any good (and vice versa).
see full article here
Jun/081
Customising your bash prompt in OsX – path in the title bar & pretty colors!
I made myself a nice prompt for bash in OsX, I have the basename of the path in the terminal, but he full path in the title bar. Yay!
put this in your .bashrc (see prevoius post on creating this file)
export PS1="\[\e]2;\u@\H \w\a\e[42;1m\]\u:\W>\[\e[0m\] "
To customise:
\a an ASCII bell character (07)
\d the date in “Weekday Month Date” format (e.g., “Tue May 26″)
\e an ASCII escape character (033)
\h the hostname up to the first `.’
\H the hostname
\n newline
\r carriage return
\s the name of the shell, the basename of $0 (the portion following the final slash)
\t the current time in 24_hour HH:MM:SS format
\T the current time in 12_hour HH:MM:SS format
@ the current time in 12_hour am/pm format
\u the username of the current user
\v the version of bash (e.g., 2.00)
\V the release of bash, version + patchlevel (e.g., 2.00.0)
\w the current working directory
\W the basename of the current working directory
\! the history number of this command
# the command number of this command
\$ if the effective UID is 0, a #, otherwise a $
\nnn the character corresponding to the octal number “nnn”
\\ a backslash
\[ begin a sequence of non_printing characters
\] end a sequence of non_printing characters
;
and here is a list of color codes (it’s displayed in such a way as so you can just export it, and see the colours)
PS1='[\u@TEST \w]\n \#\$ \n\ \[\ \e[1mBold Text\e[m\n\ \e[4mUnderline Text\e[m\n\ \e[5mBlink Text\e[m\n\ \e[7mInverse Text\e[m\]\n\ Should be normal text Foreground colors: \[\ \e[0;30m30: Black\n\ \e[0;31m31: Red\n\ \e[0;32m32: Green\n\ \e[0;33m33: Yellow\Orange\n\ \e[0;34m34: Blue\n\ \e[0;35m35: Magenta\n\ \e[0;36m36: Cyan\n\ \e[0;37m37: Light Gray\Black\n\ \e[0;39m39: Default\n\ Bright foreground colors: \e[1;30m30: Dark Gray\n\ \e[1;31m31: Red\n\ \e[1;32m32: Green\n\ \e[1;33m33: Yellow\n\ \e[1;34m34: Blue\n\ \e[1;35m35: Magenta\n\ \e[1;36m36: Cyan\n\ \e[1;37m37: White\n\ \e[0;39m39: Default\n\ \e[m\]Background colors: \[\e[1;37m\e[40m40: Black\e[0;49m\n\ \e[41m41: Red\e[0;49m\n\ \e[42m42: Green\e[0;49m\n\ \e[43m43: Yellow\Orange\e[0;49m\n\ \e[44m44: Blue\e[0;49m\n\ \e[45m45: Magenta\e[0;49m\n\ \e[46m46: Cyan\e[0;49m\n\ \e[47m47: Light Gray\Black\e[0;49m\n\ \e[49m49: Default\e[m\]\n'
more reading: http://networking.ringofsaturn.com/Unix/Bash-prompts.php
May/080
Os X console. howto setup your .bashrc
I’m new to OsX, but not to *nix, so one of the first things that i wanted to do was to set up my console…
this is my ~/.bash_profile
. ~/.bashrc ENV=$HOME/.bashrc export ENV
and my ~/.bashrc:
PATH=$PATH:$HOME/bin:/usr/local/bin:/usr/libexec alias lc=ls alias l="ls -l" alias ll="ls -l" alias la="ls -a" SHELL=/bin/bash export CLICOLOR=1 export LSCOLORS=ExFxCxDxBxegedabagacad