Skip to content

Instantly share code, notes, and snippets.

View bionix's full-sized avatar

Markus Baumann bionix

View GitHub Profile
@bionix
bionix / ansible-dynamic-to-static.py
Created February 6, 2018 19:14 — forked from zkendall/ansible-dynamic-to-static.py
Script to convert the output of Ansible's ec2 dynamic inventory to a flat static inventory.
#!/usr/bin/env python
'''
This script converts the output of Ansible's dynamic ec2.py to a flatly formmated static inventory file.
Before running this script run `python ./ec2.py --refresh-cache > ec2-dynamic.json`
See: http://docs.ansible.com/ansible/ec2_module.html
'''
@bionix
bionix / git-standup
Created November 28, 2017 12:23 — forked from mrliptontea/git-standup
Git Daily Scrum helper
#!/bin/bash
# ------------------------------------------------------------------
# Git Daily Scrum (stand-up meeting) helper.
#
# The script helps you remember what you did last time and facilitates
# writing daily log for remote teams. Be aware that it assumes that
# meetings are conducted at the same time every day.
#
# Installation:
# 1. Place the script in some folder, e.g. your home:
@bionix
bionix / get_oracle_jdk_linux_x64.sh
Created June 12, 2017 08:37 — forked from n0ts/get_oracle_jdk_x64.sh
Get latest Oracle JDK package bash shell script
#!/bin/bash
# You must accept the Oracle Binary Code License
# http://www.oracle.com/technetwork/java/javase/terms/license/index.html
# usage: get_jdk.sh <ext> <jdk_version>
# ext: rpm
# jdk_version: default 8
ext=rpm
jdk_version=8
@bionix
bionix / wget-jdk-oracle-install-example.txt
Created June 12, 2017 08:37 — forked from sr75/wget-jdk-oracle-install-example.txt
wget command to install Oracle JAVA JDK from stupid oracle website for centos and ubuntu
http://d.stavrovski.net/blog/post/how-to-install-and-setup-oracle-java-jdk-in-centos-6
# rpm
wget --no-cookies \
--no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
"http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.rpm" \
-O jdk-7-linux-x64.rpm
# ubuntu
@bionix
bionix / awslsa
Created March 21, 2017 13:26
awslsa
#!/bin/sh
# script: awslsa
aws ec2 describe-instances --query 'Reservations[*].Instances[*].[InstanceId,State.Name,InstanceType,PrivateIpAddress,PublicIpAddress,PrivateDnsName,PublicDnsName,Tags[?Key==`Name`].Value[]]' --output json | tr -d '\n[] "' | perl -pe 's/i-/\ni-/g' | tr ',' '\t' | sed -e 's/null/None/g' | grep '^i-' | column -t
# EOF
@bionix
bionix / Vagrantfile
Created March 13, 2017 14:55
Vagrant usage behind a proxy environment
# To install the required vagrant plugin use the following command:
# $ export http_proxy ; vagrant plugin install vagrant-proxyconf --plugin-source http://rubygems.org
#
# Add or edit your file generic Vagrantfile (in place: ~/.vagrant.d/Vagrantfile)
# To apply for all your vagrant projects the HTTP-Proxy stuff
#
# Note: vagrant needs vagrant plugin vagrant-proxyconf
#
Vagrant.configure("2") do |config|
puts "proxyconf..."
# gitconfig
# git alias
# Remove branches that have already been merged with master
# a.k.a. ‘delete merged’
dm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
#!/bin/bash
# Set color output
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
for i in `ls -1` ; do echo "${green}-- Update git folder${reset} ${red}$i ${reset}${green}--${reset}" ; cd $i ; git checkout master ; git pull ; git checkout develop ; git pull ; git checkout master ; git repack -ad ; cd .. ; done
# EOF
@bionix
bionix / rules-ipv4.iptables
Last active August 29, 2015 14:26 — forked from BlackChar/rules-ipv4.iptables
Basic iptables template for ordinary servers (both IPv4 and IPv6)
###############################################################################
# Copyright 2012 Jakub Jirutka. All rights reserved.
#
# "THE KOFOLA-WARE LICENSE" (Revision 1):
# Jakub Jirutka originally wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a Kofola in return. <[email protected]>
#
###############################################################################
@bionix
bionix / find-https-debian-archives.py
Last active August 29, 2015 14:25 — forked from eighthave/find-https-debian-archives.py
Script to find official Debian mirrors that support HTTPS
#!/usr/bin/python
import urllib2
import re
import ssl
import sys
# # find generic mirrors
mirrors = urllib2.urlopen('http://www.debian.org/mirror/list')
https = []