Skip to content

Instantly share code, notes, and snippets.

View sanjmen's full-sized avatar
viento en popa a toda vela

Santiago Mendez sanjmen

viento en popa a toda vela
View GitHub Profile
@sanjmen
sanjmen / build
Last active March 28, 2016 01:28
openshift actions hooks for install python 2.7, virtualenv, memcached, nginx
#!/bin/bash
# This is a simple build script and will be executed on your CI system if
# available. Otherwise it will execute while your application is stopped
# before the deploy step. This script gets executed directly, so it
# could be python, php, ruby, etc.
#
# MEMCACHED SERVER
#
====================================================================
Simple-as-possible instructions to add a field (or more) using South
to an existing Django model with existing data.
====================================================================
Two versions:
1. Super-condensed (the bare minimum - jfdi)
2. Detailed-but-brief (if you want more information).
Notes:
# This is models.py for a new user profile that you would like to create.
"""
this gist gets an id from django-social-auth and based on that saves the photo from social networks into your model. This is one of the best ways to extend User model because this way, you don't need to redefine a CustomUser as explained in the doc for django-social-auth. this is a new implementation based on https://gist.github.com/1248728
"""
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.db import models
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the branch/status of the current git repository
# * the branch of the current subversion repository
# * the return value of the previous command
#
# USAGE:
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@sanjmen
sanjmen / work
Last active December 20, 2015 15:59
#!/bin/bash
APP="$1"
case $APP in
orcheeder)
cd ~/projects/orchids/fase2/
source ~/projects/orchids/orcheeder-env/bin/activate
;;
#!/bin/bash
APP="$1"
case $APP in
solr)
cd ~/projects/orcheeder/search/orchids-search
java -jar start.jar
;;
# -*- coding: utf-8 -*-
"""Management utilities."""
from fabric.contrib.console import confirm
from fabric.api import abort, env, local, settings, task, run, roles, put, cd, lcd, execute, sudo
# GLOBALS:
env.run = 'python manage.py'
env.settings = 'settings'
@sanjmen
sanjmen / gist:6256728
Created August 17, 2013 12:47
process
while :; do top -p $(pgrep -d',' mysql) -n 1 >> log.txt; date >> log.txt; sleep 1; done
while :; do top -p $(pgrep -d',' apache) -n 1 >> log.txt; date >> log.txt; sleep 1; done
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.0.deb
sudo dpkg -i elasticsearch-0.90.0.deb