Skip to content

Instantly share code, notes, and snippets.

View btoueg's full-sized avatar

Benjamin Toueg btoueg

View GitHub Profile
@mindsocket
mindsocket / ingdirect.py
Created June 29, 2012 04:51
Munin plugin to log in to ING Direct (Australia) account and extract account balances
#!/usr/bin/env python
# -*- python -*-
#
# Plugin to track account balances on ingdirect.com.au, using selenium gymnastics to log in
#
# E.g.
# ln -s /usr/share/munin/plugins/ingdirect.py /etc/munin/plugins/ingdirect
#
# Needs (hint: pip install):
# selenium
#!/usr/bin/env python
import asyncio
import json
import random
import sys
import time
import requests
import click
import mapbox
@FZambia
FZambia / rsyslog.conf
Last active September 29, 2017 01:50
Configuring django to work with rsyslog
# rsyslog v5 configuration file
#### MODULES ####
$ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
$ModLoad imklog # provides kernel logging support (previously done by rklogd)
#$ModLoad immark # provides --MARK-- message capability
# Provides UDP syslog reception
$ModLoad imudp
import logging
l = logging.getLogger('django.db.backends')
l.setLevel(logging.DEBUG)
l.addHandler(logging.StreamHandler())
@jsmits
jsmits / flake8.xml
Last active August 2, 2018 16:52
PyCharm 3.x Flake8 Configuration XML
<toolSet name="Code Checking">
<tool name="Flake8" showInMainMenu="true" showInEditor="true" showInProject="true" showInSearchPopup="true" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<exec>
<option name="COMMAND" value="/usr/local/bin/flake8" />
<option name="PARAMETERS" value="--max-complexity 10 $FilePath$" />
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$" />
</exec>
<filter>
<option name="NAME" value="Filter 1" />
<option name="DESCRIPTION" />
#!/usr/bin/env node
const fs = require('fs')
// Change your version you want. eg: 11.8.0
var ggPlayServiceVersion = '11.8.0'
// Folder package library, find it in node_modules.
var folderLibrary = [
'react-native-onesignal',
'react-native-admob',
@aht
aht / gist:5097702
Created March 6, 2013 08:45
ansible postgres playbook with PostGIS on Ubuntu, setting up postgis_template and creating databases from this postgis_template
# Based on https://github.com/ansible/ansible/blob/devel/examples/playbooks/postgresql.yml
---
- hosts: postgres.vm
sudo: yes
tasks:
- name: ensure latest postgres & postgis packages are latest
action: apt pkg=$item update_cache=yes state=latest
with_items:
@mikeyk
mikeyk / watch_wal-e.py
Created January 16, 2013 20:24
Watch_wal-e script
#! /usr/bin/env python
from boto.ses.connection import SESConnection
import os
import sys
import subprocess
import socket
TMPFILE = '/var/run/postgresql/last-wal-archive-error-file.tmp'
if __name__ == '__main__':
@didip
didip / tornado-nginx-example.conf
Created January 30, 2011 05:19
Nginx config example for Tornado
worker_processes 2;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
}
@magopian
magopian / fix_permissions.py
Created November 19, 2013 11:00
Django admin command to "fix permissions" (create them properly for proxy models). This is needed because of the following bug in Django (not fixed as of 1.6): https://code.djangoproject.com/ticket/11154
# -*- coding: utf-8 -*-
"""Add permissions for proxy model.
This is needed because of the bug https://code.djangoproject.com/ticket/11154
in Django (as of 1.6, it's not fixed).
When a permission is created for a proxy model, it actually creates if for it's
base model app_label (eg: for "article" instead of "about", for the About proxy
model).