Skip to content

Instantly share code, notes, and snippets.

View c0psrul3's full-sized avatar

Mike c0psrul3

View GitHub Profile
@c0psrul3
c0psrul3 / 0_reuse_code.js
Last active August 30, 2015 11:19
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
@c0psrul3
c0psrul3 / bootstrap-server.sh
Created April 15, 2016 19:38 — forked from larrybolt/bootstrap-server.sh
Bootstrap server to use with ansible
#!/usr/bin/env bash
if [ $# -eq 0 ]; then
echo "please supply a servername: bootstrap-server.sh node.example.com"
exit 1
fi
username=`whoami`
# copy public rsa key to server for root user
read -r -p "Transfer ssh public keys to server for root? [y/N] " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then
@c0psrul3
c0psrul3 / Makefile
Created April 20, 2016 21:37 — forked from thomascube/Makefile
Roundcube release scripts
GITREMOTE=git://github.com/roundcube/roundcubemail.git
GITBRANCH=master
VERSION=1.1.0
all: clean dist dependent framework
dist: roundcubemail-git toolchain
cp -r roundcubemail-git roundcubemail-$(VERSION)
(cd roundcubemail-$(VERSION); cp composer.json-dist composer.json)
(cd roundcubemail-$(VERSION); patch -p0 < ../dist.diff)
#!/usr/local/bin/bash
# shell script hardening
set -euf -o pipefail
#
# Lets Encrypt Certificate Generator
# https://calomel.org/lets_encrypt_client.html
# lets_encrypt.sh v0.04
#
@c0psrul3
c0psrul3 / filebeat-index-template.json
Created September 12, 2016 18:09 — forked from thisismitch/filebeat-index-template.json
Filebeat configuration with comments removed
{
"mappings": {
"_default_": {
"_all": {
"enabled": true,
"norms": {
"enabled": false
}
},
"dynamic_templates": [
@c0psrul3
c0psrul3 / ELK_STACK.sh
Created September 22, 2016 12:20 — forked from aljoantony/ELK_STACK.sh
ELK
#!/bin/bash
###########
# Script install and configure ELK stack Server and can be used for adding new clients to this stack.
# Last modified 3/3/2016
# Author: Aljo Antony
###########
# Define colors in case we decide to use them
color() {
Red='\e[0;31m'
@c0psrul3
c0psrul3 / couchdb-ec2-install.sh
Created December 15, 2016 12:01 — forked from msmith/couchdb-ec2-install.sh
Set up CouchDB on EC2
#!/bin/bash
#
# This script installs and configures couchdb on a fresh Amazon Linux AMI instance.
#
# Must be run with root privileges
# Tested with Amazon Linux AMI release 2011.02.1.1 (ami-8c1fece5)
#
export BUILD_DIR="$PWD"
@c0psrul3
c0psrul3 / dos2unix.sh
Created January 26, 2017 19:25 — forked from jappy/dos2unix.sh
Shell script to convert files with CRLF to LF (Mac/Linux)
#! /bin/sh
for x
do
echo "Converting $x"
tr -d '\015' < "$x" > "tmp.$x"
mv "tmp.$x" "$x"
done
@c0psrul3
c0psrul3 / ansible.inventory_params
Created May 23, 2017 11:01 — forked from sw00/ansible.inventory_params
List of ansible inventory behaviour parameters.
ansible_ssh_host
The name of the host to connect to, if different from the alias you wish to give to it.
ansible_ssh_port
The ssh port number, if not 22
ansible_ssh_user
The default ssh user name to use.
ansible_ssh_pass
The ssh password to use (this is insecure, we strongly recommend using --ask-pass or SSH keys)
ansible_sudo_pass
The sudo password to use (this is insecure, we strongly recommend using --ask-sudo-pass)
@c0psrul3
c0psrul3 / mongo-ansible.py
Created May 23, 2017 11:05 — forked from DavidWittman/mongo-ansible.py
MongoDB-backed dynamic inventory script for Ansible
#!/usr/bin/env python
#
# MongoDB-backed dynamic inventory script for Ansible
# http://docs.ansible.com/intro_dynamic_inventory.html
import os
from argparse import ArgumentParser
import pymongo