Skip to content

Instantly share code, notes, and snippets.

View voluntas's full-sized avatar
🎲
Focusing

V voluntas

🎲
Focusing
View GitHub Profile
@x-yuri
x-yuri / netns + veth.md
Last active May 7, 2025 14:52
netns + veth

netns + veth

a.sh:

ip netns add myns
ip link add vethhost type veth peer name vethguest
ip addr add 10.255.255.2/24 dev vethhost
ip link set vethhost up
ip link set vethguest netns myns
@hideaki-t
hideaki-t / nvblas.md
Last active December 14, 2022 03:43

npm i wrangler -g でアップデートした時に次のログが見えた

The latest release of wrangler is "2.0.15".

Other releases are:
  * pages: 0.0.0-96e612b
  * beta: 0.0.0-ea7ee45
  * wasm: 0.0.0-70a118b
  * d1: 0.0.0-d35c69f
@johnspurlock-skymethod
johnspurlock-skymethod / r2-notes.md
Last active March 13, 2024 17:32
Unofficial R2 notes
@mitchellh
mitchellh / Atlas.zig
Last active May 5, 2025 14:32
Bin-packed texture atlas implementation in Zig. https://en.wikipedia.org/wiki/Texture_atlas
//! Implements a texture atlas (https://en.wikipedia.org/wiki/Texture_atlas).
//!
//! The implementation is based on "A Thousand Ways to Pack the Bin - A
//! Practical Approach to Two-Dimensional Rectangle Bin Packing" by Jukka
//! Jylänki. This specific implementation is based heavily on
//! Nicolas P. Rougier's freetype-gl project as well as Jukka's C++
//! implementation: https://github.com/juj/RectangleBinPack
//!
//! Limitations that are easy to fix, but I didn't need them:
//!
@karlseguin
karlseguin / basic-tcp-chat.zig
Last active April 29, 2024 14:15 — forked from andrewrk/basic-tcp-chat.zig
Basic TCP Chat Server for Zig 0.12
// For Zig 0.12
const std = @import("std");
const net = std.net;
const ArenaAllocator = std.heap.ArenaAllocator;
pub fn main() anyerror!void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
const allocator = gpa.allocator();

Linux netns cheat sheet

TL;DR. You first create a network namesmace (netns), and a veth device (you also create a peer). Then you assign one end to another netns. You can talk to another netns via the veth.

TODO: How to use a different device instead of veth for communication across netns?

Create a new netns

@azu
azu / TypeScriptの設定の良し悪し.md
Last active February 14, 2025 10:38
TypeScriptの設定の良し悪し

tsconfig.json の設定についてのメモ書きです。

Node.jsのバージョンごとの設定

target は 変換後のコードのECMAScriptバージョンを指定する たとえば、Node.js 14はES2020をサポートしている。そのため、Node.js 14向けのコード(サーバなど)ならtarget: "ES2020"を指定することで、余計なTranspileが省かれててコードサイズや実行時間が最適化される。

@ityonemo
ityonemo / test.md
Last active April 29, 2025 08:28
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@kprotty
kprotty / ThreadPool.zig
Last active March 20, 2024 16:12
An isolated thread pool implementation for Zig
const std = @import("std");
const system = std.os.system;
pub const Scheduler = struct {
pub const InitConfig = struct {
max_threads: ?u16 = null,
};
pub fn init(self: *Scheduler, config: InitConfig) !void {