2007-10-29

POSIX bracket expressions






































POSIXASCIIDescription
[:alnum:][A-Za-z0-9]Alphanumeric characters
[:alpha:][A-Za-z]Alphabetic characters
[:blank:][ \t]Space and tab
[:cntrl:][\x00-\x1F\x7F]Control characters
[:digit:][0-9]Digits
[:graph:][\x21-\x7E]Visible characters
[:lower:][a-z]Lowercase letters
[:print:][\x20-\x7E]Visible characters and spaces
[:punct:][!"#$%&'()*+,-./:;?@[\\\]_`{|}~]Punctuation characters
[:space:][ \t\r\n\v\f]Whitespace characters
[:upper:][A-Z]Uppercase letters
[:xdigit:][A-Fa-f0-9]Hexadecimal digits

2007-07-19

ssh-agent start up scritp

To activate ssh-agent when login, I put some scripts in my bash profile.

=> .bash_profile

#-------------------------------------------------------------------
SSH_ENV=${HOME}/.ssh/environment

function start_agent {
echo -n "Initialising new SSH agent..."
sleep 1
ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV}
echo "succeeded!"
source ${SSH_ENV}
ssh-add;
}

# Source SSH settings, if applicable
if [ -f "${SSH_ENV}" ]; then
source ${SSH_ENV}
#ps ${SSH_AGENT_PID} doesn't work under cygwin
( ps -ef | grep ${SSH_AGENT_PID} \
&& ps ux| grep ${SSH_AGENT_PID} ) \
> /dev/null || {

start_agent
}
else
start_agent
fi


=> .bash_logout

#-------------------------------------------------------------------
function quit_agent {
echo -n "Cleaning ssh-agent settins..."
sleep 1

ssh-add -D
ssh-agent -k > /dev/null 2>&1
unset SSH_AGENT_PID
unset SSH_AUTH_SOCK
echo "succeeded!"
sleep 1
}

if [ ${SSH_AGENT_PID+1} == 1 ]; then
echo -n "Quit ssh-agent? (No or Yes) "
while [ 1 ]; do
read ANS
case ${ANS} in
[Yy][Ee][Ss]|[Yy])
quit_agent
exit
;;
[Nn][Oo]|[Nn])
echo "ssh-agent will continue to serve!"
sleep 2
exit
;;
*)
echo -n "What do you mean? (No or Yes)"
;;
esac
done
fi

2007-01-26

FreeBSD under VMware, the time is delay

I found out my freebsd6.2 was complained about time is delayed.

After google, I found this post is useful, FreeBSD detects time via APIC.
You can set following line in /boot/loader.conf

hint.apic.0.disabled=1

Then reboot your FreeBSD, things will go to be different.