Skip to content

Instantly share code, notes, and snippets.

View int64ago's full-sized avatar
🎯
Focusing

Cody Chan int64ago

🎯
Focusing
View GitHub Profile
@int64ago
int64ago / topy
Created April 7, 2015 02:33
Monitor script for Gateway
alias topy='tmux attach -t topy || tmux new-session -s topy -d "htop" \; rename-window htop \; split-window -v -p 50 "nload -u K" \; attach -t topy'
@int64ago
int64ago / source.list
Created April 7, 2015 02:40
source.list for ubuntu14.04
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
@int64ago
int64ago / extract.py
Created May 31, 2015 05:26
Extract Money & Jetton info from replay.txt
#!/usr/bin/python
import sys, re, StringIO, json
data = {'data': []}
def findPlayer(_id):
for player in data['data']:
if player['name'] == _id:
return player
@int64ago
int64ago / npmsettings.sh
Last active January 14, 2016 11:52
npm settings
#!/bin/bash
mkdir $HOME/.npm-global
npm config set prefix $HOME/.npm-global
echo 'PATH=$PATH:/home/int64ago/.npm-global/bin' >> ~/.bashrc
source ~/.bashrc
npm config set registry https://registry.npm.taobao.org
npm config set disturl https://npm.taobao.org/dist
@int64ago
int64ago / pkrank.py
Created June 10, 2015 06:08
Huawei PK rank statistics
#!/usr/bin/python
# -*- encoding: utf-8 -*-
import os, sys, tarfile, tempfile, re
try:
tar = tarfile.open(sys.argv[1], 'r:gz')
tar.extractall(tempfile.gettempdir())
dirname = os.path.join(tempfile.gettempdir(),
os.path.basename(sys.argv[1])[:-len('.tar.gz')])
@int64ago
int64ago / google_ips
Created June 16, 2015 15:19
Google IPs
74.14.192.0/18
216.58.192.0/19
216.239.32.0/19
64.233.160.0/19
66.249.80.0/20
72.14.192.0/18
209.85.128.0/17
66.102.0.0/20
74.125.0.0/16
64.18.0.0/20
* * * * * PHANTOMJS_EXECUTABLE=/usr/local/bin/phantomjs /usr/local/bin/casperjs /var/www/javascript/uat/prime.js 2>&1

To install tcptraceroute on Debian/Ubuntu:

$ sudo apt-get install tcptraceroute

To install tcptraceroute on CentOS/REHL, first set up RepoForge on your system, and then:

$ sudo yum install tcptraceroute
@int64ago
int64ago / compare.js
Created December 29, 2015 06:08 — forked from alexey-bass/compare.js
JavaScript version compare
/**
* Simply compares two string version values.
*
* Example:
* versionCompare('1.1', '1.2') => -1
* versionCompare('1.1', '1.1') => 0
* versionCompare('1.2', '1.1') => 1
* versionCompare('2.23.3', '2.22.3') => 1
*
* Returns:
@int64ago
int64ago / daily_vnet.py
Last active May 18, 2021 07:26
微林【每日礼包】自动签到脚本
#!/usr/bin/python2
# -*- coding: utf-8 -*-
#
# This's an auto-sign script for vnet.link
# You should install PIL first, for Ubuntu 14.04:
# sudo apt-get build-dep python-imaging python-pip -y && pip install Pillow
#
# 12/3/2016 Cody Chan <int64ago@gmail.com>
# To support me, register from https://vnet.link/?rc=36900