Skip to content

Instantly share code, notes, and snippets.

View ivanrvpereira's full-sized avatar

Ivan Pereira ivanrvpereira

  • Promptly Health Analytics
  • Portugal
View GitHub Profile
#!/usr/bin/env python
"""
A pure Python "ping" implementation, based on a rewrite by Johannes Meyer,
of a script originally by Matthew Dixon Cowles. Which in turn was derived
from "ping.c", distributed in Linux's netkit. The version this was forked
out of can be found here: https://gist.github.com/pklaus/856268
The versions this script derived from are licensed under GPL v2, this makes
mandatory that this is licensed under the same terms as well. If it were up
from base64 import b64encode
from suds.wsse import UsernameToken
try:
from haslib import sha1
except:
from sha import new as sha1
1.CentOS 6.3
#yum install make gcc
#cd /opt
$wget http://redis.googlecode.com/files/redis-2.x.xx.tar.gz
$tar zxf redis-2.x.xx.tar.gz
$cd redis-2.x.xx
$make
$make install
//////
@ivanrvpereira
ivanrvpereira / load_dim_date.sql
Last active August 29, 2015 13:57
MySQL procedure to load date dimension
DELIMITER ;;
CREATE PROCEDURE `p_load_dim_date`(
p_from_date DATE
, p_to_date DATE
)
BEGIN
DECLARE v_date DATE DEFAULT p_from_date;
DECLARE v_month tinyint;
CREATE TABLE IF NOT EXISTS dim_date (
date_key int primary key
from app import create_app
app = create_app(__name__)
@ivanrvpereira
ivanrvpereira / my.cnf
Created June 8, 2013 17:45 — forked from hacfi/my.cnf
My my.cnf of percona server on a Macbook Pro 8GB RAM
[mysql]
port = 3306
socket = /usr/local/var/run/mysql.sock
[mysqld]
#user = mysql
default_storage_engine = InnoDB
socket = /usr/local/var/run/mysql.sock
pid_file = /usr/local/var/run/mysql.pid
@ivanrvpereira
ivanrvpereira / wsgi .py
Created February 28, 2013 16:20
Flask + flask-empty + Application factories + uwsgi + ngnix
from main import app_factory
import config
app = app_factory(config.Dev)
echo $(date +"%d.%b %H:%M:%S") empty cache directory, so we have optimal importperformance.
rm -rf /path/to/magento/var/cache/
@ivanrvpereira
ivanrvpereira / gist:2626719
Created May 7, 2012 08:45 — forked from gf3/gist:328089
iTerm Colours
Black: 0, 0, 0
Red: 229, 34, 34
Green: 166, 227, 45
Yellow: 252, 149, 30
Blue: 196, 141, 255
Magenta: 250, 37, 115
Cyan: 103, 217, 240
White: 242, 242, 242