Skip to content

Instantly share code, notes, and snippets.

View thiagozanetti's full-sized avatar
🎯
Focusing

Thiago Zanetti thiagozanetti

🎯
Focusing
  • Itajaí, SC, Brazil
View GitHub Profile

Keybase proof

I hereby claim:

  • I am thiagozanetti on github.
  • I am thiagozanetti (https://keybase.io/thiagozanetti) on keybase.
  • I have a public key whose fingerprint is 2907 9A4D 877D 1674 09F1 75F6 9CB2 4A31 BA20 688A

To claim this, I am signing this object:

@thiagozanetti
thiagozanetti / add-apt-update-install
Created October 28, 2014 21:10
Script to automate the process of add a ppa, update the apt cache then install a program
#! /bin/sh
if [ "$(id -u)" -ne "0" ]
then
echo >&2 "Error: you must have a super-user status to use this command."
echo >&2 ""
exit
@thiagozanetti
thiagozanetti / __svn_ps1
Created August 27, 2014 18:46
Return SVN related info of a folder
#! /bin/sh
__svn_ps1() {
test -d .svn || return 1
local root url lrev arev path
url=$(svn info 2>/dev/null\
| grep -e '^URL:'\
| sed -e 's#.*: ##')
@thiagozanetti
thiagozanetti / __scm_ps1
Created August 27, 2014 18:44
Show current scm info of project folder on linux PS1
function __scm_ps1 {
local dir="$PWD"
local scm #scm system
local arev #actual revision (SVN)
local lrev #last revision (SVN)
local info #info to show
local branch #git branch hash (8 first chars)
while [[ "$dir" != "/" ]]; do
for scm in git hg svn bzr; do
if [[ -d "$dir/.$scm" ]] && hash "$scm" &>/dev/null; then