Skip to content

Instantly share code, notes, and snippets.

View zchee's full-sized avatar
😩
want to Go knowledge...

Koichi Shiraishi zchee

😩
want to Go knowledge...
View GitHub Profile
@zchee
zchee / foo.md
Created July 31, 2019 15:22 — forked from sdstrowes/foo.md
Reverse Engineering the Speedtest.net Protocol, Gökberk Yaltıraklı

Source: https://web.archive.org/web/20141216073338/https://gkbrk.com/blog/read?name=reverse_engineering_the_speedtest_net_protocol Author: Gökberk Yaltıraklı

Reverse Engineering the Speedtest.net Protocol

After finishing my command line speed tester written in Rust, I didn't have a proper blog to document this process. A few days ago I wrapped up a simple blogging script in Python so hopefully it works good enough to explain how everything works.

By now I have already figured out the whole protocol for performing a speed test but I will write all the steps that I took so you can learn how to reverse engineer a simple protocol.

The code that I wrote can be found at https://github.com/gkbrk/speedtest-rust.

負荷の管理

  • 100%の時間 利用可能なサービスはない
    • 配慮のないクライアント
    • 50倍の要求
      • (訳注: 上記2つはPokemon Goのことでもある)
    • スラフィックのスパイク
    • 海底ケーブルの切断
  • 私達のサービスに依存するユーザーがいる
@zchee
zchee / hosts
Created February 23, 2017 13:56 — forked from consti/hosts
/etc/hosts to block shock sites etc.
# This hosts file is brought to you by Dan Pollock and can be found at
# http://someonewhocares.org/hosts/
# You are free to copy and distribute this file for non-commercial uses,
# as long the original URL and attribution is included.
#<localhost>
127.0.0.1 localhost
127.0.0.1 localhost.localdomain
255.255.255.255 broadcasthost
::1 localhost
codecov:
token: uuid # Your private repository token
url: "http" # for Codecov Enterprise customers
slug: "owner/repo" # for Codecov Enterprise customers
branch: master # override the default branch
bot: username # set user whom will be the consumer of oauth requests
ci: # Custom CI domains if Codecov does not identify them automatically
- ci.domain.com
- !provider # ignore these providers when checking if CI passed
# ex. You may test on Travis, Circle, and AppVeyor, but only need
@zchee
zchee / cgroup.go
Created December 17, 2016 16:19 — forked from tsuzu/cgroup.go
Cgroup for Go
package cgroup
import "os"
import "syscall"
import "io/ioutil"
import "strconv"
import "os/exec"
import "strings"
import "errors"
@zchee
zchee / Extra Logging for My Great App.mobileconfig
Created October 22, 2016 17:58 — forked from zwaldowski/Extra Logging for My Great App.mobileconfig
Apple Configuration Profile for Logging in iOS 10 and macOS Sierra
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<!-- iOS 10, macOS Sierra, and friends bring a new logging subsystem that's
supposed to scale from the kernel, up to frameworks, and up to apps. It defaults
to a more regimented, privacy-focused approach that large apps and complex
systems need.
It, along with Activity Tracing introduced in iOS 8 and macOS Yosemite and the
Console app in macOS Sierra, hope to help you graduate from caveman debugging to
package main
import (
"go/ast"
"go/parser"
"go/token"
"strconv"
)
// 实现一个只支持int,只支持加法,函数只有println,只支持一个参数的Go语言子集....
@zchee
zchee / musl-cross.rb
Created July 19, 2016 01:03 — forked from FiloSottile/README.md
Homebrew Formula for musl-based GCC cross-compilers.
class MuslCross < Formula
desc "Linux cross compilers based on musl libc"
homepage "https://github.com/richfelker/musl-cross-make"
head "https://github.com/richfelker/musl-cross-make.git"
bottle do
cellar :any_skip_relocation
end
option "with-arm-hf", "Build cross-compilers targeting arm-linux-musleabihf"
@zchee
zchee / ideviceenterrecovery.c
Created July 18, 2016 18:21
With this tool you can enter in recovery mode easily without adding your udid instead of the initial code from Libimobiledevice
/* gcc ideviceenterrecovery.c -o ideviceenterrecovery -limobiledevice */
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <libimobiledevice/libimobiledevice.h>
#include <libimobiledevice/lockdown.h>
static char *udid = NULL;
int main()
diff --git a/libguile/stime.c b/libguile/stime.c
index f430ca4..8b810a7 100644
--- a/libguile/stime.c
+++ b/libguile/stime.c
@@ -834,6 +834,10 @@ scm_init_stime()
#ifdef HAVE_POSIX_CPUTIME
{
+#ifdef __APPLE__
+ if (clock_gettime (CLOCK_PROCESS_CPUTIME_ID, &posix_run_time_base) == 0)