Skip to content

Instantly share code, notes, and snippets.

View OmeGak's full-sized avatar
🌀
Rewriting history

Alejandro Avilés OmeGak

🌀
Rewriting history
View GitHub Profile
@ThiefMaster
ThiefMaster / python.post-checkout.sh
Last active August 29, 2015 14:06
post-checkout githook which cleans up all pyc/pyc/__pycache__ files/folders. to enable, save as post-checkout in .git/hooks and chmod +x
#!/bin/bash
prev_head=$1
new_head=$2
checkout_type=$3
[[ $checkout_type == '1' ]] || exit 0
[[ $prev_head == $new_head ]] && exit 0
cd "./$(git rev-parse --show-cdup)"
@OmeGak
OmeGak / cern_afs_kerberos.md
Last active April 26, 2024 21:16
Authentication at CERN made not-an-ordeal (kind of)

AFS Kerberos at CERN

"Kerberos is not the authentication system CERN deserves, but the one we need". - A wise man

This guide aims to ease the pain of setting up Kerberos authentication in your local (Ubuntu) machine and then completely forget about it.

Ready to fight?

First of all, install the following packages if you want to be successful on this journey:

@pyk
pyk / installing postgresql 9.3.2 on ubuntu 12.04.md
Created January 3, 2014 18:05
installing postgresql 9.3.2 on ubuntu 12.04 . with error fix: ummet dependencies

installing postgresql 9.3.2 on ubuntu 12.04

$ echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list
$ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install postgresql-9.3 postgresql-contrib-9.3

you should succesfully installing postgresql 9.3.2 on your machine.

@pferreir
pferreir / .gitconfig
Last active December 20, 2015 20:49
# Add to project-level .git/config
[wip]
public = name-of-your-github-remote
# Add to global .gitconfig
[wip]
webhook = http://indicotest1.cern.ch:8000/wip/notification/
[alias]
push-wip = "!pushit() { export BRANCH=\"$(git-rev-parse --symbolic-full-name --abbrev-ref HEAD)\"; export REMOTE=\"$(git config --get wip.public)\"; export WEB_HOOK=\"$(git config --get wip.webhook)\" ; git-push $REMOTE $1 \"$BRANCH:wip/$BRANCH\" 2>&1 | tee /dev/tty | grep -q 'To ' && curl -sS $WEB_HOOK --data-urlencode \"branch=$BRANCH\" --data-urlencode \"name=$(git config --get user.name)\" --data-urlencode \"remote=`git remote show -n $REMOTE | sed -n 2p | sed 's/.*[:\\/]\\([a-zA-Z0-9\\-]*\\)\\/\\(.*\\)\\.git/\\1\\/\\2/'`\" > /dev/null ;}; pushit"
def undo_changes(after):
root = dbi.getInstance().getDBConnection().root()
db = root._p_jar.db()
undo_data = [obj for obj in db.undoInfo(last=-1000) if obj['time'] >= after]
for entry in undo_data:
db.undo(entry['id'])
dbi.commit()
@pferreir
pferreir / test.py
Created July 4, 2013 08:13
PySCSS example
import logging
from scss import Scss, config
logging.basicConfig(level=logging.DEBUG)
config.LOAD_PATHS = ['ext_modules/compass/frameworks/compass/stylesheets/']
c = Scss(scss_opts={'compress': False})
@OmeGak
OmeGak / git-failed-to-push.sh
Last active October 27, 2021 18:02
Fix for cleaning a repository when: "error: Couldn't set refs/heads/branchName"
# Solves:
# error: Couldn't set refs/heads/branchName
# To X:xxx.git
# ! [remote rejected] branchName -> branchName (failed to write)
# error: failed to push some refs to 'X:xxx.git'
git fsck --unreachable
git reflog expire --expire=0 --all
git repack -a -d -l
git prune
@dmur
dmur / MIT LICENSE
Created July 19, 2012 21:46
Attractively wrapped 80-col MIT license
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
@in5ikt
in5ikt / versioning-your-saves.md
Created February 8, 2011 22:44
Minecraft - Versioning your saves

Minecraft - Versioning your saves

This is a tutorial show how to version your saves using Git.

Q: Why would anyone go through this process?
A: Because if you do, you can undo an otherwise un-undoable action, such as swimming in a pit of lava and accidentally dropping your Notch armpit forged special edition diamond pickaxe and your 35 stacks of cobblestone.

Step by step tutorial

Download and install the appropriate version of Git