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
loglevel.default = "DEBUG" | |
rdeck.base = "/var/lib/rundeck" | |
rss.enabled = true | |
dataSource { | |
dbCreate = "update" | |
url = "jdbc:h2:file:/var/lib/rundeck/data/rundeckdb;MVCC=true" | |
} | |
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
PBLOC=~/projects/somewhere/addserver.yml | |
addserver() { | |
if [[ -z "$1" ]]; then | |
echo "[e] You need to give an IP for this to work. Dont use ssh-agent, since it will have precedence" | |
else | |
echo "[i] Running setup for new server, be ready to type in your root password" | |
echo "[i] Removing and re-adding the known_hosts file" | |
ssh-keygen -f "${HOME}/.ssh/known_hosts" -R $1 | |
ssh-keyscan -t rsa -H $1 >> ~/.ssh/known_hosts | |
ansible-playbook ${PBLOC} -u root -i "newserver," --extra-vars="hosts=newserver ansible_ssh_host=$1" -k |
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 socket,select | |
# -*- coding: utf-8 -*- | |
import sys, os, time, atexit | |
from signal import SIGTERM | |
class Daemon: | |
""" | |
A generic daemon class. | |
Usage: subclass the Daemon class and override the _run() method |
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 sys | |
import MySQLdb | |
import ConfigParser | |
config=ConfigParser.ConfigParser() | |
config.readfp(open('/tmp/DNS.conf')) | |
pick_list=config.get('DNS','ip') | |
hostlist=map(str,pick_list.split(',')) | |
def pingcmd(ip,port): |
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 socket,select | |
# -*- coding: utf-8 -*- | |
import sys, os, time, atexit | |
from signal import SIGTERM | |
class Daemon: | |
""" | |
A generic daemon class. | |
Usage: subclass the Daemon class and override the _run() method |
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/local/bin/python | |
import sys | |
import MySQLdb | |
import ConfigParser | |
config=ConfigParser.ConfigParser() | |
config.readfp(open('/tmp/DNS.conf')) | |
pick_list=config.get('DNS','ip') | |
hostlist=map(str,pick_list.split(',')) | |
monitor_user=config.get('check_mysql','username') |
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 | |
# Copyright Jon Berg , turtlemeat.com | |
# Modified by nikomu @ code.google.com | |
import string,cgi,time | |
from os import curdir, sep | |
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer | |
from sys import exit | |
import os # os. path |
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 pylibmc | |
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer | |
import cgi | |
import logging | |
class example(): | |
host = "" | |
server = "" | |
def __init__(self, host='10.10.93.16',port=11211): |
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
<?php | |
$size = pow(2, 16); | |
for ($key = 0, $maxKey = $size - 1; $key <= $maxKey; ++$key) | |
{ | |
$post_string = $post_string.$key . '=1' .'&'; | |
} | |
//echo $post_string, "\n"; | |
//create cURL connection | |
$curl_connection = | |
curl_init('http://127.0.0.1/a.php'); |
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 threading import Thread | |
import Queue | |
import time | |
class TaskQueue(Queue.Queue): | |
def __init__(self, num_workers=1): | |
Queue.Queue.__init__(self) | |
self.num_workers = num_workers | |
self.start_workers() |