This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/zsh | |
| # computer activity data collection for http://jehiah.cz/one-two/ | |
| # Originally by Jehiah Czebotar. This verison by Luca Spiller. | |
| FILE="$HOME/Dropbox/activity_log/`hostname`-`date +%Y%m%d`.log" | |
| function log_activity() | |
| { | |
| local TIME=`date "+%Y-%m-%dT%H:%M:%S%z"` | |
| local IDLE=$((`/usr/sbin/ioreg -c IOHIDSystem | sed -e '/HIDIdleTime/!{ d' -e 't' -e '}' -e 's/.* = //g' -e 'q'` / 1000000000 )) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # computer activity data collection for http://jehiah.cz/one-two/ | |
| # by Jehiah Czebotar | |
| FILE="activity_log/`date +%Y%m%d`.log" | |
| function log_activity() | |
| { | |
| local UTC=`date "+%s,%Z"` | |
| local IDLE=$((`/usr/sbin/ioreg -c IOHIDSystem | sed -e '/HIDIdleTime/!{ d' -e 't' -e '}' -e 's/.* = //g' -e 'q'` / 1000000000 )) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # This script takes a photo if the computer has not been idle for longer than a period of time | |
| # it uses isightcapture from https://www.macupdate.com/app/mac/18598/isightcapture | |
| [ -z "$USER" ] && echo "missing variable \$USER " && exit 1 | |
| if [ ! -d /Users/$USER/daily_photo ]; then | |
| mkdir -p $/Users/$USER/daily_photo | |
| fi | |
| IDLE=$((`/usr/sbin/ioreg -c IOHIDSystem | sed -e '/HIDIdleTime/!{ d' -e 't' -e '}' -e 's/.* = //g' -e 'q'` / 1000000000 )) | |
| export SUDO_ASKPASS=/Users/$USER/bin/get_pass.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright Jehiah Czebotar 2013 | |
| # http://jehiah.cz/ | |
| import tornado.options | |
| import glob | |
| import os | |
| import sqlite3 | |
| import logging | |
| import datetime | |
| import csv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python | |
| """{escher} -- one-file key-value storage. | |
| What? | |
| This is a toy application to manage persistent key-value string data. | |
| The file {escher} is *both* the application and its data. | |
| When you run any of the commands below, the file will be executed and, | |
| after data change, it will rewrite itself with updated data. | |
| You can copy the file with whatever name to create multiple datasets. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "Benchmark decompression performance" | |
| from collections import namedtuple | |
| import argparse | |
| import bz2 | |
| import functools | |
| import gzip | |
| import hashlib | |
| import itertools | |
| import logging | |
| import sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # | |
| # a simple way to parse shell script arguments | |
| # | |
| # please edit and use to your hearts content | |
| # | |
| ENVIRONMENT="dev" |