perl -0 filename
reference: http://www.unix.com/shell-programming-and-scripting/202489-perl-inline-replace-only-1st-line.html
# bash function (Mac OSX) | |
# prefix clipboard to a file with contents of clipboard | |
# based on comments under http://www.cyberciti.biz/faq/bash-prepend-text-lines-to-file/ | |
# uses diff and patch to retain destination file attributes | |
prepend () { diff -u <(head "$@") <(echo -e "`pbpaste`\n`head "$@"`") >/tmp/mypatch; patch "$@" </tmp/mypatch ; } |
#!/bin/bash | |
# | |
# myip.sh | |
# returns public IP | |
# retrieving from HTTP service | |
ipcheckerurl="http://checkip.amazonaws.com/" | |
myip=`curl --silent ${ipcheckerurl}` | |
# retrieving with 'dig' command |
#!/bin/bash | |
# | |
# .todo.actions.d/rand | |
# extension for https://github.com/ginatrapani/todo.txt-cli | |
# display one random task from todo.txt matching filter | |
if [ -n "$1" ]; then | |
if [ "$1" == "usage" ]; then | |
echo " $(basename $0)" | |
echo " Displays one random task." |
coverting images with imagemagick |
perl -0 filename
reference: http://www.unix.com/shell-programming-and-scripting/202489-perl-inline-replace-only-1st-line.html
#!/bin/bash | |
# | |
# source | |
# http://osxdaily.com/2011/05/23/disable-shadow-screen-shots-mac/ | |
# | |
defaults write com.apple.screencapture disable-shadow -bool true | |
killall SystemUIServer |
#!/bin/bash | |
ln -s /Applications/TextMate.app/Contents/Resources/mate ~/bin/mate |
################### | |
# handy aliases # | |
################### | |
alias ls='ls -FG' # -F add trailing / @ * -G color | |
alias l='ls' | |
alias ll='ls -al' | |
alias lh='ls -ahl' | |
alias h='history' | |
alias j='jobs -l' | |
alias c='clear' |
##################### | |
# locale settings # | |
##################### | |
export LANG=en_US.utf-8 | |
export LESSCHARSET=utf-8 # basically LESSCHARSET seems not necessary when ".utf-8" is set in LANG |
Windows iso files (mount, create) |