This file contains 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/ruby | |
if ARGV.empty? | |
puts "Usage: #{$0} [rsync-options] <src-host:src-dir>" | |
exit 0 | |
end | |
generations = Dir.glob("*").grep(/^[0-9]{8}-[0-9]{6}$/).sort | |
argv = ARGV |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
diff --git a/reflector.rb b/reflector.rb | |
index c47370b..39e4115 100644 | |
--- a/reflector.rb | |
+++ b/reflector.rb | |
@@ -4,12 +4,17 @@ | |
# sudo ip link set tap-e up | |
# sudo ip route add 10.1.2.0/24 via 10.1.2.3 | |
+require "fiber_scheduler" | |
require "./tun" |
This file contains 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
require 'rack' | |
counter = 0 | |
Thread.new do | |
loop do | |
puts "hello, #{counter}" | |
counter += 1 | |
sleep 1 | |
end |
This file contains 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
n = 200 | |
m = 63 | |
q = 16 | |
c = 0 | |
1_000_000.times do | |
buckets = Array.new(m, 0) | |
n.times do | |
slot = rand(m) | |
buckets[slot] += 1 |
This file contains 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
#define _GNU_SOURCE | |
#include <assert.h> | |
#include <limits.h> | |
#include <netinet/in.h> | |
#include <netinet/tcp.h> | |
#include <pthread.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <sys/socket.h> | |
#include <unistd.h> |
This file contains 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
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#define WIDTH (99 * 40) | |
#define HEIGHT (99 * 25) | |
static double timespec2d(struct timespec *ts) | |
{ |
This file contains 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/perl | |
# | |
# Written in 2017 by Kazuho Oku | |
# | |
# To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty. | |
# You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>. | |
# | |
use strict; | |
use warnings; |
This file contains 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
/* | |
* Copyright (c) 2020 Fastly, Kazuho Oku | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to | |
* deal in the Software without restriction, including without limitation the | |
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
* sell copies of the Software, and to permit persons to whom the Software is | |
* furnished to do so, subject to the following conditions: | |
* |
This file contains 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
/* | |
* As of May 25 2021, this code is provided as CC0 / public domain (Kazuho Oku) | |
* | |
* Copyright (c) 2014 Kazuho Oku | |
* | |
* Redistribution and use in source and binary forms, with or without modification, | |
* are permitted. | |
* | |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |