Skip to content

Instantly share code, notes, and snippets.

View aljp's full-sized avatar

Adam Jacquier-Parr aljp

  • GalaBid
  • Australia
View GitHub Profile
@aljp
aljp / bash_opt_args.sh
Created August 8, 2019 00:20
A example of parsing optional bash script arguments using a `--KEY=VALUE` syntax
# https://unix.stackexchange.com/a/353639
for ARGUMENT in "$@"
do
KEY=$(echo $ARGUMENT | cut -f1 -d=)
VALUE=$(echo $ARGUMENT | cut -f2 -d=)
case "$KEY" in
STEPS) STEPS=${VALUE} ;;
REPOSITORY_NAME) REPOSITORY_NAME=${VALUE} ;;

Keybase proof

I hereby claim:

  • I am aljp on github.
  • I am aljparr (https://keybase.io/aljparr) on keybase.
  • I have a public key ASDhavAgVs-OaXDVBnoD80khXAfk_e1opTvKl0Z_Da_3sAo

To claim this, I am signing this object:

@aljp
aljp / django-ssh-shell_plus.sh
Last active August 27, 2018 06:15
A bash script to start a local python shell connected to remote resources through ssh tunnels
#!/usr/bin/env bash
# THE SHELL ACTIVATOR
# Provide an "environment" name as the first argument to this script and it will open a python shell to the environment's web tier.
if [ -z $1 ]; then
echo "First argument must be the environment"
exit 1
fi
ENV_FILE=$1
@aljp
aljp / do-exclusive-with-vsc_tag.sh
Created July 16, 2018 05:37
Lock CircleCI builds by testing git (any vcs) tags against a regex. I use some git tag suffixes to specify deployment environment, so 1.2.3staging1 will deploy to staging, however it cannot run at the same time as 1.2.3staging2 or 1.2.4staging1.
#!/usr/bin/env bash
# I've made changes to this script so it supports a --version argument
# which can specify a regular expression for the vcs_tag property on circle
# builds.
#
# sets $branch, $tag, $rest
parse_args() {
while [[ $# -gt 0 ]]; do
#!/usr/bin/env python
"""
Basic SocketIO implementation that waits for orderbook changes from btcmarkets and enqueue's the ask/bid price data.
"""
import os
from decimal import Decimal
import re
import logging
import asyncio
@aljp
aljp / install-redis.sh
Created May 19, 2018 10:08 — forked from khelll/install-redis.sh
Installing Redis on Amazon Linux
#!/bin/bash
###############################################
# To use:
# chmod +x install-redis.sh
# ./install-redis.sh
###############################################
version=3.2.0
echo "*****************************************"
echo " 1. Prerequisites: Install updates, set time zones, install GCC and make"
@aljp
aljp / install_postgresql.sh
Created May 19, 2018 10:08 — forked from dstroot/install_postgresql.sh
Install PostgreSQL on Amazon AMI
#!/bin/bash
###############################################
# To use:
# https://raw.github.com/gist/2776351/???
# chmod 777 install_postgresql.sh
# ./install_postgresql.sh
###############################################
echo "*****************************************"
echo " Installing PostgreSQL"
echo "*****************************************"
@aljp
aljp / test.sh
Last active April 6, 2017 03:48
Run's tests and generates coverage reports for a Django Project, then opens the coverage reports
#!/bin/bash
# Author: Adam Jacquier-Parr
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m'
# Check script is being run with source
if [ "$0" = "$BASH_SOURCE" ]; then
echo -e "${RED}You must use 'source test.sh' to run this script.${NC}"
exit 1
git config --global alias.st status
git config --global alias.mff "merge --no-ff"
git config --global alias.lg "log --oneline --decorate --all --graph"
@aljp
aljp / .bash_profile
Last active October 31, 2016 03:40 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management