This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo yum install gcc-c++ pcre-dev pcre-devel zlib-devel make gd-devel perl-ExtUtils-Embed | |
wget https://github.com/pagespeed/ngx_pagespeed/archive/release-1.5.27.1-beta.zip | |
unzip release-1.5.27.1-beta.zip | |
get http://nginx.org/download/nginx-1.4.0.tar.gz | |
tar -xvzf nginx-1.4.0.tar.gz | |
cd nginx-1.4.0 | |
./configure --add-module=$HOME/ngx_pagespeed-release-1.5.27.1-beta --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/var/run/nginx.pid --lock-path=/var/lock/subsys/nginx --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-ht |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import csv | |
import cStringIO | |
import codecs | |
class DictUnicodeWriter(object): | |
def __init__(self, f, fieldnames, dialect=csv.excel, encoding="utf-8", **kwds): | |
# Redirect output to a queue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###################################################################### | |
# CURRENT AWARE LOCAL DATETIME | |
###################################################################### | |
from datetime import datetime | |
from tzlocal import get_localzone | |
local_tz = get_localzone() | |
local_dt = datetime.now(local_tz) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo yum -y install hg ncurses-devel python-devel gcc-c++ | |
# hg clone https://vim.googlecode.com/hg/ vim | |
git clone https://github.com/vim/vim.git vim | |
cd vim | |
hg update default | |
./configure --with-features=huge \ | |
--disable-selinux \ | |
--enable-multibyte \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Needs a larger machine, with at least 2GB Ram, say a m2.xlarge! | |
sudo yum install \ | |
gcc make python-devel libffi-devel lib-sqlite3-devel pkgconfig \ | |
zlib-devel bzip2-devel ncurses-devel expat-devel \ | |
openssl-devel gc-devel python-sphinx python-greenlet tcl-devel | |
wget https://bitbucket.org/pypy/pypy/downloads/pypy-2.1-beta-src.tar.bz2 | |
tar -xvf pypy-2.1-beta-src.tar.bz2 | |
cd pypy-2.1-beta-src |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# support for pillow | |
yum install libX11-devel | |
wget http://prdownloads.sourceforge.net/tcl/tcl8.4.20-src.tar.gz | |
tar -xvf tcl8.4.20-src.tar.gz | |
cd tcl8.4.20/unix/ | |
./configure && make -j4 && sudo make install | |
cd ~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
''' | |
''' | |
try: | |
import requests | |
except ImportError: | |
print 'You need to install "requests". Run "pip install requests" ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Requeriments: | |
$ sudo pip install boto dnspython | |
Edit ~/.boto to use your AWS credentials | |
""" | |
import time | |
import sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ncurses C++ | |
* | |
* A general purpose example of using ncurses in C++ e.g. with STL strings. | |
* I guess whatever license ncurses uses applies, otherwise public domain. | |
*/ | |
# include <algorithm> | |
# include <iostream> | |
# include <fstream> | |
# include <iterator> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
// clang++ -Wno-c++11-extensions yield.cpp;./a.out | |
class range { | |
private: | |
int last; | |
int iter; | |
bool finished; |