Every once in a while, I find and/or write some tool that makes life easier for me in one way or another and add it here. Plus, sometimes I find some cool snippets of code and figure, "Why not put 'em here?" I'd appreciate any
you may have, by the way.
- You should be using SuperGenPass to make "passwording" easier online. For a guarantee of security, I'd recommend the mobile version which has also been implemented for the Blackberry!.
- Hide your email address from spam bots
- Encrypt your web documents with simple (but weak) web encryption
- Stream MP3s over the Internet
- Automatically write and scroll text in a textarea HTML form control
- How to beat telemarketers at their own game (take a look at an old version)
- The Power of Compound Interest (take a look at an old version)
- The Extended Euclidean Algorithm (take a look at an old version)
- My useful Linux .bashrc additions:
alias a='alias' |
alias c='clear' |
alias ch='chmod' |
alias d='du -chsx /*' |
alias df='df -Th' |
alias h='history' |
alias j='jobs' |
alias la='ls -A' |
alias ll='ls -l' |
alias ls='ls -CF --color=auto $*' |
alias lss='ls -Al $*' |
alias lsss='lss $* | more' |
alias m='more' |
alias n='netstat' |
alias netstat='netstat -lnp | grep " LISTEN " | grep -v "tcp6"' |
alias p='ps -ef' |
alias pr='printenv' |
alias rm='mv -f -t $HOME/.local/share/Trash/files $*' |
alias rmdir='mv -f -t $HOME/.local/share/Trash/files $*' |
alias v='vim -u ~/.vimrc' |
alias ~='cd ~' |
|
export VNC_VIA_CMD='/usr/bin/ssh -C -f -L "$L":"$H":"$R" "$G" sleep 20' |
export EDITOR=/usr/bin/vim |
|
mesg n |
|
- My .vimrc:
set nocompatible | " use vim improvements |
set autoindent | " automatically indent new lines... |
set smartindent | " ...smartly |
set backspace=2 | " allow backspace over everything |
set tabstop=8 | " tabs are 8 characters |
set nomodeline | " don't overwrite own .vimrc |
set ignorecase | " searches are case-insensitive... |
set smartcase | " ...unless they contain upper-case characters |
set wrapscan | " wrap searches |
set hlsearch | " highlight searches... |
noremap <silent> <Space> :silent noh<Bar>echo<CR> | " ...but clear them with :space: |
hi search ctermbg=red ctermfg=white | " highlight searches white on red |
set nowrap | " don't wrap lines |
setlocal comments-=:// | " don't automatically comment |
set nobackup | " don't use backup files... |
set nowritebackup | " ...and don't create them |
set ruler | " show the cursor |
set showmatch | " highlight matching brackets |
set history=500 | " keep 500 lines of history |
syntax off | " turn off syntax highlighting |
" use an informative status line... |  |
set statusline=%F%m%r%h%w\ \[FORMAT=%{&ff}\]\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L] |
set laststatus=2 | " ...and always show it |
|
"set gdefault | " assume /g (global) on substitutions |
|
- To force a file system check on reboot (and reboot):
$ sudo touch /forcefsck |
$ sudo shutdown -r now |
|
- To mount ISOs:
$ sudo mount -o loop -t iso9660 /path/to/file.iso /path/to/mount_point |
|
- To make a color in an image transparent using ImageMagick:
$ convert -transparent "#hex_color" input_file output_file |
|
- To combine several PDFs into one:
$ gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=output.pdf file1.pdf file2.pdf |
|
- To split a PDF:
$ gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -dFirstPage=m -dLastPage=n -sOutputFile=out.pdf in.pdf |
|
- To rotate a PDF counterclockwise by 90 degrees:
$ pdftk in.pdf cat 1-endwest output out.pdf |
|
- To prevent key passphrases to be continuously prompted for in ssh sessions (once logged in via ssh):
$ exec ssh-agent bash |
$ ssh-add |
|
- To list duplicate files by hash:
$ find -not -empty -type f -printf "%s\n" | sort -rn | uniq -d | xargs -I{} -n1 find -type f -size {}c -print0 | xargs -0 md5sum \ |
| sort | uniq -w32 --all-repeated=separate |
|
- To rotate a video clockwise 90 degrees:
$ ffmpeg -i <input_video> -vf "transpose=1" -r 30 -sameq <output_video> |
|