Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hupili
hupili / note.md
Last active January 2, 2016 16:59
Parallel sorting using Linux utils

Test setup:

  • 1.1G, 100 million lines of intergers.
  • 24 CPU, 48G mem

Use time ./parasort.sh all-ids 500000 20:

real	2m32.483s
user	10m52.996s
@hupili
hupili / README.md
Last active December 30, 2015 03:09
Use Git to update your web server.

Use Git to update your web server.

Many hosting service now supports not only FTP and web uploading but also SSH. It's more convenient to use the Git flow:

  • Modify and test your site locally.
  • Push to remote Git repo, which triggers the update of your website.

My settings:

@hupili
hupili / mathjax_for_gitlab.md
Last active December 30, 2015 02:58
Add MathJax support to GitLab 5.x (?)
#!/usr/bin/env sh
# Download SNSAPI's CDE (64bit) package and cd into the environment.
# Execute ./snsali.py.cde after that.
# More info.: https://github.com/hupili/snsapi/wiki/Installation
if [ `uname -m` == "x86_64" ]; then
wl="64"
else
wl="32"
fi
'''
Convert RSS to timelineJS's JSON format
Usage:
rss2json.py <fn_rss> <fn_json>
'''
import docopt
arguments = docopt.docopt(__doc__)
fn_rss = arguments['<fn_rss>']
@hupili
hupili / markdown.layout
Created July 29, 2013 14:49
layout files for JabRef export
__\format[Authors()]{\author}__, \year, _" \title "_, \booktitle \journal
@hupili
hupili / get-follow-link.sh
Created June 20, 2013 11:16
Parse sina UIDs from image link and generate a batch follow link.
@hupili
hupili / login.sh
Last active October 8, 2015 01:48
CUHK Wireless Portal Login Scripts
#!/bin/bash
login_url="https://securelogin.wlan.cuhk.edu.hk/cgi-bin/login"
post_data="user=<username>&password=<password>&cmd=authenticate&Login=Log+In"
mkdir -p tmp
wget --secure-protocol=sslv3 $login_url --post-data="$post_data" -O tmp/login.html
@hupili
hupili / gist:3104041
Last active October 7, 2015 04:17
login and logout scripts of fduwireless
#!/bin/bash
# fill in your username and password before
# invoking this script
post="buttonClicked=4&redirect_url=www.baidu.com%2F&err_flag=0&username=<<username>>&password=<<password>>"
wget --post-data "$post" http://1.1.1.1/login.html -O baidu.html