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
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
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/python | |
import paramiko | |
import cmd, sys, string, os | |
import argparse, threading | |
lock = threading.Lock() | |
def conn(host,user,cmd): |
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/python | |
#this script can NEVER FAIL! | |
''' | |
script to retrieve jmx related to metrics and send them to zabbix | |
''' | |
import subprocess | |
import re | |
import sys |
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 script can NEVER FAIL! | |
''' | |
This escripte will query zabbix for webscenarios, find out their ID and get the | |
status of itafterward will update the stashboard | |
KKTHXBYE | |
''' | |
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 json | |
import urllib2 | |
import socket | |
graydata = json.loads(open('/tmp/json.out').read()) | |
val = graydata['general'] | |
val["short_message"] = socket.gethostname()+ " access statistics"+" from "+val["log_file"] | |
val["host"] = socket.gethostname() | |
json_data = json.dumps(val) |
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/python | |
''' | |
get jolokia data and write a csv in a folder so it can be | |
processed by the d3 | |
''' | |
from pyjolokia import Jolokia | |
__author__ = "Ricardo Ferreira" |
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
>>> print user_metadata | |
{u'X-Object-Meta-Me': u'wrote this', 'X-Object-Meta-LOL': 'foobar'} | |
>>> print sys_metadata | |
{u'X-Object-Sysmeta-Stuff': u'system stuff'} | |
user_metadata = {} | |
sys_metadata = {} | |
for key, value in metadata.iteritems(): | |
if is_user_meta('Object',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
config wifi-device 'radio0' | |
option type 'mac80211' | |
option channel '3' | |
option hwmode '11ng' | |
option path 'platform/ar934x_wmac' | |
list ht_capab 'LDPC' | |
list ht_capab 'DSSS_CCK-40' | |
list ht_capab 'SHORT-GI-40' | |
list ht_capab 'TX-STBC' | |
list ht_capab 'RX-STBC1' |
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 subprocess | |
import re | |
USER = 'admin' | |
PASSWD = 'admin' | |
PORT = '9999' | |
HOST = '' | |
JMXSH = '/home/rsff/Theorem/jmxsh.jar' |
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 script can never fail | |
#i use it in the fish_config | |
#call it with start_agent | |
setenv SSH_ENV $HOME/.ssh/environment | |
function start_agent | |
if [ -n "$SSH_AGENT_PID" ] | |
ps -ef | grep $SSH_AGENT_PID | grep ssh-agent > /dev/null |