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 | |
#filename cm.sh | |
#author:wumin | |
#---Date:2011.12.29 pm--- | |
#notice:not suport kind of ubuntu and debian system.(debian not suport /dev/tcp/host/port stye ) | |
usage() { | |
format_usage="Usage:\n |
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 | |
# bash functions to autenticate and assume roles in aws federated accounts | |
# required tools on $PATH - aws, date, curl, jq, libxml2-utils | |
# requried environment variables: | |
export AWS_CLI=`which aws` | |
# optional environment variable, to automatically assume a specific role when calling assume() | |
# AWS_ASSUME_ROLE=arn:aws:iam::369407384105:role/cross-account-federated-role |
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 aliyuncms | |
import ( | |
"encoding/json" | |
"fmt" | |
"strconv" | |
"strings" | |
"sync" | |
"time" |
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 aliyuncms | |
import ( | |
"encoding/json" | |
"reflect" | |
"strconv" | |
"strings" | |
"sync" | |
"time" |
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
__author__ = "Mark Allan B. Meriales" | |
# based from http://www.pythoncentral.io/watermark-images-python-2x/ | |
# mine uses a picture as a watermark | |
from PIL import Image, ImageEnhance | |
def add_watermark(image_file, logo_file, opacity=1): | |
img = Image.open(image_file).convert('RGB') | |
logo = Image.open(logo_file) |
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 flask import Flask, request, redirect, url_for, make_response, abort | |
from werkzeug import secure_filename | |
from pymongo import Connection | |
from pymongo.objectid import ObjectId | |
from gridfs import GridFS | |
from gridfs.errors import NoFile | |
ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif']) | |
DB = Connection().gridfs_server_test | |
FS = GridFS(DB) |
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 threading import Thread | |
import Queue | |
import time | |
class TaskQueue(Queue.Queue): | |
def __init__(self, num_workers=1): | |
Queue.Queue.__init__(self) | |
self.num_workers = num_workers | |
self.start_workers() |
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
<?php | |
$size = pow(2, 16); | |
for ($key = 0, $maxKey = $size - 1; $key <= $maxKey; ++$key) | |
{ | |
$post_string = $post_string.$key . '=1' .'&'; | |
} | |
//echo $post_string, "\n"; | |
//create cURL connection | |
$curl_connection = | |
curl_init('http://127.0.0.1/a.php'); |
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 | |
import pylibmc | |
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer | |
import cgi | |
import logging | |
class example(): | |
host = "" | |
server = "" | |
def __init__(self, host='10.10.93.16',port=11211): |
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 | |
# Copyright Jon Berg , turtlemeat.com | |
# Modified by nikomu @ code.google.com | |
import string,cgi,time | |
from os import curdir, sep | |
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer | |
from sys import exit | |
import os # os. path |
NewerOlder