Skip to content

Instantly share code, notes, and snippets.

@tckmn
Created January 16, 2017 02:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tckmn/efa526b3cc031c78ded0cf269033490f to your computer and use it in GitHub Desktop.
Save tckmn/efa526b3cc031c78ded0cf269033490f to your computer and use it in GitHub Desktop.
density plot of pacman / alpm transactions by time of day
# license: unlicense <http://unlicense.org/>
times <- system2('bash', args=c('-c', shQuote('grep "\\[ALPM\\] transaction started" /var/log/pacman.log | cut -c 13-17')), stdout=TRUE)
times <- strtoi(substr(times, 1, 2), 10) + strtoi(substr(times, 4, 5), 10) / 60
plot(density(c(times-24, times, times+24), bw=0.3), xlim=range(0:24), xaxs="i", axes=FALSE)
axis(side=1, at=c(0:24), las=2)
box()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment