Skip to content

Instantly share code, notes, and snippets.

View ellmetha's full-sized avatar

Morgan Aubert ellmetha

View GitHub Profile

Keybase proof

I hereby claim:

  • I am ellmetha on github.
  • I am ellmetha (https://keybase.io/ellmetha) on keybase.
  • I have a public key whose fingerprint is D17B 04A9 A96A 5FCB 43D9 38DF C1B4 CF7D 5E72 50BC

To claim this, I am signing this object:

@ellmetha
ellmetha / gist:a17a824ac593de4aa386
Created December 16, 2014 08:52
PostgreSQL DB on a ramfs tablespace
#!/bin/sh
sudo mount -t ramfs none /mnt/
sudo mkdir /mnt/pgdata/
sudo chown postgres:postgres /mnt/pgdata/
sudo service postgresql start
psql -d postgres -c "CREATE TABLESPACE ramfs LOCATION '/mnt/pgdata'"
psql -d postgres -c "CREATE DATABASE testdb TABLESPACE ramfs"
@ellmetha
ellmetha / install_python27_virtualenv.sh
Last active October 11, 2015 20:47
Python 2.7 & virtualenv installation on Alwaysdata
#!/bin/bash
# Python 2.7 installation
mkdir -p $HOME/.python/src
cd $HOME/.python/src
wget https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz --no-check-certificate
tar xvfz Python-2.7.6.tgz
cd Python-2.7.6
mkdir $HOME/.python/python2.7
./configure --prefix=$HOME/.python/python2.7
# -*- coding: utf-8 -*-
"""Refactor South migrations to use settings.AUTH_USER_MODEL.
Inserts a backwards-compatible code-snippet in all
your schema migration files and uses a possibly customized user
model as introduced in Django 1.5.
Please note that this has nothing to do with changing
settings.AUTH_USER_MODEL to a new model. If you do this, stuff
will very likely break in reusable apps that have their own
migration trees.
#look also
# https://github.com/dcramer/django-ratings/blob/master/djangoratings/fields.py
from django.core.exceptions import ValidationError
from django.db.models import Field, CharField
__all__ = ['MultiColumnField']
try:
from hashlib import md5
@ellmetha
ellmetha / gist:5367985
Last active March 15, 2017 18:44
A script to prepare and install a Raspbian system on a SD Card.
#!/bin/bash
# A script to prepare and install a Raspbian system on a SD Card.
#
# ellmetha - 04/2013
# Distributed under the GPL version 3 license
#
VERSION="1.0"
INIT_DIR=$PWD