Skip to content

Instantly share code, notes, and snippets.

View morinap's full-sized avatar

Andrew Morin morinap

View GitHub Profile
@morinap
morinap / git-web.sh
Created May 14, 2020 14:51
Utility to get a github web URL from the command line for specific things in your repo
#!/bin/sh
set -e
get_rev()
{
ARG=$1
BLOB_COMMIT=`git rev-parse --abbrev-ref $ARG`
if [ -z "$BLOB_COMMIT" ]; then
BLOB_COMMIT=`git rev-parse $ARG`
@morinap
morinap / clean-docker-registry.py
Last active March 10, 2020 14:45
Clean Docker Images From Private Registry
import requests
import argparse
import functools
import operator
import re
MANIFEST_JSON_ACCEPT_HEADER = 'application/vnd.docker.distribution.manifest.v2+json'
class RegistryClean:
def __init__(self, registry_url, image_name, retain_count, test):
@morinap
morinap / colors_plist.py
Created January 29, 2019 13:17
Python Script to drop iTerm colors scheme over top of an Ansi Colors.plist File
#!/usr/local/bin/python
import sys
import plistlib
source_file = sys.argv[1]
dest_file = sys.argv[2]
source_dict = plistlib.readPlist(source_file)
dest_dict = plistlib.readPlist(dest_file)
@morinap
morinap / morinap.zsh-theme
Created January 21, 2019 18:46
Theme for oh-my-zsh - morinap
PROMPT='%{$fg[blue]%}%n@%m%{$reset_color%} $(git_prompt_info)%{$fg[yellow]%}[%*]%{$reset_color%}%{$fg[cyan]%}[%c]%{$reset_color%}%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b '
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}["
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""
@morinap
morinap / docker-compose.yml
Created November 22, 2017 20:51
Graylog Docker Compose
version: '2'
services:
# MongoDB: https://hub.docker.com/_/mongo/
mongo:
image: mongo:3
# Elasticsearch: https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docker.html
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:5.5.2
environment:
- http.host=0.0.0.0
@morinap
morinap / gist:10647843
Created April 14, 2014 13:28
keybase.md
### Keybase proof
I hereby claim:
* I am morinap on github.
* I am morinap (https://keybase.io/morinap) on keybase.
* I have a public key whose fingerprint is 9412 3817 8FFB D3E7 1D14 F7F3 0D30 2579 6104 61CB
To claim this, I am signing this object: