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 / update_hooks.sh
Created January 13, 2019 22:57
Bash script to update BitBucket webhooks
#!/bin/bash
BB_ACCOUNT_NAME="robot_org"
BB_USERNAME="cleveron"
BB_PASSWORD="password"
NEW_REPO_HOOK_ID="a1b2c3d4e5f6"
declare -a repositoryList=( "package_manifest" )
@srkiNZ84
srkiNZ84 / comma_separated_list_to_array.sh
Created January 7, 2019 03:35
comma_separated_list_to_array.sh
#!/bin/bash
CITIES="Paris, Madrid, Berlin"
IFS=', ' read -r -a citiesArray <<< "$CITIES"
for city in "${citiesArray[@]}"
do
echo "City: $city"
done
@srkiNZ84
srkiNZ84 / add_access_keys.sh
Created December 11, 2018 03:51
Script to generate and upload access keys to BitBucket repositories
#!/bin/bash
BB_ACCOUNT_NAME="john"
BB_USERNAME="doe"
BB_PASSWORD="password"
declare -a repositoryList=( "limerick-generator" )
for repository in "${repositoryList[@]}"
do
#!/bin/bash
declare -a ENVS_TO_PLAN=(test sandbox production)
for i in "${ENVS_TO_PLAN[@]}"; do
echo Planning environment: $i
cd $i
ls -al
echo Running Init for $i environment
aws-vault exec ident -- terraform init
@srkiNZ84
srkiNZ84 / geolocation.html
Created September 1, 2018 05:03
Simple Geolocation HTML example
<html>
<head>
<title>Geolocation</title>
</head>
<body>
<script>
if ("geolocation" in navigator){
console.log("Geolocation available");
navigator.geolocation.getCurrentPosition(success, error);
}
@srkiNZ84
srkiNZ84 / book.yml
Last active August 10, 2018 10:24
Simple Swagger API definition
swagger: "2.0"
info:
description: "This is a super simple swagger sample Book server"
version: "1.0.0"
title: "Swagger bookserver"
termsOfService: "http://google.com/"
contact:
email: "[email protected]"
license:
name: "Apache 2.0"
@srkiNZ84
srkiNZ84 / .gittemplate
Created June 26, 2018 08:31
Simple Git template
Subject
Description
Issue(s): None
@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 / .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 / .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