Skip to content

Instantly share code, notes, and snippets.

View heamon7's full-sized avatar

袁哲 heamon7

  • BUPT
  • Beijing , China
View GitHub Profile
@woodphil
woodphil / python-sqlite-abs-path.py
Created January 5, 2016 23:48
Python sqlite absolute path to database
package_dir = os.path.abspath(os.path.dirname(__file__))
db_dir = os.path.join(package_dir, 'nd_slack.db')
# NEED 4 /'s to specify absolute for sqlalchemy!
# ex: sqlite:////asdfaijegoij/aerga.db
# NEED 3 /'s for relative paths
# path has a / at the beginning so we have 3 here
SQLITE_DB = ''.join(['sqlite:///', db_dir])
@rehevkor5
rehevkor5 / ncdc.sh
Last active April 17, 2017 22:00 — forked from tomasdelvechio/ncdc.sh
Download a weather dataset from the National Climatic Data Center (NCDC, http://www .ncdc.noaa.gov/). Prepare it for examples of "Hadoop: The Definitive Guide" book by Tom White. http://www.amazon.com/Hadoop-Definitive-Guide-Tom-White/dp/1449311520 Usage: ./ncdc.sh 1901 1930 # download wheather datasets for period from 1901 to 1930. This version…
#!/usr/bin/env bash
# global parameters
g_tmp_folder="ncdc_tmp";
g_output_folder="ncdc_data";
g_remote_host="ftp.ncdc.noaa.gov";
g_remote_path="pub/data/noaa";
@fqrouter
fqrouter / readme.txt
Last active April 16, 2023 18:10
shadowsocks 公共代理的必要设置
good, 你已经有了一个自己的shadowsocks代理了,现在想要把这个代理公布出去给所有人分享。
但是没有两个小时,代理就没法使用了,为什么?因为你需要额外注意以下事项(以下步骤需要比较高的linux技能)
本文只关注于确保shadowsocks服务还“活着”,如果你希望让其跑得更快,请参考
https://github.com/clowwindy/shadowsocks/wiki/Optimizing-Shadowsocks
1、 shadowsocks的timeout设置
超时时间越长,连接被保持得也就越长,导致并发的tcp的连接数也就越多。对于公共代理,这个值应该调整得小一些。推荐60秒。
2、 检查操作系统的各种限制
对于openvz的vps,特别需要检查一下
@stevekinney
stevekinney / README.md
Last active April 11, 2021 17:23
The frequency and wavelengths of musical notes.
@aligusnet
aligusnet / ncdc.sh
Last active December 11, 2021 19:56
Download a weather dataset from the National Climatic Data Center (NCDC, http://www .ncdc.noaa.gov/). Prepare it for examples of "Hadoop: The Definitive Guide" book by Tom White. http://www.amazon.com/Hadoop-Definitive-Guide-Tom-White/dp/1449311520 Usage: ./ncdc.sh 1901 1930 # download wheather datasets for period from 1901 to 1930.
#!/usr/bin/env bash
# global parameters
g_tmp_folder="ncdc_tmp";
g_output_folder="ncdc_data";
g_remote_host="ftp.ncdc.noaa.gov";
g_remote_path="pub/data/noaa";
@anhang
anhang / localStorage.js
Created July 20, 2011 23:07
HTML5 Local Storage with Expiration
AZHU.storage = {
save : function(key, jsonData, expirationMin){
if (!Modernizr.localstorage){return false;}
var expirationMS = expirationMin * 60 * 1000;
var record = {value: JSON.stringify(jsonData), timestamp: new Date().getTime() + expirationMS}
localStorage.setItem(key, JSON.stringify(record));
return jsonData;
},
load : function(key){
if (!Modernizr.localstorage){return false;}