Skip to content

Instantly share code, notes, and snippets.

View bitinn's full-sized avatar
🔜
Personal Project

David Frank bitinn

🔜
Personal Project
View GitHub Profile
@bitinn
bitinn / dns-hijack-china
Created January 11, 2015 13:39
Random DNS response hijack in China
df-air:kneesocks df$ curl -x http://127.0.0.1:8002 --verbose --insecure https://twitter.com/
* Hostname was NOT found in DNS cache
* Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 8002 (#0)
* Establish HTTP proxy tunnel to twitter.com:443
> CONNECT twitter.com:443 HTTP/1.1
> Host: twitter.com:443
> User-Agent: curl/7.37.1
> Proxy-Connection: Keep-Alive
>
@bitinn
bitinn / namebench-2014-01-13.csv
Last active August 29, 2015 14:13
深圳电信 namebench 2014-01-13
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 9 columns, instead of 10. in line 1.
IP,Name,Test_Num,Record,Record_Type,Duration,TTL,Answer_Count,Response
61.135.159.46,Tom CN,0,backbonetutorials.com.,A,442.88611412,300,1,"104.28.23.110, 104.28.22.110",
61.135.159.46,Tom CN,0,help.github.com.,A,324.376106262,30,2,github.map.fastly.net. -> 103.245.222.133,
61.135.159.46,Tom CN,0,www.geekwire.com.,A,937.829971313,300,2,geekwire.com. -> 104.130.53.67,
61.135.159.46,Tom CN,0,www.dwuser.com.,A,489.170074463,3600,1,108.61.83.130,
61.135.159.46,Tom CN,0,css-tricks.com.,A,356.249094009,300,1,"199.83.128.152, 199.83.132.152",
61.135.159.46,Tom CN,0,lifesinger.github.io.,A,200.210094452,3600,2,github.map.fastly.net. -> 103.245.222.133,
61.135.159.46,Tom CN,0,ja.wikipedia.org.,A,414.385795593,600,1,208.80.154.224,
61.135.159.46,Tom CN,0,www.google.com.,A,72.8459358215,84,1,"173.194.127.49, 173.194.127.51, 173.194.127.50, 173.194.127.52, 173.194.127.48",
61.135.159.46,Tom CN,0,www.beatsbydre.com.,A,678.999185562,300,3,wildcard.beatsbydre.com.edgekey.net. -> e7716.b.akamaiedge.net. -> 23.42.181.121,
@bitinn
bitinn / gist:600af3e5a80ebab62dc6
Last active August 29, 2015 14:21
PingHei-light.woff character map

Keybase proof

I hereby claim:

  • I am bitinn on github.
  • I am bitinn (https://keybase.io/bitinn) on keybase.
  • I have a public key whose fingerprint is BD1F EBEC 967D 3CA6 F7A6 90F8 ED26 32B2 A99F A46A

To claim this, I am signing this object:

@bitinn
bitinn / abstraction-for-deku.js
Last active August 29, 2015 14:22
vdom-compat (make virtual-dom hyperscript template work with deku)
/**
* vdom.js
*
* A virtual-dom compatibility layer
*/
var element = require('deku').element;
var classIdMatch = /([\.#]?[a-zA-Z0-9_:-]+)/;
var nonEmpty = function(input) {
return input !== '';
@bitinn
bitinn / 0.md
Last active August 29, 2015 14:23
Azure VM A2 vs Linode 1024 (using mongoperf)

Just to showcase the performance difference between a simple local SSD (Linode) and more complex RAID0 (Azure).

TL;DR: always go with SSD.

<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>margin collapse algorithm bug workaround</title>
<style>
body{
margin:0;
}
.example {
@bitinn
bitinn / gist:7744788
Created December 2, 2013 03:55
VAGRANT_LOG=debug vagrant up
....
GuestMemoryBalloon=0
GuestOSType="Linux26_64"
GuestAdditionsRunLevel=2
GuestAdditionsVersion="4.3.2 r90405"
GuestAdditionsFacility_VirtualBox Base Driver=50,1385956089494
GuestAdditionsFacility_VirtualBox System Service=50,1385956120744
GuestAdditionsFacility_Seamless Mode=0,1385956089494
GuestAdditionsFacility_Graphics Mode=0,1385956089494
@bitinn
bitinn / namebench1.html
Last active March 30, 2016 19:52
namebench test 20160331
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>namebench: 2016-03-31 01:20:47.905848</title>
<style type="text/css">
body {
font-family: Helvetica, Arial, sans-serif;
background-color: #bbb;
background-image: -moz-linear-gradient(0% 100% 90deg, #e5e5e5, #666, #e5e5e5 99%);
@bitinn
bitinn / test.js
Created January 21, 2015 13:05
promise-vs-thunk-in-fast-loop
var co = require('co');
//var Promise = require('bluebird');
//var Promise = require('promise');
var count = 0;
co(function* () {
while (true) {
count++;
try {
yield getData();