Skip to content

Instantly share code, notes, and snippets.

@tsmsogn
Last active December 10, 2015 20:58
Show Gist options
  • Select an option

  • Save tsmsogn/4491500 to your computer and use it in GitHub Desktop.

Select an option

Save tsmsogn/4491500 to your computer and use it in GitHub Desktop.
[shell]Snippets
convert -resize 50% -crop 500x100+0+0 original.pdf clone.jpg

現在のフォルダ以下のファイルを一覧表示

find . -type f | while read fileName; do echo ${fileName}; done

現在のフォルダ以下の*.htmlを*.ctpへ変更

find . -type f -name "*.html" | while read fileName; do mv $fileName ${fileName%.html}.ctp; done
find . -name "*.html" -exec perl -i -pe 's|\s(((?!name).)*?)="body-id"| $1="products"|g' {} \;
awk '{print $1}' access-xx.log | sort | uniq | wc -l

差分系

$ diff -r dirA dirB | grep -v ^Only | vim -

メール系

Submission接続のリセット

svc -h /service/submission
fdisk -l
dd if=/dev/sdb of=/dev/sda bs=512k
echo "本文" | mail -s "件名" "tsmsogn@gmail.com"
find . -type f -exec sed -i -e "s/foo/bar/g" {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment