Get it from the App Store.
In XCode's Preferences > Downloads you can install command line tools.
| #!/usr/bin/env python | |
| import subprocess | |
| import sys | |
| import re | |
| import urllib | |
| # Mapping of local MAC addresses to last.fm usernames | |
| MAC_ADDRESSES = { | |
| '00:00:00:00:00:00': 'lastfm_username', |
| def run_pg_fouine(): | |
| info = host_info[env.host_string] | |
| db_name = info.tags.get('Name') | |
| sudo('perl -pi -e "s/log_min_duration_statement = .*/log_min_duration_statement = 0/" /etc/postgresql/9.*/main/postgresql.conf') | |
| sudo('/etc/init.d/postgresql reload') | |
| time.sleep(30) | |
| sudo('perl -pi -e "s/log_min_duration_statement = .*/log_min_duration_statement = 500/" /etc/postgresql/9.*/main/postgresql.conf') | |
| sudo('/etc/init.d/postgresql reload') | |
| run('tail -n 100000 /var/log/postgresql/postgresql-9.*-main.log > /tmp/pgfouine.txt') | |
| run('gzip -f /tmp/pgfouine.txt') |