Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
#-*-coding:utf-8-*-
import urllib, json , os
from shutil import rmtree
url = 'http://yourjenkinsbaseurl/api/python?pretty=true'
jenkins_workspace_path = '/var/lib/jenkins/workspaces/'
data = eval(urllib.urlopen(url).read())
jobnames = []
#!/bin/bash
# As root ( via `sudo su -` ):
# Initialize ephemeral storage
curl https://gist.githubusercontent.com/fsultan/9936494/raw/ephemeral > /etc/init.d/ephemeral
chmod +x /etc/init.d/ephemeral
ln -s ../init.d/ephemeral /etc/rcS.d/S10ephemeral
/etc/init.d/ephemeral
ln -s /mnt/jenkins /var/jenkins
#ln -s /mnt/mongodb /var/lib/mongodb
#!/usr/bin/python
# -*- coding: utf-8
import ConfigParser
import argparse
import getpass
import os
import shlex
import subprocess
import sys
import os
import subprocess
#import argparse
import sys
from time import sleep
#parser = argparse.ArgumentParser(description='Build script for creating VM and running tests against it.')
#parser.add_argument('user', metavar='U', type=str, nargs='+',
# help='The user of the hostmachine. Required to create the VM through SSH.')
#parser.add_argument('host', metavar='H', type=str, nargs='+',
; Sample supervisor config file.
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)
;chmod=0700 ; sockef file mode (default 0700)
;chown=nobody:nogroup ; socket file uid:gid owner
;username=user ; (default is no username (open server))
;password=123 ; (default is no password (open server))
;[inet_http_server] ; inet (TCP) server disabled by default
@alexmerser
alexmerser / 0_reuse_code.js
Last active August 29, 2015 14:24
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@alexmerser
alexmerser / fabfile.py
Last active August 29, 2015 14:24 — forked from whiteinge/fabfile.py
# -*- coding: utf-8 -*-
"""MyCompany Fabric script.
* Deploy code
* Set up a local development environment
There are two ways to deploy the myrepo code:
1. :func:`deploy` will do a full virtualenv installation/update and expand a
tarball of the specified git revision (defaults to HEAD) to a timestamped
@alexmerser
alexmerser / openvpn-install.sh
Last active September 7, 2015 15:28 — forked from pir2/openvpn-install.sh
OpenVPN Server on CentOS OpenVZ VPS v2
#!/bin/bash
#OpenVPN Installer for Centos 5 & 6
#Prequisites
#Known issues Centos 6 isnt currently working due to ca.crt error
#Written by Onessa credits to Keith from SaveSrv.net for tutorial I used as base Original Tutorial > https://safesrv.net/install-openvpn-on-centos/
if [ $USER != 'root' ]
then
echo "REQUIRES ROOT"
exit 0
fi
@alexmerser
alexmerser / patch_kernel.sh
Last active September 7, 2015 17:06
Patch & Install OpenVZ Kernel & Setup IPTables Rules
#!/bin/bash
el_version="6"
kernel_major="2.6.32"
kernel_minor="279.5.1"
vz_major="042stab061"
vz_minor=".2"
echo "Fetching OpenVZ Repo..."
cd /etc/yum.repos.d
@alexmerser
alexmerser / nat-iptables
Last active September 7, 2015 17:08 — forked from bewiwi/nat-iptables
Little init file to set nat redirection with iptables
#!/bin/sh
#network param
IP=94.23.251.96
elastic=10.0.0.1
test=10.0.0.2
#nat param 'VMip,source_port,destination_port'
rules_nat+=("$elastic,1021,22")
rules_nat+=("$elastic,9200,9200")