Skip to content

Instantly share code, notes, and snippets.

View TimothyYe's full-sized avatar
🖋️
Creating bugs...

Timothy TimothyYe

🖋️
Creating bugs...
  • Shopee
  • Singapore
View GitHub Profile
@TimothyYe
TimothyYe / BuyVMStock.rb
Created March 30, 2012 16:49
A ruby script to check the stocks of BuyVM
#BuyVMStock.rb
#Written by Timothy 2012.03.29
#Run it with: ruby BuyVMStock.rb
require 'open-uri'
require 'json'
MailTo = "YourMailAddress@gmail.com"
def SendMailNotify(content)
@TimothyYe
TimothyYe / dnspodsh.sh
Created April 1, 2012 14:32 — forked from zrong/dnspodsh.sh
在bash中使用DNSPod的API接口实现DDNS客户端
#!/bin/bash
##############################
# dnspodsh v0.3
# 基于dnspod api构架的bash ddns客户端
# 作者:zrong(zengrong.net)
# 详细介绍:http://zengrong.net/post/1524.htm
# 创建日期:2012-02-13
# 更新日期:2012-03-11
##############################
// This hack works with com.android.tools.build:gradle:0.2, won't work in later version without modification
apply plugin: 'android'
targetCompatibility = 1.6
sourceCompatibility = 1.6
android {
target = 'android-14'
@TimothyYe
TimothyYe / .tmux.conf
Created June 19, 2014 15:17
tmux config
# 配置使用和GNU Screen相同的C-a作为命令引导键
set -g prefix C-a
# 设置终端类型为256色
set -g default-terminal "screen-256color"
# 设置状态栏前景及背景色
set -g status-bg colour23
set -g status-fg colour238
# 设置窗口标签的前景及背景色
@TimothyYe
TimothyYe / fake-service.go
Last active August 29, 2015 14:20
A fake tcp service for joking...
package main
import (
"flag"
"fmt"
"log"
"net"
"os"
)
@TimothyYe
TimothyYe / tmux.conf
Created June 25, 2015 06:07
My tmux conf file
# 配置使用和GNU Screen相同的C-a作为命令引导键
set -g prefix C-g
# 设置终端类型为256色
set -g default-terminal "screen-256color"
# Set default shell to zsh
set-option -g default-shell /bin/zsh
# 设置状态栏前景及背景色
set -g status-bg colour23
set -g status-fg colour238
@TimothyYe
TimothyYe / shadowsocks-server.service
Created May 7, 2016 12:13 — forked from dorentus/shadowsocks-server.service
wget 'https://gist.githubusercontent.com/dorentus/10704239/raw/shadowsocks-server.service' -O /etc/systemd/system/shadowsocks-server.service && systemctl enable shadowsocks-server.service && systemctl start shadowsocks-server.service
[Unit]
Description=Shadowsocks Server
After=network.target
[Service]
Type=forking
PIDFile=/run/shadowsocks/server.pid
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /run/shadowsocks
ExecStartPre=/bin/chown nobody:nogroup /run/shadowsocks
@TimothyYe
TimothyYe / shadow.service
Last active May 11, 2016 08:59
Shadowsocks server via systemd
[Unit]
Description=Shadowsocks Server
After=network.target
[Service]
ExecStart=/home/timothy/shadowsocks/shadowsocks-server -c /home/timothy/shadowsocks/config.json
Restart=always
User=timothy
Group=timothy
KillMode=process
@TimothyYe
TimothyYe / Dockerfile
Last active September 13, 2016 04:04
My shadowsocks Dockerfile
FROM alpine:latest
MAINTAINER Timothy
RUN apk --no-cache add wget gzip && cd /
RUN wget https://github.com/shadowsocks/shadowsocks-go/releases/download/1.1.5/shadowsocks-server-linux64-1.1.5.gz --no-check-certificate
RUN gzip -d shadowsocks-server-linux64-1.1.5.gz
RUN mv shadowsocks-server-linux64-1.1.5 server
RUN chmod +x server
RUN apk del wget gzip
#! /bin/bash
function valid_required_envs() {
# Configs
required_envs=(KUBE_CONTEXT KUBE_SERVER)
# Securities
required_envs+=(KUBE_CERTIFICATE_AUTHORITY)
required_envs+=(KUBE_CLIENT_CERTIFICATE KUBE_CLIENT_KEY)
errors=()