Skip to content

Instantly share code, notes, and snippets.

View pbanderas's full-sized avatar

Pablo Banderas pbanderas

View GitHub Profile
@pbanderas
pbanderas / gitrc
Last active March 11, 2020 07:51 — forked from philcryer/gitrc
This .gitrc activates when you're in a directory that is a git repo. It tells you the branch you're on, with color handling of the bash prompt according to the branch/status. For example, the prompt would look like this: [~/foo](master) $ with (master) colored GREEN, until you've added a file to the repo, but not committed it, then it will turn …
#!/bin/bash
#
# Set your bash prompt according to the branch/status of the current git repository.
# Relies on git output being in English.
# Set an alias with
# $ echo "alias git='LANGUAGE=en_US.UTF-8 git'" >> ~/.bash_profile
#
# Forked from https://gist.github.com/philcryer/5066010
#
RED="\[\033[0;31m\]"
@pbanderas
pbanderas / install-orc-tools.sh
Last active October 17, 2019 10:35 — forked from eidosam/install-orc-tools.sh
Install Apache ORC tools
sudo add-apt-repository ppa:george-edison55/cmake-3.x
sudo apt-get update
sudo apt-get purge cmake cmake-data
sudo apt-get -y install build-essential cmake
curl -sSLO http://www.mirrorservice.org/sites/ftp.apache.org/orc/orc-1.4.1/orc-1.4.1.tar.gz
tar -zxf orc-1.4.1.tar.gz
cd orc-1.4.1
mkdir build
cd build
@pbanderas
pbanderas / cheatsheet-git.sh
Last active March 4, 2019 11:11 — forked from raineorshine/cheatsheet-git.sh
Cheatsheet: git commands
# adding and committing
git add -A # stages All
git add . # stages new and modified, without deleted
git add -u # stages modified and deleted, without new
git commit --amend # Add staged changes to previous commit. Do not use if commit has been pushed.
git commit --amend --no-edit # Do so without having to edit the commit message.
# remotes - pushing, pulling, and tracking
git fetch # gets remote objects and refs. Needed if new branches were added on the remote.
git remote -v # Lists all remotes (verbose)
@pbanderas
pbanderas / aws_dynamodb_local
Last active December 27, 2017 12:55 — forked from Cinedin/aws_dynamodb_local
Download last Local DynamoDB and execute as daemon
#!/bin/sh
#
# chkconfig: 35 99 01
# description: java application
#
if [ -z "$JRE_HOME" ]; then
JRE_HOME="$JAVA_HOME"
fi
if [ -z "$JRE_HOME" ]; then
@pbanderas
pbanderas / xfdf.php
Created September 14, 2015 10:15
HTML Form to FDF Parser for PHP
<?php
/*
KOIVI HTML Form to FDF Parser for PHP (C) 2004 Justin Koivisto
Version 1.2
Last Modified: 2011/12/02
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or (at
your option) any later version.
@pbanderas
pbanderas / vagrant-private-ip.md
Last active August 29, 2015 13:55
Vagrant error with private network IP

Occurred with Centos 6.4 installations.

After specifying a private IP address in Vagrant file, command vagrant up crashed with this error

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

/sbin/ifdown eth1 2> /dev/null