Skip to content

Instantly share code, notes, and snippets.

@alexmerser
alexmerser / gist:3244014140215f58c090
Last active September 8, 2015 22:36 — forked from welly/gist:83b3325022b9eb1a249d
Jenkins deploy script
#!/bin/bash
if [[$BRANCH == '']]; then
GIT_BRANCH = "master"
else
GIT_BRANCH = $BRANCH
if
if [ -d "/tmp/clone/"]; then
rm -rf "/tmp/clone"
@alexmerser
alexmerser / add_user.sh
Last active June 28, 2016 04:20 — forked from awd-git/add-newuser.sh
HowTo add user on ubuntu with sudo and ssh key access
if [ "$1" == '' ]; then
echo "Please add a username to the command"
exit 1;
fi
newuser=$1
# Step1) first create user account
sudo adduser $newuser
# this will ask to set a new password and some other basic account information
#!/bin/bash
# Interactive PoPToP install script on a OpenVZ VPS
# Tested on Debian 5, 6, and Ubuntu 11.04
# 2011 v1.1
# Author: Commander Waffles
# http://www.putdispenserhere.com/pptp-debian-ubuntu-openvz-setup-script/
echo "######################################################"
echo "Interactive PoPToP Install Script for OpenVZ VPS"
echo "by Commander Waffles http://www.putdispenserhere.com"
@alexmerser
alexmerser / setup-vpn.sh
Last active September 7, 2015 17:09 — forked from tomasfejfar/setup-vpn.sh
Fork of https://raw.github.com/cwaffles/ezpptp/master/ezpptp.sh Simple script to start PPTP VPN on debian I tried to fix to work on my virtual
#!/bin/bash
# Interactive PoPToP install script for an OpenVZ VPS
# Tested on Debian 5, 6, and Ubuntu 11.04
# April 2, 2013 v1.11
# Author: Commander Waffles
# http://www.putdispenserhere.com/pptp-debian-ubuntu-openvz-setup-script/
 
echo "######################################################"
echo "Interactive PoPToP Install Script for an OpenVZ VPS"
echo
@alexmerser
alexmerser / vz
Last active September 7, 2015 17:09 — forked from sata/vz
/etc/init.d/vz
#!/bin/bash
# Copyright (C) 2000-2009, Parallels, Inc. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@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")
@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 / 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 / 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 / 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