ブログポストより綺麗(´・ω:;.:...
−−−−
HTTP2サーバーを組み込んだソフトウェアを開発しようと思うと、現在有力な選択肢は nghttp2 と h2o かなって思います。今回は nghttp2 をビルドして得られる libnghttp2_asio.so をリンクしたサーバーと、このサーバーをHTTP2で利用可能なクライアントとして Firefox 35 Developer Edition を使ってみます。
#!/usr/bin/python | |
import json | |
from hashlib import sha256 | |
from urllib2 import urlopen | |
from urllib import quote | |
# https://github.com/alecgorge/jsonapi/wiki/Analyzing-the-jsonapi-request-and-response-format | |
# http://alecgorge.github.io/jsonapi/ | |
# NEW API USAGE: http://mcjsonapi.com/apidocs/ |
<meta name="viewport" content="width=device-width"> | |
<script src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.11.0.js"></script> | |
<style> | |
#in { width: 500px; } | |
</style> | |
<input type="text" id="in"> | |
<div id="out"></div> | |
<script> | |
sock = new WebSocket('ws://baro.sl:7942/wakana'); | |
//sock = new WebSocket('ws://baro.sl:8765/wakana'); |
## | |
## "Manage Slaves" builder for buildbot: | |
## - a buildbot builder that can start/stop/restart any buildslave | |
## - runs simple shell script on slave to do the action | |
## | |
## ### INSTRUCTIONS ### | |
## | |
## On each slave, install the buildmaster's public SSH key so the buildmaster can SSH in. | |
## Then, add a script like the one below to each buildslave. A few notes on this script: | |
## - "bash -l" seems to be important in order to get the virtualenv to take correctly |
#!/bin/bash | |
#dcc-swall-001 8080 | |
current_proxy=`gsettings list-recursively | grep -i "proxy mode" | awk '{print $3}'` | |
action=$(yad --width 300 --skip-taskbar --title "Proxy Mode Select" \ | |
--mouse \ | |
--text "Current Proxy Setting: $current_proxy" \ | |
--button="manual:1" \ | |
--button="auto:2" \ | |
--button="none:3" \ |
#cloud-config | |
coreos: | |
fleet: | |
public-ip: $public_ipv4 | |
metadata: region=dfw,provider=rackspace | |
etcd: | |
discovery: https://discovery.etcd.io/youridhere | |
# multi-region and multi-cloud deployments need to use $public_ipv4 | |
# We'll actually fill this in using fixup_etc.sh (see below) | |
# addr: $rax_privatenet_ipv4:4001 |
/* | |
this simple snippets will give you downloadable url of soundcloud. | |
just slap soundcloud url like this way in csharp Download('Soundcloud url'); this will returned downloadable url | |
*/ | |
public string Download(string songurl){ | |
string returned = null; | |
HttpWebRequest hc = (HttpWebRequest)WebRequest.Create(songurl); | |
hc.UserAgent = "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36"; | |
HttpWebResponse hresponse = (HttpWebResponse)hc.GetResponse(); | |
System.IO.StreamReader sr = new System.IO.StreamReader(hresponse.GetResponseStream()); |
#!/bin/bash | |
help() { | |
echo 'G o S L O W ...' | |
} | |
stop() { | |
sudo ipfw delete 1 | |
sudo ipfw delete 2 | |
sudo ipfw pipe 1 delete |
# Tries to connect to a running gpg-agent or starts one itself. It tries connecting to: | |
# 1. the agent currently designated in the environment, | |
# 2. the agent designated in the $HOME/.gnupg/gpg-agent-info file, | |
# 3. the most recently started running gpg-agent process, or last | |
# 4. a new gpg-agent process, with ssh support and, if applicable, x11 support. | |
# | |
# Step no. 3 requires the "pgrep" and "sockstat" utilities (available on FreeBSD) | |
CONNECTGPG=$(which gpg-connect-agent) | |
if [ -x $CONNECTGPG ] ; then |
ブログポストより綺麗(´・ω:;.:...
−−−−
HTTP2サーバーを組み込んだソフトウェアを開発しようと思うと、現在有力な選択肢は nghttp2 と h2o かなって思います。今回は nghttp2 をビルドして得られる libnghttp2_asio.so をリンクしたサーバーと、このサーバーをHTTP2で利用可能なクライアントとして Firefox 35 Developer Edition を使ってみます。
from ws4py.client.threadedclient import WebSocketClient | |
class DummyClient(WebSocketClient): | |
def opened(self): | |
print "Opened websocket" | |
def closed(self, code, reason=None): | |
print "Closed down", code, reason | |
def received_message(self, m): |