This file contains hidden or 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
IP=$(hostname -i) | |
RUN_DIR=/opt/rundeck | |
sudo docker run -p 4440:4440 \ | |
-e SERVER_URL=http://$IP:4440 \ | |
--name rundeck \ | |
-d \ | |
-v $RUN_DIR/etc/rundeck:/etc/rundeck \ | |
-v $RUN_DIR/var/rundeck:/var/rundeck \ | |
-v $RUN_DIR/var/lib/rundeck/.ssh:/var/lib/rundeck/.ssh \ | |
-v $RUN_DIR/var/lib/mysql:/var/lib/mysql \ |
This file contains hidden or 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, shutil | |
import datetime | |
dir_register = set() | |
def run(in_dir, out_dir): | |
for root, dirs, files in os.walk(in_dir): | |
for f in files: | |
_path = os.path.join(root, f) | |
_ctime = os.path.getmtime(_path) |
This file contains hidden or 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 sys | |
import re | |
from optparse import OptionParser | |
import json | |
hosts = { | |
'all': { |
This file contains hidden or 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
# copied from https://github.com/kylemanna/docker-openvpn | |
# to make the process runnable via a shell script | |
export OVPN_DATA="ovpn-data" | |
export SERVER_IP= | |
docker run --name $OVPN_DATA -v /etc/openvpn busybox | |
docker run --volumes-from $OVPN_DATA --rm kylemanna/openvpn ovpn_genconfig -u udp://$SERVER_IP | |
docker run --volumes-from $OVPN_DATA --rm -it kylemanna/openvpn ovpn_initpki | |
docker run --volumes-from $OVPN_DATA --rm -it kylemanna/openvpn easyrsa build-client-full USERNAME nopass | |
docker run --volumes-from $OVPN_DATA --rm kylemanna/openvpn ovpn_getclient oreh > USERNAME.ovpn |
This file contains hidden or 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 io | |
import json | |
import random | |
import avro.io | |
import avro.schema | |
schema_str='''{"namespace": "example.avro", | |
"type": "record", | |
"name": "User", | |
"fields": [ |
This file contains hidden or 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
# Use those functions to enumerate all interfaces available on the system using Python. | |
# found on <http://code.activestate.com/recipes/439093/#c1> | |
import socket | |
import fcntl | |
import struct | |
import array | |
def all_interfaces(): | |
max_possible = 128 # arbitrary. raise if needed. |
This file contains hidden or 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
apt-get update | |
apt-get install -y git build-essential linux-headers-$(uname -r) | |
mkdir -p /root/.ssh | |
chmod og-rwx /root/.ssh | |
touch /root/.ssh/authorized_keys | |
cat >> /root/.ssh/authorized_keys << EOF | |
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCrj72pssAp3W1DO59AiaNUcaVoBP55+500aTle/rm1qzbTZRqlAlIXf3oI45brrhmDPu5nDeO8B5b55lT0gfLWff96uI+o0+BAcvFaWiG60+zJt5cwCqMpLCtTLNYmmnNBXLVluKFhRYtu/EOzWLTKv3cvlzJoGmhzyfnt/bYfpMFwk65QC81kGhQaZfAoeXgvKpUTroi5R1NFfHzgrp+DPLACsrXuPi2FF0ujz2lXYRbpCSDI+BQGUf/RMnFFVWxA+SXs/Q4YrjMEngTHRNmkI5JeJQ9ieD6SS7OxM1UKu+bASdktcMTvG4lLyQz8oFVtKHkE+F+j/CVi0kmOEStx | |
EOF |
This file contains hidden or 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
setenforce 0 | |
sed -i 's/SELINUX=.*$/SELINUX=disabled/' /etc/selinux/config | |
sed -i 's/ONBOOT=.*$/ONBOOT=yes/' /etc/sysconfig/network-scripts/ifcfg-eth0 | |
yum install git vim gcc make kernel-devel-`uname -r` kernel-headers | |
iptables -F | |
chkconfig iptables off | |
mkdir -p /root/.ssh | |
chmod og-rwx /root/.ssh |
This file contains hidden or 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
"\e[A": history-search-backward | |
"\e[B": history-search-forward | |
set show-all-if-ambiguous on | |
set completion-ignore-case on | |
set bell-style none |