Skip to content

Instantly share code, notes, and snippets.

View cicorias's full-sized avatar

Shawn Cicoria cicorias

View GitHub Profile
@cicorias
cicorias / git-status.sh
Last active April 11, 2019 13:39
git status
git clone https://github.com/magicmonty/bash-git-prompt.git ~/.bash-git-prompt --depth=1
cat ~/.bashrc <<EOF
if [ -f "$HOME/.bash-git-prompt/gitprompt.sh" ]; then
GIT_PROMPT_ONLY_IN_REPO=1
source $HOME/.bash-git-prompt/gitprompt.sh
fi
EOF
@cicorias
cicorias / apt-install.sh
Last active February 19, 2019 19:41
pyenv setup debina
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl
pyenv install 3.7.2
pyenv virtualenv 3.7.2 venv-3.7.2
@cicorias
cicorias / install-rbenv-win.bat
Created February 13, 2019 02:53 — forked from nak1114/install-rbenv-win.bat
Batch for install rbenv-win (require windows Vista+)
@echo off
setlocal
rem Set your rbenv directry
set instpath="%USERPROFILE%\.rbenv-win"
rem Clone git repositry
call git clone https://github.com/nak1114/rbenv-win.git %instpath%
rem Config path
@cicorias
cicorias / networkstuff.sh
Created February 12, 2019 19:12
ubuntu cool network tools
sudo apt-get install bmon slurm tcptrack
@cicorias
cicorias / installDocker.sh
Last active February 12, 2019 16:19
docker ubuntu - again
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-common
curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg | sudo apt-key add -
sudo add-apt-repository \
@cicorias
cicorias / vsts get endpoints.sh
Created February 6, 2019 23:03
vsts get service endpoints
#!/usr/bin/env bash
pat="..."
serviceEndpointName="ago2-arm"
endpointId="66631332-2be3-46e4-b217-0c59776cc935"
echo "calling DevOps REST API"
body=$(curl --request GET \
--url $SYSTEM_TEAMFOUNDATIONCOLLECTIONURI/$SYSTEM_TEAMPROJECT/_apis/serviceendpoint/endpoints/$endpointId?api-version=5.0-preview.2 \
@cicorias
cicorias / wow.sh
Created February 6, 2019 21:45
curl and capture both stdout and http status
#creates a new file descriptor 3 that redirects to 1 (STDOUT)
exec 3>&1
# Run curl in a separate command, capturing output of -w "%{http_code}" into HTTP_STATUS
# and sending the content to this command's STDOUT with -o >(cat >&3)
HTTP_STATUS=$(curl -w "%{http_code}" -o >(cat >&3) 'http://example.com')
@cicorias
cicorias / parse_dotenv.bash
Created February 4, 2019 22:35 — forked from judy2k/parse_dotenv.bash
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@cicorias
cicorias / bash.generate.random.alphanumeric.string.sh
Created February 4, 2019 22:35 — forked from earthgecko/bash.generate.random.alphanumeric.string.sh
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@cicorias
cicorias / requirements.txt
Created January 29, 2019 22:05
my wsl pyenv
absl-py==0.7.0
astor==0.7.1
backcall==0.1.0
bleach==3.1.0
cycler==0.10.0
decorator==4.3.2
defusedxml==0.5.0
entrypoints==0.3
gast==0.2.2
grpcio==1.18.0