Skip to content

Instantly share code, notes, and snippets.

View gfx's full-sized avatar

FUJI Goro gfx

View GitHub Profile
@gfx
gfx / 001-wifi-routers-v2.md
Last active January 28, 2024 23:55
Wi-Fiルーターおすすめ by 妻

概要

  • ネットーワーク機器のマーケ担当をしてる妻から聞いた、Wi-Fiルータのオススメ(「同僚のメーカー担当ごとに己の”最強”を選んでもらった」とのこと)です
  • 「ルーターにはWi-Fiルータだけじゃなく他にもいろいろあるんだよ!これはWi-Fiルータのことね」と言われたのでタイトルを変えました
  • 「AXほにゃらら」は規格(AX = Wi-Fi 6)+速度の参考値とのことです
  • もともとの文脈: 家庭内の雑談をツイートしたところ( https://twitter.com/__gfx__/status/1464084908091920387 )知人が反応したので妻に「ルータのおすすめ教えてと知人がいってるのでなんか教えて」といって教えてもらったのが元です
  • 下にあるv1.md が最初のやつ(2021/11/26)で、このv2.md がホッテントリ入りしたあとの改訂版(2021/11/27)です

追記(2022/05/24):

  • TP-Linkはちょいちょいやらかしがあります
@gfx
gfx / Prefs.java
Last active October 23, 2023 07:47
package com.github.gfx.preferences;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
public class Prefs {
final private SharedPreferences sharedPrefs;
public Prefs(Context context) {
@gfx
gfx / Dockerfile
Created May 17, 2022 02:05
Enabling HTTP/3 in cURL with quiche + boringSSL
# curl with http2 and http3 support
# https://curl.se/docs/http3.html
RUN wget --https-only --no-verbose -O - https://sh.rustup.rs | sh -s -- \
-y \
--profile minimal \
--default-toolchain 1.59.0 \
&& git clone --recursive --branch 0.12.0 --depth 1 https://github.com/cloudflare/quiche \
&& (cd quiche \
&& $HOME/.cargo/bin/cargo build --package quiche --release --features ffi,pkg-config-meta,qlog \
&& mkdir quiche/deps/boringssl/src/lib \
#include <stdio.h>
#include <time.h>
#include <stdint.h>
#define NUM_ITERATIONS 1000000
uint64_t timespec_to_ns(struct timespec ts) {
return (uint64_t)ts.tv_sec * 1000000000 + ts.tv_nsec;
}
@gfx
gfx / nary-search.cpp
Created June 5, 2011 01:24
A demo for N-ary search algorithm
#include <iostream>
#include <vector>
enum locate_t {
EQUAL,
LEFT,
RIGHT
};
int
@gfx
gfx / mini-thread-pool.rb
Last active March 16, 2022 05:28
MiniThreadPool - A minimum viable thread pool implementation for Ruby
class MiniThreadPool
def initialize(size: 8, abort_on_exception: true)
@queue = Queue.new
@join_all = false
@threads = []
size.times do
thr = Thread.new do
loop do
break if @join_all && @queue.empty?
begin
Package Description
Android SDK Build-tools, revision 24
This update will replace revision 24 rc4 with revision 24.
Archive Description
Archive for MacOS X
Size: 46.5 MiB
SHA1: 97fc4ed442f23989cc488d02c1d1de9bdde241de
@gfx
gfx / log.txt
Created December 1, 2021 04:39
curl -sSfL https://cpanmin.us | perl - -f --verbose --notest App::cpanminus 2>&1 | pbcopy
cpanm (App::cpanminus) 1.7044 on perl 5.034000 built for darwin-thread-multi-2level
Work directory is /Users/goro-fuji/.cpanm/work/1638333555.20362
You have make /usr/bin/make
You have /opt/chef-workstation/embedded/bin/curl
You have /usr/bin/tar: bsdtar 3.3.2 - libarchive 3.3.2 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.6
You have /usr/bin/unzip
Searching App::cpanminus () on cpanmetadb ...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
@gfx
gfx / 000-request-rejection.md
Last active July 24, 2021 01:30
Explain why 001-CVE-2021-23410 is invalid

CVE-2021-23410 is invalid because the PoC has nothing to do with the msgpack module and any other serializers.

The PoC is something like this:

var assert = require('assert');
var msgpack = require('msgpack');
function sleep(ms) {
return new Promise((resolve) => {
setTimeout(resolve, ms);
@gfx
gfx / type-from-json.ts
Last active November 22, 2020 12:32
Type-Function to Parse JSON into TypeScript types
type Whitespace = " " | "\n" | "\r" | "\t";
type TrimStart<T extends string> = T extends `${Whitespace}${infer R}` ? TrimStart<R> : T;
type TrimEnd<T extends string> = T extends `${infer R}${Whitespace}` ? TrimEnd<R> : T;
type Trim<T extends string> = TrimStart<TrimEnd<T>>;
type BoolLiteral = "true" | "false";
type Digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
type InferJsonScalarType<T extends string> = Trim<T> extends `"${infer _}"` ? string
: Trim<T> extends `${BoolLiteral}` ? boolean