Skip to content

Instantly share code, notes, and snippets.

View tatzyr's full-sized avatar
🍹

Tatsuya Otsuka tatzyr

🍹
View GitHub Profile
#!/bin/bash
# NOTE: based on a snippet found in somewhere in Stack Overflow
find . -type d -name .git -maxdepth 2 | while read line; do
(
cd $line/..
cwd=$(pwd)
echo "$(tput setaf 2)$cwd$(tput sgr0)"
git --no-pager grep -n -- "$@"
@moyashi
moyashi / loadaverage.rb
Last active March 20, 2016 15:24
cronで15分毎にload averageを取得して、それをgnuplotでpngのグラフに書き出すrubyスクリプト gnuplotが必要です。 sudo apt-get install gnuplot cronへの登録例(15分毎の実行) */15 * * * * /var/www/loadaverage.rb
#!/usr/bin/env ruby
# please install gnuplot
# sudo apt-get install gnuplot
# crontab
# */15 * * * * /var/www/loadaverage.rb
logname = "/var/www/loadaverage/#{Time.now.strftime('%Y%m%d')}.log"