Skip to content

Instantly share code, notes, and snippets.

View JasonQSY's full-sized avatar

Shengyi Qian JasonQSY

View GitHub Profile

Here is my GPG public key.

It should match https://pgp.mit.edu/pks/lookup?op=get&search=0x8A61CD8A9F132B28.

-----BEGIN PGP PUBLIC KEY BLOCK-----

mQINBFvohHIBEADWg5Hpkxqm0aTadw4ENdkgqwRtkQRkCV3HKQ29Zn4blHp6q45D
1jnFa77Kpi5m/If6781jKOPvLjRV+Ag8TADpkAFN3ETXrmjRFbiSrg4TLo7PbMrd
DEZ6gJcTcau5h0Sm9Idy7SRZHN7Qn76umEURE8ilCaYvSjxd4HOem9UfUGt+AezG

Mininet

You can use mininet to set up virtual network to debug.

mn --link tc,bw=20,loss=30,delay=600ms
xterm h1
xterm h2
Fetching account balance...
Account balance:
Traceback (most recent call last):
File "./manage.py", line 14, in <module>
execute_from_command_line(sys.argv)
File "/home/jason/Desktop/opensurfaces/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/home/jason/Desktop/opensurfaces/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/jason/Desktop/opensurfaces/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv

Resign Old Commits for Git

To resign old commits for git, just

git rebase --exec 'git commit --amend --no-edit -n -S' -i development

To make it easier,

Set up gperftools

Installation

OS X

Make sure you have Xcode command line tools (e.g. clang++), brew and go.

# optional
sudo apt install libgmp-dev libmpfr-dev libmpc-dev
sudo -H pip3 install gmpy2

Keybase proof

I hereby claim:

  • I am JasonQSY on github.
  • I am jasonqsy (https://keybase.io/jasonqsy) on keybase.
  • I have a public key whose fingerprint is 58C0 6F2B 5536 9DD8 220C 7AB2 8A61 CD8A 9F13 2B28

To claim this, I am signing this object:

// open http://coursesel.umji.sjtu.edu.cn/tpm/findAll_LessonTaskStudent.action
// and paste the code on DeveloperTools - Console
let data = JSON.parse(document.documentElement.innerText)['data'];
let elected = {};
for (let datum of data) {
let course = datum['courseName']+datum['courseShortName'];
let student = datum['studentName'];
let section = datum['lessonTaskId'];
/**
* xm program. written by go.
*
* @build go build xm.go
* @example ./xm --> Output: xm
* @example ./xm gg --> Output: xmgg
* @example ./xm [all|-all|--all]
*/
package main

GH60-Layout

This is my gh60-revchn layout.

Raw data

[{a:0},"Esc\n\n\n\n~\n`",{a:4},"!\n1\n\n\nF1","@\n2\n\n\nF2","#\n3\n\n\nF3","$\n4\n\n\nF4","%\n5\n\n\nF5","^\n6\n\n\nF6","&\n7\n\n\nF7","*\n8\n\n\nF8","(\n9\n\n\nF9",")\n0\n\n\nF10","_\n-\n\n\nF11","+\n=\n\n\nF12",{w:2},"Backspace\n\n\n\nDelete"],
[{w:1.5},"Tab","Q","W\n\n\n\n↑","E","R","T","Y\n\n\n\nCalc","U","I\n\n\n\nIns","O","P\n\n\n\nPSc","{\n[\n\n\nScrLk",{a:0},"}\n]\n\n\nPus\nBrk",{a:4,w:1.5},"|\n\\"],
[{w:1.75},"Ctrl","A\n\n\n\n←","S\n\n\n\n↓","D\n\n\n\n→","F","G","H","J","K","L",":\n;\n\n\nHome","\"\n'\n\n\nPgUp",{w:2.25},"Enter"],