Skip to content

Instantly share code, notes, and snippets.

View lowstz's full-sized avatar
🐡
专业摸鱼

Aaron Chen lowstz

🐡
专业摸鱼
View GitHub Profile
@lowstz
lowstz / README.md
Last active August 29, 2015 14:11
Customizing docker on CoreOS

4 step to upadte the dev environment with docker-web

  1. Replace the user-data file on your coreos-vagrant directory.
  2. Run command: vagrant provision
  3. Run command: vagrant reload
  4. Open the docker-web site, have fun :)

btw: upgrade the coreos to latest stable version if possible. You need a vpn to complete this task, because the googleapis site was blocked in China.

#!/bin/bash
#title :wildfly-install.sh
#description :The script to install Wildfly 8.x
#more :http://sukharevd.net/wildfly-8-installation.html
#author :Dmitriy Sukharev
#date :20140601
#usage :/bin/bash wildfly-install.sh
WILDFLY_VERSION=8.1.0.Final
WILDFLY_FILENAME=wildfly-$WILDFLY_VERSION
#!/bin/sh
# file: /root/check_3g_network.sh
LOGGER_TAG="3g_network_check"
ping -c 5 www.baidu.com > /dev/null
if [ $? -eq 0 ]; then
logger -t LOGGER_TAG "3g network is connection."
#!/usr/bin/env python
# -*- coding: utf-8 -*-
ascii_num = [214, 247, 212, 170, 180, 205, 202, 188, 207, 235, 202, \
212, 202, 212, 184, 248, 212, 219, 195, 199, 188, 196, \
208, 187, 202, 177, 181, 216, 214, 183, 181, 201, 250, \
212, 208, 180, 181, 195, 182, 224, 188, 242, 184, 212, \
161, 173, 167, 173]
t = iter(ascii_num)
server=/jnu.edu.cn/202.116.0.1
server=/07073.com/114.114.114.114
server=/10010.com/114.114.114.114
server=/100ye.com/114.114.114.114
server=/114la.com/114.114.114.114
server=/115.com/114.114.114.114
server=/120ask.com/114.114.114.114
server=/126.com/114.114.114.114
server=/126.net/114.114.114.114
server=/1616.net/114.114.114.114
@lowstz
lowstz / ip-convert.py
Created April 2, 2013 11:34
ip转换
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def ip2int(ip):
return sum(
int(i)*(256**pos)
for pos, i in enumerate(reversed( ip.split('.')))
)
def int2ip(num):
@lowstz
lowstz / README.md
Last active December 14, 2015 17:49
Download All photo from twitter user

Usage

python tw-pic.py username
@lowstz
lowstz / benchmark.md
Last active December 10, 2015 16:59
部分性能测试

测试环境 tinyvz

CPU Intel(R) Xeon(R) CPU E31220 @ 3.10GHz (共享cpu,4个逻辑核心)
内存 专用128M/突发256M
硬盘 RAID10 10G
网络 1000mbps 共享
OS Ubuntu Server 10.04 LTS
python版本 2.6.5
nginx版本 1.0.15
ApacheBench版本 2.3

@lowstz
lowstz / decode.py
Created October 19, 2012 13:28
好八卦啊,这个
#!/usr/bin/env python
# -*- coding: utf-8 -*-
s = "\u9f9a\u654f\u83f2\u540c\u90d1\u82b7\u851a\u6211\u5e94\u8be5\u4e2d\u610f\u8fb9\u4e2a\u554a\uff01\uff01\u597d\u70e6"
u = eval('u"' + s + '"')
print u
@lowstz
lowstz / homework_statistics.sh
Created August 23, 2012 03:26
简陋的作业统计
#!/bin/bash
# [usage]: homework_statistics.sh /path/to/your/student/homework/directory
#
mkdir -p ~/.homework_statistics
touch ~/.homework_statistics/result_list_$(date +%y-%m-%d-%H)
tmp_file=~/.homework_statistics/student_num_list
result_file=~/.homework_statistics/result_list_$(date +%y-%m-%d-%H)
full_file_path=$(cd $1; pwd)