Skip to content

Instantly share code, notes, and snippets.

from YourProjectName import settings
import datetime
_unit = dict(
s=1,
m=60,
h=3600,
d=86400,
)
@jackyyf
jackyyf / generate.php
Created July 3, 2014 09:56
OpenVPN Config Generator!
<?php
error_reporting(0);
#######################
# General Config. #
#######################
$keys_tmp_dir = '/home/freenet/keys-tmp';
$keys_dir_prefix = '/home/freenet/keys'; /* Place to store keys. */
@jackyyf
jackyyf / random-hexdump.txt
Created July 15, 2014 11:40
Multiple File Test for jackyyf/paste.py
0000000 acc1 5fde e499 8f77 a6a5 fd4a 885c 6f6c
0000010 6d85 ba0a cd85 82ff 4899 862e 8d97 0527
0000020 7766 e3c2 3459 ace5 951c 6004 a7d0 e7bb
0000030 f7f7 ec7b a39e 0e86 e075 3726 f97f 2ecf
0000040 302a 5e6a bdaa adab 72d6 4159 e150 365d
0000050 0093 5c24 d520 a4e6 e23a 2608 e7ff c2d6
0000060 6cc7 e4cf 6fb4 0553 fc9c dbfe bd15
000006e
@jackyyf
jackyyf / <stdin>
Created July 17, 2014 07:08
Gist by paste.py @ 2014-07-17 15:08:08.166829
hello world!
@jackyyf
jackyyf / <stdin>
Created July 17, 2014 07:11
Gist by paste.py @ 2014-07-17 15:10:57.127118
logger test!
@jackyyf
jackyyf / <stdin>
Created July 17, 2014 07:14
Gist by paste.py @ 2014-07-17 15:13:39.475378
Hey! It works! Come and have a try!
Paste.py: https://github.com/jackyyf/paste.py
Enjoy!
@jackyyf
jackyyf / 1-2txt
Created July 17, 2014 07:29
Gist by paste.py @ 2014-07-17 15:29:54.513074
ymuCXh4XPlPcRe0fj4micUFiqAZ9eVSaSSXr/orIibpAI8snQ1RMqENW94NOP4Z1xW+NAtNR19+N
+Xy7tmQSK3QmtXAZ1KrMVbX+Mx60RTlHLrmmpTGtYn93qE3iTxNr6rrd5EeUKM1JKtWXjYrTpvj6
OoLbjvESB/v7rgpvXqurTSsGHbi1ly4Gfzu9AMyTO3DCHz2l2h+g5xeZ3y8oOjzFcAbF5BCpkpUx
OKOpVs8EeJUg4F9OpLPDaxt/EzVQtMxaG3xu+9fGl43dBMwrsqoClswB9GI37iwdZp5DD3Iz4Nfc
aMro0ySincnHWn0vH/XfqVcqcQkg8u7Ud2whFA==
@jackyyf
jackyyf / ncopy.ys
Created July 20, 2014 05:56
Gist by paste.py @ 2014-07-20 13:56:54.026013
#/* $begin ncopy-ys */
##################################################################
# ncopy.ys - Copy a src block of len ints to dst.
# Return the number of positive ints (>0) contained in src.
#
# Include your name and ID here.
#
# 1. DO NOT CREATE A NEW STACK.
# 2. Use a loop of 16 x 4.
# 3. Use two branch to save one jump.
@jackyyf
jackyyf / lim.sh
Created July 25, 2014 17:50
Gist by paste.py @ 2014-07-26 01:50:04.495803
#!/bin/bash
# ==============================================================
# CPU limit daemon - set PID's max. percentage CPU consumptions
# ==============================================================
# Variables
CPU_LIMIT=3 # Maximum percentage CPU consumption by each PID
DAEMON_INTERVAL=3 # Daemon check interval in seconds
BLACK_PROCESSES_LIST="sshd" # Limit only processes defined in this variable. If variable is empty (default) all violating processes are limited.
WHITE_PROCESSES_LIST= # Limit all processes except processes defined in this variable. If variable is empty (default) all violating processes are limited.
@jackyyf
jackyyf / stress.py
Created August 5, 2014 07:02
Gist by paste.py @ 2014-08-05 15:02:45.794858
CNT = 0
LIM = 4000
Alive = 0
MEMBER = range(1, 23)
TimeCost = dict()
StatusCode = dict()
ConCurrent = 100
Debug = False
from tornado.httpclient import AsyncHTTPClient, HTTPClient, HTTPRequest