This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Write a golang struct called "watchUpdator". The struct creates a etcd connection, looping watch a given key, with timeout. if the key changes or timeouts, call corresponded callback | |
Here's an example of a Go struct called "watchUpdator" that creates an etcd connection, loops to watch a given key, and calls a corresponding callback function if the key changes or times out: | |
*/ | |
package main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
linuxkit-525400929b77 [~]$ df | grep vda | |
linuxkit-525400929b77 [~]$ sudo fdisk /dev/vda | |
Welcome to fdisk (util-linux 2.33). | |
Changes will remain in memory only, until you decide to write them. | |
Be careful before using the write command. | |
Command (m for help): d | |
Selected partition 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding=utf-8 | |
puzzle = [ | |
[8, 1, None, None, None, None, None, None, None], | |
[None, None, 3, 6, None, None, None, None, None], | |
[None, 7, None, None, 9, None, 2, None, None], | |
[None, 5, None, None, None, 7, None, None, None], | |
[None, None, None, None, 4, 5, 7, None, None], | |
[None, None, None, 1, None, None, None, 3, None], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
menghan@ppfili:~/codespace/moviepp (git::master) $ curl -v 'http://localhost:5000//api/v1/cinemas?Authorization=1&q=%E5%8C%97%E4%BA%AC' | |
* Hostname was NOT found in DNS cache | |
* Trying ::1... | |
* connect to ::1 port 5000 failed: Connection refused | |
* Trying 127.0.0.1... | |
* Connected to localhost (127.0.0.1) port 5000 (#0) | |
> GET //api/v1/cinemas?Authorization=1&q=%E5%8C%97%E4%BA%AC HTTP/1.1 | |
> User-Agent: curl/7.35.0 | |
> Host: localhost:5000 | |
> Accept: */* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
menghan@air:~$ brew doctor | |
Your system is ready to brew. | |
menghan@air:~$ brew uninstall python | |
Uninstalling /usr/local/Cellar/python/2.7.8_2... | |
menghan@air:~$ brew uninstall mercurial | |
Uninstalling /usr/local/Cellar/mercurial/3.1.2... | |
menghan@air:~$ proxy | |
HTTP/1.1 301 Moved Permanently | |
Date: Thu, 30 Oct 2014 04:20:41 GMT | |
Server: gwiseguy/2.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import os | |
import sys | |
from flask.ext.script import Command, Option | |
class GunicornServer(Command): | |
"""Run the app within Gunicorn""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
exec 4</dev/null | |
exec 5<&0 | |
exec 0<&4 | |
echo cat1 | |
cat | |
echo cat2 | |
cat <&5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
menghan@MenghanMac:~$ cat /tmp/diffs | |
--- httpclient.py 2013-11-15 11:21:29.000000000 +0800 | |
+++ httpclient.pyc_dis 2014-07-04 13:30:27.000000000 +0800 | |
@@ -1,3 +1,4 @@ | |
+#Embedded file name: /Users/menghan/.virtualenvs/common/lib/python2.7/site-packages/tornado/httpclient.py | |
"""Blocking and non-blocking HTTP client interfaces. | |
This module defines a common interface shared by two implementations, | |
@@ -26,20 +27,16 @@ | |
you use a recent version of ``libcurl`` and ``pycurl``. Currently the minimum |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding=utf-8 | |
import requests | |
r = requests.post('http://127.0.0.1:45631/service', data=open('y').read()) | |
print r.text.encode('utf8') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"log" | |
"runtime" | |
"strconv" | |
"time" | |
) |
NewerOlder