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
suggestions 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.
- Hide your email address from spam bots
- My useful Linux .bashrc additions:
alias c='clear -x' |
alias df='df -Th' |
alias h='history' |
alias j='jobs' |
alias ls='ls -CF --color=auto --group-directories-first $*' |
alias lss='ls -Alh --group-directories-first $*' |
alias n='netstat' |
alias netstat='sudo netstat -alnptu | grep " LISTEN "' |
alias p='ps -ef' |
alias rm='mv -f -t $HOME/.local/share/Trash/files $*' |
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 |
set synmaxcol=1000 | " limit syntax highlighting to the 1000th column of a line |
"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 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 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 convert a LaTeX document to ODT and DOCX:
$ latex2html in.tex -split 0 -no_navigation -info "" -address "" -html_version 4.0,unicode |
$ libreoffice --headless --convert-to odt:"OpenDocument Text Flat XML" in/index.html |
$ libreoffice --headless --convert-to docx:"MS Word 2007 XML" in/index.html |
|
- To rotate a video clockwise 90 degrees:
$ ffmpeg -i <input_video> -vf "transpose=1" -r 30 -sameq <output_video> |
|
- 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 prevent key passphrases to be continuously prompted for in ssh sessions (once logged in via ssh):
$ exec ssh-agent bash |
$ ssh-add |
|