This file contains 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/bash | |
# Based on https://gist.github.com/pcworld/3198763 | |
# Mute spotify when it starts advertisement | |
# Run like this | |
# nohup bash ~/bin/spotify/mute.sh > /tmp/spotify_mute.log & | |
# Settings | |
# VAR | |
ADMUTE=0 |
This file contains 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
export AWS_PROFILE=xxxx; | |
aws ec2 describe-volumes --filters "Name=status,Values=available" --output json --profile $AWS_PROFILE| python -c "from __future__ import print_function; import json,sys;data=json.load(sys.stdin); [ print(v['VolumeId']) for v in data['Volumes']]" | xargs -n 1 -I % aws ec2 delete-volume --volume-id=% --profile $AWS_PROFILE |
This file contains 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/bash | |
# | |
# Script to remove GPG key from git-crypt | |
# | |
# It will re-initialize git-crypt for the repository and re-add all keys except | |
# the one requested for removal. | |
# | |
# Note: You still need to change all your secrets to fully protect yourself. | |
# Removing a user will prevent them from reading future changes but they will | |
# still have a copy of the data up to the point of their removal. |
This file contains 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
MONGO_DATABASE="dbname" | |
APP_NAME="dbname" | |
MONGO_HOST="127.0.0.1" | |
MONGO_PORT="27017" | |
TIMESTAMP=`date +%F-%H%M` | |
BACKUPS_DIR="/dropbox/backups/$APP_NAME" | |
BACKUP_NAME="$APP_NAME-$TIMESTAMP" | |
$MONGODUMP_PATH -d $MONGO_DATABASE |
This file contains 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
# This file has been auto-generated by i3-config-wizard(1). | |
# It will not be overwritten, so edit it as you like. | |
# | |
# Should you change your keyboard layout somewhen, delete | |
# this file and re-run i3-config-wizard(1). | |
# | |
# i3 config file (v4) | |
# | |
# Please see http://i3wm.org/docs/userguide.html for a complete reference! |
This file contains 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
#-*- coding: utf-8 -*- | |
from lxml import html | |
import requests | |
from pymongo import MongoClient | |
from pprint import pprint | |
import urllib | |
import telepot | |
from datetime import datetime |
This file contains 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
from optparse import OptionParser | |
import time | |
def fn1(): | |
print 'test' | |
if __name__ == '__main__': | |
parser = OptionParser() |
This file contains 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
class ThreadedTCPRequestHandler(SocketServer.BaseRequestHandler): | |
def handle(self): | |
logger.info({'module': 'server', 'msg': 'Client connected %s' % self.client_address[0]}) | |
cur_thread = threading.current_thread() | |
data = self.request.recv(1024) # clip input at 1Kb | |
try: | |
msg_analyser(data) | |
response = "{}: {}".format(cur_thread.name, data) |
This file contains 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
[uwsgi] | |
socket = /tmp/app.sock | |
chdir = /opt/www/app/ | |
processes = 8 | |
master = true | |
touch-reload = /opt/www/app/reload | |
plugins = python | |
module = deploy | |
callable = application | |
#virtualenv = /opt/www/app/env |
This file contains 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
from optparse import OptionParser | |
import time | |
import sys | |
def show_lcd(text): | |
print text | |
if __name__ == '__main__': | |
parser = OptionParser() |
NewerOlder