One easy way around this is to to define an entry as the following in $HOME/.ssh/config:
Host my.githost.com Port 7822
This allows one to use the host normally through most SSH-using tools such as subversion and git!
Host my.githost.com Port 7822
When pasting content into vim, such as a code snippet, it may mess up the indentation in a nested kind of way, with indentation increasing the further down you go.
The vim paste option fixes this - just issue :set paste before pasting, and :set nopaste when done.
As noted by the vim documentation, the underlying problem is that a terminal program, in contrast to a GUI one, may not recognize the difference between pasted and typed text.
Treat unset variables as an error when performing parameter expansion. If expansion is attempted on an unset variable, the shell prints an error message, and, if not interactive, exits with a non-zero status.Example:
vs$ cat hello.sh
#!/bin/sh
NAME=$1
echo Hello $NAME
$ sh hello.sh
Hello
$ cat hellou.sh
#!/bin/sh
set -u
NAME=$1
echo Hello $NAME
$ sh hellou.sh
hellou.sh: line 5: $1: unbound variable
grep FATAL logfile | zwrite coworkerIt's quick, avoids tedious copy and paste and allows sending messages from batch run scripts. However, zwrite started to show its age long ago, being difficult to setup on various systems and having poor desktop integration and power.
#!/bin/sh
test $# -eq 0 && echo "Usage: echo hi | $0 user [otherusers] " && exit 1
export MESSAGE="`cat`"
while test "$1"; do
BUDDY=$1
# aliases
test $BUDDY = friend1 && BUDDY=friend1.account
test $BUDDY = friend2 && BUDDY=friend2.account
# ..
# default to @gmail.com
test `echo $BUDDY | grep @` || BUDDY=$BUDDY@gmail.com
export BUDDY
OS=`uname`
if [ "$OS" = "Darwin" ]; then
# use applescript to call either ichat or adium
/usr/bin/osascript <<EOL
set stdinText to do shell script "echo \"\$MESSAGE\"" without altering line endings
tell application "System Events" to set iChatRunning to (name of processes) contains "iChat"
if iChatRunning then
tell application "iChat"
send stdinText to buddy "$BUDDY"
activate
end tell
else
tell application "System Events" to set adiumRunning to (name of processes) contains "Adium"
if adiumRunning then
tell application "Adium"
tell the first account of the service "GTalk" to ¬
set newChat to ¬
make new chat with contacts {contact "$BUDDY"} ¬
with new chat window
send newChat message stdinText
activate
end tell
else
display dialog "ERROR: You must run either iChat or Adium" buttons "OK" default button "OK"
end if
end if
EOL
else
# calling pidgin over dbus
python -t - <<EOL
import os, sys
try:
import dbus
except ImportError: sys.exit('ERROR: You need dbus with python bindings installed')
try:
bus = dbus.SessionBus()
service = bus.get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject")
purple = dbus.Interface(service, "im.pidgin.purple.PurpleInterface")
except: sys.exit('ERROR: Could not connect - is pidgin up and running?')
xmppAccount = None
for account in purple.PurpleAccountsGetAllActive():
if 'XMPP' == purple.PurpleAccountGetProtocolName(account): xmppAccount = account
if xmppAccount == None: sys.exit('ERROR: Cannot find any xmpp account')
recipient = os.environ['BUDDY']
matches = purple.PurpleFindBuddies(xmppAccount, recipient)
if len(matches) == 0: sys.exit('ERROR: Buddy "%s" not found!' % recipient)
conversationType = 1 # http://developer.pidgin.im/doxygen/dev/html/conversation_8h-source.html#l00051
conversation = purple.PurpleConversationNew(conversationType, xmppAccount, recipient)
im = purple.PurpleConvIm(conversation)
message = os.environ['MESSAGE']
purple.PurpleConvImSend(im, message)
EOL
test $? -ne 0 && exit 1
fi
shift
done
open $HOME/Downloads/GLTron.appallows you to try out http://www.gltron.org/ directly after unpacking.