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 | |
# By Hua Liang<et@everet.org> | |
host_name=$1 | |
if [ -z ${host_name} ] ; then | |
echo "hostname is empty" | |
exit | |
fi | |
echo ${host_name} |
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 logging | |
import os | |
import datetime | |
sdk_name, game_code = "sdk", "code" | |
logger = logging.getLogger('[%s][%s]' %(sdk_name, game_code)) | |
logger.setLevel(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
#!/bin/sh | |
# # m h dom mon dow user command | |
# 30 4 * * 1,3,4 root /root/backup_db.sh | |
# 41 4 * * 1,3,4 root /root/dropbox.py start | |
# 57 4 * * 1,3,4 root /root/dropbox.py stop | |
mysqldump -u root -p'password' --all-databases | gzip > /root/Dropbox/backups/mysql_bak/`date +%F`.sql.gz |
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
from subprocess import Popen, PIPE | |
output = Popen(["pmset", "-g", "assertions"], stdout=PIPE).communicate()[0] | |
def createItem(line, tag="title"): | |
return """<item arg="textEncoded"><%s>%s</%s></item>""" % (tag, line.strip(), tag) | |
def search(searchWord, tag="title"): |
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
; Made by Stupid ET <et@everet.org> | |
(progn | |
(replace-string "[opcode: 0]" "[opcode: 0 STOP_CODE]") | |
(beginning-of-buffer) | |
(replace-string "[opcode: 1]" "[opcode: 1 POP_TOP]") | |
(beginning-of-buffer) | |
(replace-string "[opcode: 2]" "[opcode: 2 ROT_TWO]") | |
(beginning-of-buffer) | |
(replace-string "[opcode: 3]" "[opcode: 3 ROT_THREE]") | |
(beginning-of-buffer) |
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
""" | |
opcode module - potentially shared between dis and other modules which | |
operate on bytecodes (e.g. peephole optimizers). | |
""" | |
__all__ = ["cmp_op", "hasconst", "hasname", "hasjrel", "hasjabs", | |
"haslocal", "hascompare", "hasfree", "opname", "opmap", | |
"HAVE_ARGUMENT", "EXTENDED_ARG"] | |
cmp_op = ('<', '<=', '==', '!=', '>', '>=', 'in', 'not in', 'is', |
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 increasing_file.py >> out.log | |
import os | |
import time | |
import sys | |
while True: | |
print "asdf" | |
sys.stdout.flush() | |
time.sleep(0.01) |
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
# 1,2,3,4,5,-1,0,1,2... | |
import signal | |
import sys | |
count = 0 | |
def signal_handler(signum, frame): | |
global count | |
count = -1 | |
print 'sig', count |
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
# print 1,2,3,4,5,-1,6,7,8... | |
import signal | |
import sys | |
count = 0 | |
def signal_handler(signum, frame): | |
global count | |
count = -1 | |
print 'sig', count |
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/python | |
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org) | |
# The author disclaims copyright to this source code. | |
import sys | |
import struct | |
import socket | |
import time | |
import select |
NewerOlder