Skip to content

Instantly share code, notes, and snippets.

@boostrack
boostrack / packer-aws-ami-template.json
Last active September 22, 2015 12:21 — forked from sumeetpareek/packer-aws-ami-template.json
packer template to create aws ami using ansible provisioner
{
"variables": {
"aws_access_key": "", // This helps me connect to AWS
"aws_secret_key": ""
},
"builders": [{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "us-east-1",
@boostrack
boostrack / pr.md
Created October 2, 2015 15:01 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@boostrack
boostrack / docker-cleanup
Created December 3, 2015 09:26 — forked from wdullaer/docker-cleanup
Cleanup unused Docker images and containers
#!/bin/sh
# Cleanup docker files: untagged containers and images.
#
# Use `docker-cleanup -n` for a dry run to see what would be deleted.
untagged_containers() {
# Print containers using untagged images: $1 is used with awk's print: 0=line, 1=column 1.
# NOTE: "[0-9a-f]{12}" does not work with GNU Awk 3.1.7 (RHEL6).
# Ref: https://github.com/blueyed/dotfiles/commit/a14f0b4b#commitcomment-6736470
docker ps -a | tail -n +2 | awk '$2 ~ "^[0-9a-f]+$" {print $'$1'}'
@boostrack
boostrack / install.sh
Last active December 3, 2015 09:35 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
#sudo true
## Install kernel extra's to enable docker aufs support
#sudo apt-get -y install linux-image-extra-$(uname -r)
## Add Docker PPA and install latest version
#sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
#sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@boostrack
boostrack / rest_app.py
Created April 9, 2016 18:02 — forked from subh007/rest_app.py
This is firewall udp firewall application.- Drop all the udp packets.- Allow all the other traffic.
import requests
from requests.auth import HTTPBasicAuth
from websocket import create_connection
"""
Executing the file:
$ python rest_app.py (edit the BASEURL according to the controller ip (address, port))
Steps to follow to test the code:
@boostrack
boostrack / upgrade_ovs_in_mininet.sh
Created April 9, 2016 18:02 — forked from subh007/upgrade_ovs_in_mininet.sh
Installing new version of Open vSwitch 2.3.0 use Mininet
#!/bin/sh -ev
# Reference: https://github.com/mininet/mininet/wiki/Installing-new-version-of-Open-vSwitch
# How to test: ovs-vsctl -V
# Check permission
test $(id -u) -ne 0 && echo "This script must be run as root" && exit 0
#Remove old version ovs
aptitude remove openvswitch-common openvswitch-datapath-dkms openvswitch-controller openvswitch-pki openvswitch-switch -y

KVM OSX Guest 10.11 (El Capitan) with Clover

  • Some notes about this approach:
    • An OSX Installer USB drive for Install OS X El Capitan is created
    • Clover is then installed on the USB drive
    • Clover Configurator is then run on the USB drive
    • The USB drive contents are copied to the VM host
    • VNC is used to connect to the guest UI
  • The qxl virtual video device is used (part of the standard kvm qemu install)
@boostrack
boostrack / audit.rules
Created April 21, 2018 13:22 — forked from Neo23x0/audit.rules
Linux Auditd Best Practice Configuration
# ___ ___ __ __
# / | __ ______/ (_) /_____/ /
# / /| |/ / / / __ / / __/ __ /
# / ___ / /_/ / /_/ / / /_/ /_/ /
# /_/ |_\__,_/\__,_/_/\__/\__,_/
#
# Linux Audit Daemon - Best Practice Configuration
# /etc/audit/audit.rules
#
# Compiled by Florian Roth
@boostrack
boostrack / audit.rules
Created April 21, 2018 13:23 — forked from Neo23x0/audit.rules
Linux Auditd Best Practice Configuration
# ___ ___ __ __
# / | __ ______/ (_) /_____/ /
# / /| |/ / / / __ / / __/ __ /
# / ___ / /_/ / /_/ / / /_/ /_/ /
# /_/ |_\__,_/\__,_/_/\__/\__,_/
#
# Linux Audit Daemon - Best Practice Configuration
# /etc/audit/audit.rules
#
# Compiled by Florian Roth
@boostrack
boostrack / jenkins-api.md
Created May 7, 2019 14:07 — forked from justlaputa/jenkins-api.md
Jenkins Json API

jobs

jenkins_url + /api/json?tree=jobs[name,color]

builds

jenkins_url + /job/${job_name}/api/json?tree=builds[number,status,timestamp,id,result]

last build