Skip to content

Instantly share code, notes, and snippets.

View srkiNZ84's full-sized avatar

Srđan (Serge) Đukić srkiNZ84

View GitHub Profile
@srkiNZ84
srkiNZ84 / list-deployments.py
Created January 10, 2018 02:22
Python script to list Kubernetes deployments
#!/usr/bin/python
from kubernetes import client, config
# Configs can be set in Configuration class directly or using helper utility
config.load_kube_config(context="foobar")
#v1 = client.CoreV1Api()
v1 = client.AppsV1beta1Api()
print("Listing deployments with their IPs:")
@srkiNZ84
srkiNZ84 / clair_custom_values.yaml
Created February 15, 2018 20:57
Custom values for the Clair Helm chart
# Default values for clair.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
logLevel: info
insecureTls: false
image:
repository: quay.io/coreos/clair-git
tag: latest
pullPolicy: Always
@srkiNZ84
srkiNZ84 / get5XXs.py
Last active March 8, 2018 02:04
Simple python script to parse AWS ELB logs and look for HTTP 503 responses
#!/usr/bin/python
import sys
logLines = sys.stdin.readlines()
for line in logLines:
#print("line is: " + line)
tokens = line.split(" ")
#print("elb status code: " + tokens[8])
if(tokens[8].startswith("5")):
@srkiNZ84
srkiNZ84 / .vimrc
Last active June 26, 2018 08:19
My vimrc file
" vim: set ts=4 sw=4 expandtab tw=120 :
set fileformats=unix
" Use Pathogen, if available, to manage bundles
if filereadable(expand("~/.vim/autoload/pathogen.vim"))
call pathogen#infect()
endif
" Basic options --------------------------------------------------------------
@srkiNZ84
srkiNZ84 / get_logs.sh
Created May 17, 2018 10:21
SSH onto servers and grab logs from nginx
#!/bin/bash
WEBSERVERS=( 12.3.4.5
54.111.111.111 \
54.222.222.222 )
SSHKEYFILE=.ssh/server.key
for SERVER in ${WEBSERVERS[@]}; do
echo "Server is $SERVER"
@srkiNZ84
srkiNZ84 / install_iis_codedeploy.ps
Created May 27, 2018 22:58
Simple PowerShell script to install IIS and the AWS CodeDeploy agent on a Windows EC2 instance
<powershell>
Start-Transcript;
# Install IIS
Import-Module ServerManager;
Enable-WindowsOptionalFeature -Online -NoRestart -FeatureName 'IIS-WebServerRole', 'IIS-WebServer', 'IIS-ManagementConsole';
# Install CodeDeploy Agent
Import-Module AWSPowerShell;
New-Item -Path "C:\Temp" -ItemType "directory" -Force;
@srkiNZ84
srkiNZ84 / .bashrc
Created June 26, 2018 08:24
My .bashrc file
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
export BASH_CONF="bashrc"
# Some useful colours
hash _c_define > /dev/null 2>&1
if [[ $? -eq 0 ]]; then
. _c_define
@srkiNZ84
srkiNZ84 / .bash_aliases
Created June 26, 2018 08:26
My .bash_aliases file
# Most of these from: http://www.cyberciti.biz/tips/bash-aliases-mac-centos-linux-unix.html
alias ll='ls -alh'
# Directory Navigation
alias cd..='cd ..'
alias ..='cd ..'
alias ...='cd ../../'
alias ....='cd ../../../'
alias .....='cd ../../../../'
alias .4='cd ../../../../'
@srkiNZ84
srkiNZ84 / .gitconfig
Last active November 22, 2018 23:57
My .gitconfig file
[color]
ui = auto
[svn]
authorsfile = ~/.svnauthors
[alias]
st = status -uno
ci = commit
br = branch
@srkiNZ84
srkiNZ84 / .gittemplate
Created June 26, 2018 08:31
Simple Git template
Subject
Description
Issue(s): None