Skip to content

Instantly share code, notes, and snippets.

@Ttech
Created June 22, 2010 00:32
Show Gist options
  • Save Ttech/447752 to your computer and use it in GitHub Desktop.
Save Ttech/447752 to your computer and use it in GitHub Desktop.
#!/bin/bash
FILE="/srv/samba/data/irc/botters-users.txt"
DATE_START=`/bin/cat $FILE | /usr/bin/head -n1`
DATE_END=`/bin/cat ${FILE} | /usr/bin/tail -n1 | /bin/sed -e 's/01 .*/01/g'`
cat <<'EOF'
reset
set terminal png size 1024,600
#set output "users.png"
set xdata time
set timefmt "%m/%d/%Y %H:%M:%S"
set format x "%m/%d"
set xlabel "time"
set ylabel "total users (30m)"
EOF
echo "set xrange [\"`/bin/echo $DATE_START`\":\"`/bin/echo $DATE_END`\"]"
echo "set yrange [0:60]"
echo "set title \"Total Users Botters (#botters) from `/bin/echo $DATE_START | /bin/sed -e 's/ .*//g'` to `/bin/echo $DATE_END | /bin/sed -e 's/ .*//g'`\""
cat <<'EOF'
set key Left outside
set grid
set style data line
plot "/srv/samba/data/irc/botters-users.txt" using 1:3 title "Users"
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment