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
04b5d60c1db6371eec9515a8a60a2e58f0fba2cf90c1a847e8768d61ccc5b258fd468f11c4648c5966416c42fbfe946846216e5a08c9f7bf57c1fbb3eabc7810d2;haniehrajabi |
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
[user] | |
name = Saverio Proto | |
email = [email protected] | |
[core] | |
editor = vim | |
autocrlf = input | |
[color] | |
diff = auto |
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 | |
git show :group_vars/all/vault | grep ^'$ANSIBLE_VAULT' | |
export encrypted=$? | |
if [ $encrypted -ne 0 ]; then | |
echo Ansible Vault not encrypted, refusing to commit | |
exit 1 | |
fi |
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
heat_template_version: 2013-05-23 | |
description: HOT to deploy a single instance, within its network, with a floating IP | |
parameters: | |
vm_key: | |
type: string | |
label: "SSH key name (must exist)" | |
default: macsp | |
vm_flavor: |
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
#!/usr/bin/env python | |
import redis | |
r = redis.StrictRedis(host='localhost', port=6379, db=0) | |
# To debug code on a single key you can use this instead of the for loops: | |
# key = r.randomkey() | |
# Delete all keys not accessed since 'idletime' | |
for key in r.scan_iter("*"): | |
idle = r.object("idletime", key) |
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
#!/usr/bin/env python | |
""" | |
Server | |
""" | |
import SocketServer | |
import BaseHTTPServer | |
import requests | |
import os |
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
set number | |
set noai | |
set noautoindent | |
set fo= | |
set background=dark | |
syntax on | |
"set tabstop=4 shiftwidth=4 expandtab | |
set nocompatible | |
set backspace=2 | |
autocmd BufWritePre * %s/\s\+$//e |
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
import sys, os | |
i = 0 | |
print sys.argv[1] | |
f = open(sys.argv[1]) | |
for line in f.readlines(): | |
if line.startswith('---'): | |
i = i+1 | |
filename = "%02d-%s" % (i,sys.argv[1]) | |
w = open(filename,'a') | |
w.write(line) |
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
# If using bash add to ~/.inputrc | |
"\e[1;5D": backward-word | |
"\e[1;5C": forward-word | |
# If using zsh add to ~/.zprofile | |
bindkey -e | |
bindkey '^[[1;5C' forward-word |
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
#! /usr/bin/env python3 | |
import requests | |
from requests.adapters import HTTPAdapter, Retry | |
import os | |
s = requests.Session() | |
retries = Retry(total=5, | |
backoff_factor=0.1, | |
status_forcelist=[ 500, 502, 503, 504 ]) |