This file contains 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 os | |
import subprocess | |
import logging | |
import multiprocessing | |
import shutil | |
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO) |
This file contains 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
NAME=python27 | |
MAJOR_VERSION=2.7 | |
VERSION=2.7.6 | |
PYTHON_SOURCE=Python-$(VERSION) | |
INSTALL_DIR=/opt/python$(MAJOR_VERSION) | |
INTERMEDIATE_INSTALL_DIR=/tmp/installdir-$(NAME)-$(VERSION) | |
.PHONY: all clean package |
This file contains 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 bash | |
# Change yum mirror | |
sed -i.backup 's/^enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf | |
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup | |
wget -O /etc/yum.repos.d/CentOS-Base-163.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo | |
yum makecache | |
yum update | |
# Install ruby dependencies |
This file contains 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
PYTHON_PACKAGE_PREFIX=python27 | |
PYTHON_INSTALL_DIR=/opt/python2.7 | |
SETUPTOOLS_VER=2.2 | |
SETUPTOOLS_TARBALL=setuptools-$(SETUPTOOLS_VER).tar.gz | |
VIRTUALENV_VER=1.11.4 | |
VIRTUALENV_TARBALL=virtualenv-$(VIRTUALENV_VER).tar.gz | |
PYPI_SOURCE_MIRROR=http://pypi.douban.com/packages/source |
This file contains 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 | |
# -*- coding: utf-8 -*- | |
import os | |
import logging | |
import threading | |
import time | |
import kombu.common | |
import kombu.pools |
This file contains 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
#!/bin/bash | |
# !!path to the pip binary!! | |
PIP_BIN=/opt/python2.7/bin/pip | |
WHEEL_DIR=wheelhouse | |
DOWNLOAD_CACHE_DIR=cache | |
PIP_WHELL_REQUIREMENT="$@" |
This file contains 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
package main | |
import ( | |
"fmt" | |
"runtime" | |
) | |
func StackTrace(all bool) string { | |
// Reserve 10K buffer at first | |
buf := make([]byte, 10240) |
This file contains 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
import unicodedata | |
import sys | |
__all__ = ['UnicodeCategory', 'StringInfo'] | |
PY3K = sys.version_info[0] >= 3 | |
if PY3K: | |
unicode_type = str | |
else: |
This file contains 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 os | |
import sys | |
from optparse import make_option | |
from django.core.management.base import BaseCommand | |
from django.core.management.base import CommandError | |
from django.db import connections | |
from django.db import DEFAULT_DB_ALIAS | |
from django.db.backends import BaseDatabaseClient |
This file contains 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 docker ps -a | awk '{print $1}' | grep -v "CONTAINER" | xargs --no-run-if-empty sudo docker rm |