Skip to content

Instantly share code, notes, and snippets.

View hayderimran7's full-sized avatar

Imran Hayder hayderimran7

View GitHub Profile
# create a tinycorelinux fs with custom .tcz packages
# prerequisites: apt-get install squashfs-tools, npm i nugget -g
# dl release + packages (add your packages here)
nugget http://tinycorelinux.net/6.x/x86_64/release/CorePure64-6.3.iso http://tinycorelinux.net/6.x/x86_64/tcz/{pkg-config,make,gcc,gcc_base-dev,gcc_libs-dev,gcc_libs,glibc_base-dev,linux-3.16.2_api_headers,fuse}.tcz -c
# to support compiling addons
unsquashfs -f pkg-config.tcz
unsquashfs -f make.tcz
unsquashfs -f gcc.tcz
@hayderimran7
hayderimran7 / README.md
Last active January 25, 2016 22:11 — forked from YungSang/README.md
Running Kubernetes Example on CoreOS, Part 2 with flannel (formerly Rudder)
@hayderimran7
hayderimran7 / byte-sizetuts.md
Created February 10, 2016 07:31 — forked from honkskillet/byte-sizetuts.md
A series of golang tutorials with youtube videos.
@hayderimran7
hayderimran7 / escapes.py
Created February 20, 2016 01:33 — forked from ekimekim/escapes.py
A python library of constants and utility functions for using ANSI terminal escapes.
"""
A python library of constants and utility functions for using ANSI terminal escapes.
Example usage:
>>> import escapes as e
>>> print e.FORECOLOUR(e.RED) + "this is red" + e.UNFORMAT
"""
ESC = "\033" # escape character for terminal
CSI = ESC + "[" # Control Sequence Initiator
@hayderimran7
hayderimran7 / proxy_nginx.sh
Created December 3, 2016 17:39 — forked from rdegges/proxy_nginx.sh
Create a HTTP proxy for jenkins using NGINX.
sudo aptitude -y install nginx
cd /etc/nginx/sites-available
sudo rm default
sudo cat > jenkins
upstream app_server {
server 127.0.0.1:8080 fail_timeout=0;
}
server {
listen 80;
@hayderimran7
hayderimran7 / dnsdiff.py
Created January 15, 2017 22:37 — forked from finnigja/dnsdiff.py
Script for comparing DNS lookup results across multiple resolvers
#!/usr/bin/env python
#
# DNS Result Comparison Utility
# Author: https://twitter.com/chair6
#
import argparse
import dns.resolver
import dns.rdatatype
from collections import defaultdict
@hayderimran7
hayderimran7 / kruskal.py
Created February 21, 2017 07:17 — forked from msAzhar/kruskal.py
Kruskal's Algorithm (Python)
parent = dict()
rank = dict()
def make_set(vertice):
parent[vertice] = vertice
rank[vertice] = 0
def find(vertice):
if parent[vertice] != vertice:
parent[vertice] = find(parent[vertice])
@hayderimran7
hayderimran7 / masq.sh
Created June 9, 2017 22:30 — forked from mowings/masq.sh
script to get xet xhyve working with all vpn interfaces
#!/bin/bash
interfaces=( $(netstat -in | egrep 'utun\d .*\d+\.\d+\.\d+\.\d+' | cut -d ' ' -f 1) )
rulefile="rules.tmp"
echo "" > $rulefile
sudo pfctl -a com.apple/tun -F nat
for i in "${interfaces[@]}"
do
RULE="nat on ${i} proto {tcp, udp, icmp} from 192.168.64.0/24 to any -> ${i}"
echo $RULE >> $rulefile
done
@hayderimran7
hayderimran7 / Jenkins+Script+Console.md
Created September 5, 2017 20:46 — forked from mubbashir/Jenkins+Script+Console.md
jenkins groovy scripts collection.
@hayderimran7
hayderimran7 / reuse_agent.sh
Created October 12, 2017 22:31 — forked from MarkRose/reuse_agent.sh
Reuse existing ssh-agent or start a new one
# Reuse an existing ssh-agent on login, or create a new one. Append this to your .bashrc
# I have no idea who the author of the original concept was for reusing agents. This
# version also handles the case where the agent exists but has no keys.
GOT_AGENT=0
for FILE in $(find /tmp/ssh-* -type s -user ${LOGNAME} -name "agent.[0-9]*" 2>/dev/null)
do
SOCK_PID=${FILE##*.}