Skip to content

Instantly share code, notes, and snippets.

exiftool -d '%Y-%m-%d %H.%M.%S.jpg' "-Filename<DateTimeOriginal" *.jpg
(define-key global-map (kbd "C-0")
'(lambda ()
(interactive)
(progn (text-scale-mode 0)(buffer-face-mode 0))))
(define-key global-map (kbd "C--") 'text-scale-decrease)
(define-key global-map (kbd "C-+") 'text-scale-increase)
@osamu2001
osamu2001 / run_sha1sum_recursive.sh
Created October 11, 2012 01:52
build or check sha1 of pdf recursive
#!/bin/sh
if [ `uname` == 'Darwin' ];then
shap=shasum
shaf=.sha1.Darwin
else
shap=sha1sum
shaf=.sha1
fi
sha(){
@osamu2001
osamu2001 / zip2pdf.sh
Created January 24, 2012 05:27
zip2pdf
#!/bin/sh
i=`basename "$1" .zip`
d=`mktemp -d TEMP.XXXXXXX`
echo -n "convert ... $1"
cd ${d}
unzip ../"${i}".zip
jpeg2pdf . ../"${i}".pdf
cd ..
@osamu2001
osamu2001 / gist:1024281
Created June 14, 2011 03:53
Branch Annotations on git
#http://git.661346.n2.nabble.com/Feature-Request-Branch-Annotations-td1306251.html
$ git checkout -b hoge
$ git checkout -b desc/hoge
$ git commit --allow-empty
$ git branch
* desc/hoge
hoge
master
$ git show desc/hoge
commit a49979ab9fd5a25f1e88754fa90f922eb7b3ba01
@osamu2001
osamu2001 / wt-status.po
Created April 20, 2011 06:32
example of po
#: wt-status.c:745
msgid "Untracked"
msgstr "管理外"
@osamu2001
osamu2001 / git_status_all.sh
Created April 18, 2011 05:18
git status all repos in HDD
#! /bin/sh
TMP=`mktemp`
es -r "^\.git$"|sed -e 's/\\/\//g'|lv -Ou > $TMP
exec 3< $TMP
while read d 0<&3
do
cd "${d}"
cd ..
n=`git status|wc -l`
if [ "2" -ne $n ]
@osamu2001
osamu2001 / anything-books-config.el
Created April 12, 2011 06:54
anything-books.elをWindowsで(楽に)使う
;;http://d.hatena.ne.jp/kiwanami/20110203/1296755710
;; anything-books.elをWindowsで(楽に)使う
;; mupdfを使用すればGS要らず
(setq abks:mkcover-cmd '("c:/Gnu/mupdf/pdfdraw" "-o" thum pdf "1"))
;; ImageMagic for Windows のconvertは日本語ファイル名が扱えない
(setq abks:convert-cmd '("C:/Program Files/GraphicsMagick-1.3.12-Q16/gm.exe" "convert" "-resize" size from to))
#!/bin/zsh
#get *.tar.gz
wget -q -nd -r -l 1 http://chalow.org/src/
wget -q http://chalow.org/src/chalow-1.0rc4.tar.gz
wget -q http://chalow.org/src/chalow-1.0rc5.tar.gz
wget -q http://chalow.org/src/chalow-1.0rc6.tar.gz
wget -q http://chalow.org/src/chalow-1.0.tar.gz
rm -f index.html robots.txt
#!/bin/sh
i=`basename "$1" .pdf`
d=`mktemp -d TEMP.XXXXXXX`
echo -n "convert ... $1"
cd ${d}
#convert pdf to jpg and pbm
pdfimages -j "$1" 0
#remove padding