Skip to content

Instantly share code, notes, and snippets.

View c0psrul3's full-sized avatar

Mike c0psrul3

View GitHub Profile
@c0psrul3
c0psrul3 / all_public_repos_to_internal.rake
Last active July 6, 2020 22:07 — forked from ptierno/all_to_private.rake
Gitlab rake task to set all project's visibility level to private (0)
#
# File: all_public_repos_to_internal.rake
# Author: https://gist.github.com/c0psrul3
# Original Author: https://gist.github.com/ptierno
# Original Gist: https://gist.github.com/ptierno/ef57a83afac4442e2a13
#
#
# Gitlab stuff
# ------------
@c0psrul3
c0psrul3 / get-latest-tag-on-git.sh
Created April 24, 2019 11:15 — forked from rponte/get-latest-tag-on-git.sh
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples
@c0psrul3
c0psrul3 / ansible_lambda.py
Created August 22, 2017 13:37 — forked from jacoelho/ansible_lambda.py
ansible lambda
#!/usr/bin/python
import ansible.inventory
import ansible.playbook
import ansible.runner
from ansible import utils
from ansible import callbacks
def run_playbook(**kwargs):
@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
@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 / 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 / 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 / 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 / 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": [
#!/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
#