Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View beaufour's full-sized avatar

Allan Beaufour beaufour

View GitHub Profile
@beaufour
beaufour / connection_status.sql
Last active September 29, 2020 15:12
Postgresql: List connections and their SSL status
select pg_stat_ssl.pid, client_addr, datname, usename, application_name, ssl
from pg_stat_activity
join pg_stat_ssl
on pg_stat_activity.pid = pg_stat_ssl.pid;
@beaufour
beaufour / awsauth.sh
Last active September 28, 2020 19:16
AWS STS authenticator script
#!/bin/bash
#
# Gets a temporary token from STS and stores it in the default AWS profile.
#
# The script needs two environment variables set:
# * AWS_MFA_ARN: ARN of your MFA device (look up in IAM)
# * AWS_STS_PROFILE: aws cli user profile that allows you to call STS
#
# To use it, you also need to have two profiles in your ~/.aws/credentials file. The default and the
# one that contains your permanent access tokens. Like this for example:
@beaufour
beaufour / requirements.txt
Last active September 11, 2019 22:01
Save Speedtest.net data to InfluxDB
delegator.py==0.1.1
requests==2.22.0
@beaufour
beaufour / keybase.md
Last active February 25, 2017 19:23
Keybase verification

Keybase proof

I hereby claim:

  • I am beaufour on github.
  • I am beaufour (https://keybase.io/beaufour) on keybase.
  • I have a public key whose fingerprint is 96CC B7F1 EDDF 85F1 6263 6DF9 B449 C455 BB2F 12A7

To claim this, I am signing this object:

# hubot
#
description "Hubot chat bot"
start on filesystem or runlevel [2345]
stop on runlevel [!2345]
setuid ubuntu
setgid ubuntu
# hubot
#
description "Hubot chat bot"
start on filesystem or runlevel [2345]
stop on runlevel [!2345]
setuid ubuntu
setgid ubuntu
#!/bin/bash
# Core
export HUBOT_HIPCHAT_JID="XXXXX"
export HUBOT_HIPCHAT_PASSWORD="YYYYY"
export HUBOT_AUTH_ADMIN=ZZZZZ
export HUBOT_DIR=/home/ubuntu/ponce
# Plugins
export HUBOT_DARK_SKY_API_KEY="XXXXXX"
@beaufour
beaufour / pre-commit-runner.bash
Created April 2, 2013 13:40
A git commit hook runner, for running multiple commit scripts
#!/bin/bash
#
# Collection of pre-commit hooks
#
set -e
# Get directory of script file
ME=$0
if [ -h ${ME} ]; then
@beaufour
beaufour / todo-check.py
Created April 2, 2013 13:39
Git commit hook to check for lines with "TODO" in them
#!/usr/bin/python
import logging
import re
import sys
import envoy
def _exec_git(cmd, args=''):
cmd = 'git {0} --color=never {1}'.format(cmd, args)
[user]
name = Allan Beaufour
email = ...
[color]
ui = auto
[pack]
threads = 0