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
#!/bin/sh | |
ulimit -n 65536 | |
exec 2>&1 | |
create_container () { | |
echo 'try to create container' | |
sudo docker create --name 'gentoo_with_portage' \ | |
-v /usr/portage/ \ | |
-v /var/lib/layman/ \ |
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
function clear(){ | |
table=$1 | |
chain=$2 | |
iptables -t $table -L $chain -n --line-numbers -v | grep -iv 'docker' | grep '^[0-9]' | awk '{print $1}' | sort -nr | xargs -rl iptables -D $chain | |
} | |
clear filter FORWARD | |
clear nat PREROUTING | |
clear nat POSTROUTING | |
clear nat OUTPUT |
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 sys | |
import os | |
import mmap | |
def get_mmap(filepath): | |
with open(filepath, 'r+b') as f: | |
mm = mmap.mmap(f.fileno(), 0) |
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
est863@est863:/var/chemistry/code/chemistry/calcore/fordragon/Clc1ccc(cc1)C(c1ccc(Cl)cc1)C(Cl)(Cl)Cl$ cat Clc1ccc\(cc1\)C\(c1ccc\(Cl\)cc1\)C\(Cl\)\(Cl\)Cl.drs | |
No. NAME MW AMW Sv Se Sp Si Mv Me Mp Mi nAT nSK nBT nBO nBM SCBO RBN RBF nDB nTB nAB nH nC nN nO nP nS nF nCL nBR nI nB nHM nHet nX H% C% N% O% X% nCsp3 nCsp2 nCsp nCIC nCIR TRS Rperim Rbrid MCD RFDRCI NRS NNRS nR03 nR04 nR05 nR06 nR07 nR08 nR09 nR10 nR11 nR12 nBnz ARR D/Dtr03 D/Dtr04 D/Dtr05 D/Dtr06 D/Dtr07 D/Dtr08 D/Dtr09 D/Dtr10 D/Dtr11 D/Dtr12 ZM1ZM1V ZM1Kup ZM1Mad ZM1Per ZM1MulPer ZM2 ZM2V ZM2Kup ZM2Mad ZM2Per ZM2MulPer ON0 ON0V ON1 ON1V Qindex BBI DBI SNar HNar GNar Xt Dz RamBLI Pol LPRS MSD SPI PJI2 E |
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 gevent | |
import gevent.monkey | |
import urllib2 | |
import time | |
def stop(): | |
print '---start stop' |
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 sys | |
from multiprocessing import Process, Pipe | |
import traceback | |
class SubprcessException(Exception): | |
pass | |
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
#ref: http://stackoverflow.com/questions/4716533/how-to-attach-debugger-to-a-python-subproccess | |
import sys | |
import pdb | |
class ForkedPdb(pdb.Pdb): | |
"""A Pdb subclass that may be used | |
from a forked multiprocessing child | |
""" |
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 os | |
from os.path import join, exists, splitext | |
import datetime | |
import uuid | |
import string | |
import random | |
import shutil | |
TEST_DIR = '/tmp/xinxin/' |
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
$ git rebase upstream/master | |
First, rewinding head to replay your work on top of it... | |
Applying: config test for dae | |
Using index info to reconstruct a base tree... | |
M apitests/framework.py | |
M tests/test_commodity/framework.py | |
<stdin>:48: trailing whitespace. | |
dae test -p -- ilmen/apitests/ --junitxml=ilmen/reports/apitest_v2/nose.xml --cov=ilmen.view.commodity.api.v2 || RET=$? | |
warning: 1 line adds whitespace errors. | |
Falling back to patching base and 3-way merge... |
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 threading | |
import time | |
MAX = 8 | |
MIN = 0 | |
TIME_LIMIT = 60 | |
g = 0 |