Skip to content

Instantly share code, notes, and snippets.

Eric Sales esoupy

Block or report user

Report or block esoupy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@esoupy
esoupy / mkchroot.sh
Created Mar 21, 2014
Updated mkchroot.sh from rssh for Ubuntu 12.04
View mkchroot.sh
#!/bin/bash
#####################################################################
#####################################################################
##
## mkchroot.sh - set up a chroot jail.
##
## This script is written to work for Red Hat 8/9 systems and adapted to work
## on Debian systems, but may work on other systems. Or, it may not... In
## fact, it may not work at all. Use at your own risk. :)
@esoupy
esoupy / aws_ec2_manage.py
Created Dec 6, 2013
Quick boto script to start, stop, or view the status of your AWS instances
View aws_ec2_manage.py
#!/usr/bin/env python
"""
Required:
boto
IAM account credentials with EC2 instances describe,start,stop privileges
"""
import boto.ec2
import sys
@esoupy
esoupy / OpenSwan-guide
Created Nov 5, 2013
OpenSwan Install and Configuration on Ubuntu between AWS VPC's
View OpenSwan-guide
Required:
An instance accessible with an EIP from each VPC network
Unique and non-overlapping CIDR ranges
Security Group allowing each others EIP (udp: 500,4500 and icmp: echo reply)
Disable Source/Dest Check on each Openswan AWS instance
Configure Routing Tables on each VPC (add tables with associated subnets)
Remote Network A: 10.11.0.0/16 -> openswan instance id
Remote Network B: 10.10.0.0/16 -> openswan instance id
@esoupy
esoupy / redis-server
Last active Sep 11, 2018
A redis-server startup script that allows redis-server to run as a non-root user (modified from one of the many other scripts already done). Ensure that the redis files and directories in your redis.conf file has the proper permissions.
View redis-server
#!/bin/sh
#
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: 234 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis/redis.conf
# config: /etc/sysconfig/redis
# pidfile: /var/run/redis.pid
@esoupy
esoupy / mkmongolinks
Created Apr 14, 2013
Create MongoDB links in /usr/local/bin
View mkmongolinks
@esoupy
esoupy / modconfig.py
Created Jan 24, 2013
Python script to Modify a setting in a config or properties file. It will overwrite the existing assigned value or append the new variable if it isn't found.
View modconfig.py
#!/usr/bin/env python
__author__ = 'Eric Sales'
INFO="""
modconfig
Modify a setting in a config or property file.
It will overwrite the existing assignment or make an
addition if the variable isn't found."""
USAGE="""
@esoupy
esoupy / Timer.sh
Last active Dec 10, 2015
bash script Timer function. Creates a stopwatch and displays the time duration between calls.
View Timer.sh
#!/bin/bash
## Timer Function - displays the timed duration between start and stop ##
# example:
# Timer start
# Script_Cmds
# Timer stop
Timer() {
## Set a timer to display duration ##
@esoupy
esoupy / LockFile.sh
Last active Dec 10, 2015
Bash LockFile function to prevent multiple executions of the same script. Remember to include 'LockFile remove' with any script exits to prevent lingering stale lock files.
View LockFile.sh
#!/bin/bash
## LockFile function ##
# example:
# main() {
# LockFile create
# RunScriptStuff
# LockFile remove
# }
#Globals
@esoupy
esoupy / Gitd
Last active Dec 6, 2017
Git Daemon start/stop file for /etc/init.d and services (CentOS)
View Gitd
#!/bin/sh
#
# Startup/shutdown script for Git Daemon
# chkconfig: 345 56 10
#
# description: Startup/shutdown script for Git Daemon
#
. /etc/init.d/functions
DAEMON=/usr/libexec/git-core/git-daemon
@esoupy
esoupy / ec2-get-ssh
Created Aug 23, 2012
Updated ec2 public key retrieval script. Modified to not append the key if the key already exists.
View ec2-get-ssh
#!/bin/bash
# Modified to check if the already exists
# processname: ec2-get-ssh
# description: Capture AWS public key credentials for EC2 user
# Source function library
. /etc/rc.d/init.d/functions
# Source networking configuration
[ -r /etc/sysconfig/network ] && . /etc/sysconfig/network
You can’t perform that action at this time.