Skip to content

Instantly share code, notes, and snippets.

View wenlibin02's full-sized avatar
💭
Looking for a job :-)

wenlibin02

💭
Looking for a job :-)
View GitHub Profile
@wenlibin02
wenlibin02 / edit_filename.sh
Created October 16, 2017 03:01
A bash script for editing multiple file/dir names using a text editor (e.g. vim). Usage: edit_filename.sh file1 file2 ...
#!/usr/bin/env bash
tmpfile0="$(mktemp -t ename0_XXXXXXXX)"
tmpfile1="$(mktemp -t ename1_XXXXXXXX)"
myeditor=vim
for i in "$@"; do
if [ ! -f "$i" ]; then
echo "file $i does not exist ... exit ... "
exit 1
fi
@wenlibin02
wenlibin02 / remove-annotations.sh
Created June 20, 2017 15:01 — forked from stefanschmidt/remove-annotations.sh
Remove all annotations from a PDF document
pdftk original.pdf output uncompressed.pdf uncompress
LANG=C sed -n '/^\/Annots/!p' uncompressed.pdf > stripped.pdf
pdftk stripped.pdf output final.pdf compress