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 ruby | |
| # frozen_string_literal: true | |
| # | |
| # qpack-compression-sim.rb | |
| # | |
| # Offline simulator + design notes for how h2o should drive the QPACK dynamic | |
| # table on the encode side. Today h2o uses the static table only (write_response | |
| # passes encoder_buf == NULL); this explores how to turn the dynamic table on. | |
| # | |
| # Usage: ruby misc/qpack-compression-sim.rb <file.qif> [capacity_bytes] |
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 ruby | |
| # frozen_string_literal: true | |
| require "csv" | |
| require "optparse" | |
| options = { | |
| mass: 70.0, | |
| efficiency: 0.97, | |
| wind: 0.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
| /** | |
| * Pull request #651 (https://github.com/h2o/quicly/pull/651) introduced an extra parameter called `payload` that specifies the | |
| * location of the payload to be encrypted (i.e., out-of-place encryption). Custom encryption callbacks can either adopt the new | |
| * API directly, or use a wrapper function that copies the out-of-place payload then calls the original function. | |
| * | |
| * The function below is an example of such a wrapper function. | |
| */ | |
| void new_encrypt_packet(struct st_quicly_crypto_engine_t *engine, quicly_conn_t *conn, ptls_cipher_context_t *header_protect_ctx, | |
| ptls_aead_context_t *packet_protect_ctx, ptls_iovec_t datagram, size_t first_byte_at, | |
| size_t payload_from, const void *payload, uint64_t packet_number, int coalesced) |
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
| diff --git a/t/50connect-eyeballs.t b/t/50connect-eyeballs.t | |
| index 832c1b051..717ac0729 100644 | |
| --- a/t/50connect-eyeballs.t | |
| +++ b/t/50connect-eyeballs.t | |
| @@ -1,5 +1,6 @@ | |
| use strict; | |
| use warnings; | |
| +use File::Temp qw(tempdir); | |
| use IO::Socket::IP; | |
| use Test::More; |
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
| #include <stdint.h> | |
| #include <stdio.h> | |
| #include <openssl/engine.h> | |
| #include <openssl/provider.h> | |
| #include "picotls.h" | |
| #include "picotls/openssl.h" | |
| int main(int argc, char **argv) | |
| { | |
| OSSL_PROVIDER *legacy = OSSL_PROVIDER_load(NULL, "legacy"); |
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
| // proxy.js | |
| // Express server wrapping llama.cpp server with OpenAI function-calling semantics | |
| // Logs client requests/responses and model requests/responses to console | |
| const express = require('express'); | |
| const axios = require('axios'); | |
| const bodyParser = require('body-parser'); | |
| const { v4: uuidv4 } = require('uuid'); | |
| const { spawn } = require('child_process'); |
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/perl | |
| use strict; | |
| use warnings; | |
| while (my $l = <STDIN>) { | |
| chomp $l; | |
| if ($l !~ /MiB/ and $l =~ /([0-9]+,[0-9,]+)/) { | |
| $l .= toMiB($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 ruby | |
| require 'find' | |
| BLOCK_SIZE = 512 # ブロックサイズは通常 512 バイト | |
| def calculate_freed_space(paths) | |
| inodes = {} | |
| total_blocks = 0 | |
| processed_files = {} |
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
| # こいつは systemctl enable sshd-tcpd.socket する | |
| [Unit] | |
| Description=ssh | |
| ConditionPathExists=!/etc/ssh/sshd_not_to_be_run | |
| Conflicts=ssh.socket | |
| [Socket] | |
| ListenStream=22 | |
| Accept=yes |
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
| Rtop = 12; | |
| Htop = 25; | |
| Rin = 15; | |
| Rout = 20; | |
| H = 2 + (Rout - Rin) / 1.5; | |
| thick = 1.2; | |
| rows = 7; | |
| cols = 5; | |
| for (i = [0:cols - 1]) { |
NewerOlder