Skip to content

Instantly share code, notes, and snippets.

@egabancho
egabancho / compare.py
Created June 24, 2016 13:01 — forked from astanin/compare.py
Compare two aligned images of the same size
#!/usr/bin/env python
"""Compare two aligned images of the same size.
Usage: python compare.py first-image second-image
"""
import sys
from scipy.misc import imread
from scipy.linalg import norm
@egabancho
egabancho / marc_status.py
Created May 3, 2016 14:07 — forked from kaplun/marc_status.py
Analysis tool to find the current MARC usage of an Invenio installation (to understand common values, formats and outliers)
#!/usr/bin/env python
import sys
from invenio.dbquery import run_sql
from invenio.search_engine import get_tag_name
from invenio.search_engine import get_collection_reclist
from invenio.intbitset import intbitset
collection = sys.argv[1]
@egabancho
egabancho / marc_repeatable.py
Created May 3, 2016 14:07 — forked from kaplun/marc_repeatable.py
Analysis tool to get statistics on repeatable fields and subfields of an Invenio instance
#!/usr/bin/env python
from invenio.search_engine import get_collection_reclist, get_record
from invenio.intbitset import intbitset
from click import progressbar
collection = sys.argv[1]
recids = list(get_collection_reclist(collection))
recids.reverse()

Keybase proof

I hereby claim:

  • I am egabancho on github.
  • I am egabancho (https://keybase.io/egabancho) on keybase.
  • I have a public key whose fingerprint is 6E8B 3572 0D3C 8A62 88E7 D754 0F80 9AC0 AF0D A61E

To claim this, I am signing this object:

This Gist contains the script and generated output file for an Acer B276HUL.

The pre-generated file below is known to work with:

  • OS X Mavericks
  • OS X Yosemite
  • OS X El Capitan

For El Capitan:

  1. Restart your Mac while holding Command-R: this puts your Mac into Recovery Mode.
@egabancho
egabancho / clone.rb
Created April 7, 2016 19:58 — forked from imathis/clone.rb
Clone all repositories under a user or organization
#!/usr/bin/ruby
require 'open-uri'
require 'json'
user = 'imathis'
repos = open("https://api.github.com/users/#{user}/repos") { |f|
JSON.parse(f.readlines.join)
}
@egabancho
egabancho / tmux_local_install.sh
Last active January 29, 2016 09:10 — forked from ryin/tmux_local_install.sh
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8
@egabancho
egabancho / mac_service.sh
Created July 24, 2015 14:13
Linux style service command on Mac OS X
function service {
# Needs brew services installed: brew tap homebrew/services
# $1 the service and $2 the action
# service mysql stop
# service mysql status
if [ $2 == "status" ]; then
STATUS=`brew services ls | grep --color=never $1`
if [ -n "$STATUS" ]; then
echo $STATUS
else
@egabancho
egabancho / install_master.sh
Last active August 29, 2015 14:16
WIP: Install Invenio master using virtualenv
#!/bin/bash
set -e
export WORKON_HOME=~/Work/envs
source /usr/local/bin/virtualenvwrapper.sh
#Create virtualenv and workdir
mkvirtualenv $1
cdvirtualenv
mkdir src; cd src
mkdir -p /opt/pkgs
# cmake 2.8 (for some vim plugins)
cd /opt/pkgs
wget http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz
tar -zxvf cmake-*.tar.gz
rm -f cmake-*.tar.gz
cd cmake*