Skip to content

Instantly share code, notes, and snippets.

git config --global alias.conflicts "diff --name-only --diff-filter=U"
diff --name-only --diff-filter=U
git conflicts
@matiasherranz
matiasherranz / get_extension.py
Created September 26, 2014 15:52
Get filename extension function, using a regex.
import re
def get_extension(filename):
regex = re.compile(r'^.*?[.](?P<ext>tar\.gz|tar\.bz2|\w+)$')
return regex.match(filename).group('ext')
@matiasherranz
matiasherranz / get_extension2
Created September 26, 2014 15:54
Get filename extension function, using a regex. Keep the point.
import re
def get_extension(filename):
regex = re.compile(r'^.*?.(?P<ext>.tar\.gz|.tar\.bz2|.\w+)$')
return regex.match(filename).group('ext')
@matiasherranz
matiasherranz / gist:9a4f2a2cb2d03aced6a4
Created September 26, 2014 15:59
Get filename extension function, using a regex. Keep the point.
import re
def get_extension(filename):
regex = re.compile(r'^.*?.(?P<ext>.tar\.gz|.tar\.bz2|.\w+)$')
return regex.match(filename).group('ext')
santex@santex-VirtualBox:~/DevIT/nagios_samanage$ cat nagios.cfg
# 'notify-host-by-sam' command definition
define command{
command_name notify-host-by-sam
command_line <perl path> <script path>/sam_createcase --hostname=$HOSTNAME$ --type="$NOTIFICATIONTYPE$" --state=$HOSTSTATE$ --address=$HOSTADDRESS$ --output="$HOSTOUTPUT$" --date="$LONGDATETIME$"
}
# 'notify-service-by-sam' command definition
define command{
command_name notify-service-by-sam
function Car() {
}
Car.protoype = {
}
{
"Working Directory" : "\/Users\/matiasherranz",
"Prompt Before Closing 2" : 0,
"Selected Text Color" : {
"Green Component" : 0.8470588,
"Blue Component" : 0.4784314,
"Red Component" : 0.7607843
},
"Rows" : 25,
"Ansi 11 Color" : {
# Let's move to the proper GIT branch
git checkout $BRANCH
git pull origin $BRANCH
# Activate the virtualenv of this job
. venv/bin/activate
# Install project requirements
pip install -Ur requirements.txt