Skip to content

Instantly share code, notes, and snippets.

View UniIsland's full-sized avatar

Huang, Tao UniIsland

View GitHub Profile
@UniIsland
UniIsland / gist:f43f73ee09c821740c36
Last active August 29, 2015 14:05 — forked from bobisme/gist:1078482
Build/install custom linux kernel headers with Debian.

Linux Headers

  • Install tools to build:
sudo apt-get update
sudo apt-get install kernel-package fakeroot wget bzip2
  • Linux-2.6.39.1-linode34 is same as regular 2.6.39
@UniIsland
UniIsland / upyun.py
Created May 11, 2012 07:44 — forked from gccyugi/upyun.py
upyun-python-api
# -*- coding: utf-8 -*-
import md5 as mmd5
DEBUG = False
api_upyun = 'api.upyun.com'
ENDPOINT_V0 = 'v0.' + api_upyun
ENDPOINT_V1 = 'v1.' + api_upyun
@UniIsland
UniIsland / index.php
Created August 14, 2012 03:42
php upload progress
<?php
/*
+----------------------------------------------------------------------+
| Uploadprogress extension |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
@UniIsland
UniIsland / moving_average.r
Created February 10, 2018 16:36
Calculate Moving Average with R
## calculating moving average
## x: data vector
## n: use how many samples
## s: 1 - with lag; 2 - symmetrically
f.ma <- function(x,n=5,s=2){filter(x,rep(1/n,n), sides=s)}
@UniIsland
UniIsland / linode_dns_updater.rb
Created February 10, 2018 16:39
update linode dns record with ruby
#!/usr/bin/env ruby
require 'rubygems'
require 'linode'
api_key = '<API_KEY_STRING>'
domain_id = 123456 # Domain ID
resource_id = 7654321 # Resource ID
new_ip = `ifconfig | grep "inet " | grep -v '127.0.0'`.split(' ')[1]
@UniIsland
UniIsland / zhihu-topic_bind_shortcut.js
Created February 10, 2018 16:45
Tampermonkey Script for 知乎话题快捷绑定(知乎问答页改版后已不再可用)
// ==UserScript==
// @name zhihu - 快捷话题绑定
// @namespace http://www.zhihu.com/
// @version 0.1
// @description enter something useful
// @match http://www.zhihu.com/question/*
// @copyright 2012+, You
// ==/UserScript==
var topics = [[220,'知乎社区'],[33917,'个人咨询'],[87436,'成人内容'],[1309,'调查类问题']];
@UniIsland
UniIsland / chenghao_invitations.md
Last active February 19, 2020 10:25
程浩在知乎上发出的问题邀请,共有 75 题。
Link Title
19698337 在知乎回答问题,你习惯先看其他人的答案再回答问题,还是直接回答?
19871031 网上有免费的盗版电子书下载看,你还会去买正版电子书吗?为什么?
20113000 有一个人有奇怪的色盲,但他不知道跟别人不一样,别人看到的天空是蓝色的,他看到的是绿色的,但是他和别人的叫法都一样,都是“蓝色”;怎么让他知道自己和别人不一样?你怎么证明你不是上述问题中的主人公?
20352045 看过很多书或者文章,关上之后,往往只记得大概讲什么,重点内容很难举出一二。怎样改善这种情况,提高记忆力?
20580216 读张爱玲是否要比读张小娴高档?是或者不是的理由是什么?
20699314 读书时想听点纯音乐,诸如贝多芬、德彪西等,可是一点不了解,有哪些唱片或者合辑值得推荐么?
20702339 马小弱是谁?
20703864 问张佳玮同学:除了摘抄、写读后感和写书评之外,还有什么样的读书笔记格式,可以高度浓缩一部长篇小说的思想性与主要内容?
@UniIsland
UniIsland / README.md
Last active September 22, 2021 09:28
Mnemonic Wordlist

This word list is recommended by MNX.io in the article A Proper Server Naming Scheme.

Usage

Choose a word at will from the word list below.

The easiest way to randomly get a word from the wordlist on Linux is:

shuf -n 1 $FILENAME
@UniIsland
UniIsland / root.dot
Created September 1, 2012 06:28
topic hierarchy experiment
digraph G {
/* formating */
rankdir=LR;
/* top level */
"根" -> {学科; 产业; 实体; 生活、艺术、文化与活动; 「形而上」; 元话题; 未归类}
/* 2nd level */
学科 -> {自然科学; 人文学科; 工程与技术; 综合与新兴学科}
产业 -> {工业; 农业; 服务业; 媒体产业; 金融产业; 商业; 互联网产业}
@UniIsland
UniIsland / README
Created May 7, 2012 04:38
python cross process data sharing with mmap
# Intro
extremely simple and unsophisticated cross process data sharing
supports one read-write master process and an arbitrary number of read-only processes
please consider using pickle/cPickle/ctype to store complex data
# References