Skip to content

Instantly share code, notes, and snippets.

View Ham5ter's full-sized avatar
☠️
This account is Dead, Head over to: https://github.com/keyboardinterrupt/

Ham5ter Ham5ter

☠️
This account is Dead, Head over to: https://github.com/keyboardinterrupt/
View GitHub Profile
#!/bin/bash
#
# Logging to local Syslog Example for Bash Scripts
#
# Author: ham5ter@ham5ter.de
#
# todo: Make using a external syslog server an easy to configure Option
#
@Ham5ter
Ham5ter / Compile and Install libgit2 for pygit2
Last active June 13, 2016 14:03
Compile and Install libgit2 for pygit2/salt-master 2015.5.3 (Lithium) on ubuntu 14.04
# This Script/gist helps you creating a libgit2 Debian Package from Source.
# Specify the libgit2 Version you want to build here!
LIBGIT2VERSION="0.24.1"
# Install dependencies (Ubuntu 14.04):
apt-get install wget cmake libssl-dev pkg-config libcurl4-openssl-dev libssh2-1-dev libhttp-parser-dev checkinstall
# create working directory
mkdir libgit2
# dependencies
apt-get install libffi-dev python-pip python-dev python-cffi
### install libgit2 i.e. from Source
# https://gist.github.com/Ham5ter/0287710c02682cfcaf1847c28d5ca1be
###
pip install pygit2
@Ham5ter
Ham5ter / install_salt-master.sh
Created June 15, 2016 23:39
basic salt-master installation on Ubuntu 16.04
#!/bin/bash
# run with root privileges
# basic salt-master installation on Ubuntu 16.04
apt-get update
apt-get install wget -y
wget -O - https://repo.saltstack.com/apt/ubuntu/16.04/amd64/latest/SALTSTACK-GPG-KEY.pub | sudo apt-key add -
echo "deb http://repo.saltstack.com/apt/ubuntu/16.04/amd64/latest xenial main" > /etc/apt/sources.list.d/saltstack.list
apt-get update
@Ham5ter
Ham5ter / script_directory.sh
Created June 29, 2016 11:24
This sets the variable "SCRIPT_DIRECTORY" to the Path, the Script is in.
#!/bin/bash
# This sets the variable "SCRIPT_DIRECTORY" to the Path, the Script is in.
SCRIPT_DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
usage() {
cat 1>&2 <<EOF
Usage $(basename $0) [POSITIONAL_ARGUMENT] [OPTIONS]
Describe here what the script does.
-v|--verbose Make the Script verbose.
-h|--help Print this help message.
-l X|--logfile X Set the output Logfile to X
EOF
}
@Ham5ter
Ham5ter / salt-bootstrap.sh
Last active July 14, 2016 12:52
salt-bootstrap.sh
#!/bin/bash
apt-get update
apt-get install wget -y
wget -O - https://repo.saltstack.com/apt/ubuntu/14.04/amd64/latest/SALTSTACK-GPG-KEY.pub | sudo apt-key add -
echo "deb http://repo.saltstack.com/apt/ubuntu/14.04/amd64/latest trusty main" > /etc/apt/sources.list.d/saltstack.list
apt-get update
apt-get install salt-minion -y
cat << EOF > /etc/salt/minion
master: $1
EOF
# Clean up Package Management
apt-get -y remove linux-headers-$(uname -r) build-essential
apt-get -y autoremove
apt-get -y clean
# Removing DHCP leases
echo "cleaning up dhcp leases"
rm /var/lib/dhcp/*
# Make sure Udev doesn't block our network
@Ham5ter
Ham5ter / minimize.sh
Last active July 26, 2016 12:15
This
#!/bin/bash
# Zero out all the remaining Space of a Virtual Machines Filesystem for Image Creation
dd if=/dev/zero of=/EMPTY bs=1M
sync
rm -f /EMPTY
#/bin/bash
#
# This script is used to Create a User Account with SUDO Privileges!!!,
# Display the Password and force the User to change that Password upon the first Login!
#
# Version: 1.0
# Author: ham5ter@ham5ter.de
# Date: 02.08.2016