Skip to content

Instantly share code, notes, and snippets.

View rtfpessoa's full-sized avatar

Rodrigo Fernandes rtfpessoa

View GitHub Profile
@rtfpessoa
rtfpessoa / 1.README.md
Last active January 27, 2016 09:32 — forked from varemenos/1.README.md

Get Git log in JSON format

git log --pretty=format:'{%n  "commit": "%H",%n  "abbreviated_commit": "%h",%n  "tree": "%T",%n  "abbreviated_tree": "%t",%n  "parent": "%P",%n  "abbreviated_parent": "%p",%n  "refs": "%D",%n  "encoding": "%e",%n  "subject": "%s",%n  "sanitized_subject_line": "%f",%n  "body": "%b",%n  "commit_notes": "%N",%n  "verification_flag": "%G?",%n  "signer": "%GS",%n  "signer_key": "%GK",%n  "author": {%n    "name": "%aN",%n    "email": "%aE",%n    "date": "%aD"%n  },%n  "commiter": {%n    "name": "%cN",%n    "email": "%cE",%n    "date": "%cD"%n  }%n},'

The only information that aren't fetched are:

  • %B: raw body (unwrapped subject and body)
  • %GG: raw verification message from GPG for a signed commit
@rtfpessoa
rtfpessoa / boot2docker-init.sh
Last active August 29, 2015 14:26
boot2docker init script for OS X
#!/bin/bash
#
# boot2docker init OS X
#
FORCE=${1-true}
USERS="/Users"
VAR="/var/folders"
@rtfpessoa
rtfpessoa / .zpreztorc
Last active August 29, 2015 14:26
Prezto Configuration
#
# Sets Prezto options.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
#
# General
#
@rtfpessoa
rtfpessoa / docker-toolbox-init.sh
Last active April 28, 2016 11:55
Docker Toolbox init script for OS X
#!/bin/bash
#
# Docker toolbox init OS X
#
FORCE=${1-true}
USERS="/Users"
VAR="/var/folders"
@rtfpessoa
rtfpessoa / agnoster.bash
Last active September 18, 2020 14:07
Agnoster Bash Theme
#!/usr/bin/env bash
# vim: ft=bash ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for BASH
#
# (Converted from ZSH theme by Kenny Root)
# https://gist.github.com/kruton/8345450
#
# Updated & fixed by Erik Selberg erik@selberg.org 1/14/17
@rtfpessoa
rtfpessoa / docker-sg-command.sh
Last active January 10, 2016 18:01
Docker group change without reload shell
#!/bin/bash
# Execute docker command without need to kill shell after changing groups
sudo userdel docker || echo "Success"
sudo groupdel docker || echo "Success"
sudo groupadd -g 2004 docker
sudo adduser --disabled-password --gecos "" --uid 2004 --gid 2004 docker
sudo gpasswd -a docker docker
sudo gpasswd -a $USER docker
sudo su -c 'sudo service docker restart' -s /bin/bash $USER
@rtfpessoa
rtfpessoa / prompt_rtfpessoa_setup
Last active August 24, 2016 23:44
rtfpessoa's agnoster theme prezto (zsh)
# vim:ft=zsh ts=2 sw=2 sts=2
#
# rtfpessoa's Theme - https://gist.github.com/rtfpessoa/9737c2d0d3b5fe5aa2e8
# Inspired by the original agnoster from https://github.com/agnoster/agnoster-zsh-theme
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://gist.github.com/1595572).
@rtfpessoa
rtfpessoa / nvidia-shield-flash-recovery.sh
Created August 22, 2015 12:50
Nvidia Shield Recovery Script
#!/bin/bash
dir=$1
[[ -z dir ]] && echo "Missing bins dir!"
fastboot flash recovery {dir}/recovery.img
fastboot flash boot {dir}/boot.img
fastboot flash system {dir}/system.img
fastboot flash userdata {dir}/userdata.img
@rtfpessoa
rtfpessoa / docker-uninstall.sh
Created August 29, 2015 15:11
Docker uninstall script
#!/bin/bash
# Uninstall Script
if [ "${USER}" != "root" ]; then
echo "$0 must be run as root!"
exit 2
fi
while true; do
@rtfpessoa
rtfpessoa / docker-run-timeout.sh
Last active September 7, 2015 17:20
Docker run timeout
#!/bin/bash
DOCKER_TIMEOUT=$1
shift
CONTAINER=$(docker run -d "$@")
docker stop --time=900 $CONTAINER
EXIT_CODE=$(docker wait $CONTAINER)