Skip to content

Instantly share code, notes, and snippets.

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"
}
@ri0day
ri0day / .profile
Last active August 29, 2015 14:18 — forked from riemers/.profile
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
@ri0day
ri0day / dns-server
Created November 2, 2011 03:32
dns-socket
#!/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
@ri0day
ri0day / check-tcp
Created November 2, 2011 03:36
checker_tcp
#!/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):
@ri0day
ri0day / dns-server.py
Created November 4, 2011 07:40
finally dns server -useable
#!/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
@ri0day
ri0day / bs.py
Created November 4, 2011 07:41
finally dns check-useable
#!/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')
@ri0day
ri0day / upload.py
Created December 7, 2011 09:14
file upload
#!/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
@ri0day
ri0day / mem.py
Created December 20, 2011 07:14
memcache http api
#/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):
@ri0day
ri0day / gist:1563407
Created January 5, 2012 02:30
php_hash_dos
<?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');
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()