Skip to content

Instantly share code, notes, and snippets.

@grewalr
grewalr / os-x-for-hackers
Created August 10, 2018 17:11 — forked from krry/os-x-for-hackers
OSX for Hackers mods
# to run this script in one step, copy/paste/execute the following:
# bash <(curl -s https://gist.github.com/krry/9263570/raw/878797c4e54f9de71137699544567c6bd2d4f6c4/os-x-for-hackers)
#!/usr/bin/env bash
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
sudo -v
@grewalr
grewalr / parse-options.sh
Created June 28, 2018 13:02 — forked from cosimo/parse-options.sh
Example of how to parse options with bash/getopt
#!/bin/bash
#
# Example of how to parse short/long options with 'getopt'
#
OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
echo "$OPTS"
#!/usr/bin/env bash
sudo yum -y update
sudo yum -y install ruby wget
cd /home/ec2-user
wget https://aws-codedeploy-eu-west-2.s3.amazonaws.com/latest/install
chmod +x ./install
sudo ./install auto
sudo service codedeploy-agent status
#!/usr/bin/env zsh
function usage {
echo "Usage: $0 [upstream_repo]";
echo "";
exit 1;
}
if [[ ${1} == "" ]]
then
val sampleDat = "XYZ_OPT_20170322.dat"
val sampleCtl = "XYZ_OPT_20170322.ctl"
val pattern = "XYZ_OPT_(\\d{8}).(\\bctl\\b|\\bdat\\b)".r