start new:
tmux
start new with session name:
tmux new -s myname
# coding: utf-8 | |
import random | |
cups_checksum_table = 'TRWAGMYFPDXBNJZSQVHLCKE' | |
cups_name_length = 12 | |
def gen_checksum(cupsname): | |
"""Calcula el checksum d'un CUPS.""" |
from erppeek import Client | |
import sys | |
import base64 | |
from subprocess import call | |
import time | |
#report = 'giscedata.facturacio.factura' | |
#ids = [1513047, 1513049, 1513057, 1513042] | |
#ids = [1513042] | |
report = 'account.general.ledger.cumulative' |
#!/bin/bash | |
for lib in cairo gi glib gobject gtk-2.0 pygtk.pth pygtk.py; do | |
echo "Linking $lib..."; | |
ln -s /usr/lib/python2.7/dist-packages/$lib $VIRTUAL_ENV/lib/python2.7/site-packages/$lib; | |
done |
#! /bin/sh | |
# Produce a squash-commit patch from a branch of changes | |
MASTER=$1 | |
PATCHBRANCH=$2 | |
SQUASHBRANCH="$PATCHBRANCH-squash" | |
MESSAGE=$3 | |
git checkout -b $SQUASHBRANCH $MASTER && | |
git merge --squash $PATCHBRANCH && | |
git commit -a -m "$MESSAGE" && |
# This is just a cheat sheet: | |
# On production | |
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz | |
# On local | |
scp -C production:~/database.sql.gz | |
dropdb database && createdb database | |
gunzip < database.sql.gz | psql database |
This is a quick guide to install PostgreSQL 10 - tested on Ubuntu 16.04 but likely can be used for Ubuntu 14.04 and 17.04 as well, with one minor modification detailed below.
To make life simple, remove all other versions of Postgres. Obviously not required, but again, makes life simple.
dpkg -l | grep postgres
import pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt | |
%matplotlib inline | |
# Create DataFrame from Excel | |
df = pd.read_excel('/home/ecarreras/Desktop/l.xls') | |
# Create pivot table from DataFrame |
#!/bin/bash | |
# | |
# DESCRIPTION: | |
# | |
# Set the bash prompt according to: | |
# * the active virtualenv | |
# * the branch of the current git repository | |
# * the return value of the previous command | |
# * the fact you just came from Windows and are used to having newlines in | |
# your prompts. |
Last updated March 28, 2021
There are now two ways to approach this:
This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions