Skip to content

Instantly share code, notes, and snippets.

View dropwhile's full-sized avatar
💭
neutrally buoyant

eli dropwhile

💭
neutrally buoyant
View GitHub Profile
const std = @import("std");
const net = std.net;
const fs = std.fs;
const os = std.os;
pub const io_mode = .evented;
pub fn main() anyerror!void {
var general_purpose_allocator = std.heap.GeneralPurposeAllocator(.{}){};
const allocator = &general_purpose_allocator.allocator;
@kongkrit
kongkrit / alpine-zfs-grub-uefi.md
Last active January 4, 2024 23:10
Install Alpine Linux on ZFS Root - grub bootloader on UEFI

Alpine Linux Installation on ZFS Root with grub on UEFI

  • References [ ref1 | ref2 | ref3 ]
  • Boot from alpine-extended [ download ]
  • login as root without any password
  • setup network interfaces and start networking:
    setup-interfaces
    /etc/init.d/networking start
    
  • add, config, and enable openssh:
@shritesh
shritesh / hostcalls.zig
Last active April 15, 2019 21:32
Fastly Zig Wasm
const std = @import("std");
const fmt = std.fmt;
extern fn hostcall_kvstore_upsert(
key_ptr: [*]const u8,
key_len: usize,
value_ptr: [*]const u8,
value_len: usize,
) bool;
@briandominick
briandominick / asciidoc-static.adoc
Last active March 31, 2025 03:25
Static Site Generators with AsciiDoc Support

There are 28 static site generators that support AsciiDoc sourcing.

@algal
algal / websitescreenshot.md
Last active August 11, 2024 18:37
Taking website screenshots, in Chrome or Safari, including simulating iPhones

Taking website screenshots

These are instructions for taking screenshots of an entire webpage, not just the part of the webpage visible in the browser.

Website Screenshots in Safari

This requires Safari 11.3, which comes on macOS 10.3.4.

  1. Open the website in Safari
  2. If needed, go Safari > Preferences > Advanced > Show Develop Menu in Menu Bar
@jerodg
jerodg / windows_and_office_kms_setup.adoc
Last active May 24, 2025 14:58
Activate Windows and Office Using KMS Server

Microsoft Windows and Office KMS Setup

@Fedalto
Fedalto / upgrade-requirements.sh
Created December 28, 2017 20:52
Modify the requirements.txt file and upgrade all Python libraries to the latest version.
#!/bin/bash
pip list --format=columns --outdated | \
sed -n '3,$p' | \
while IFS=" " read -r package old_version new_version extra
do
for requirements_file in "$@"
do
if grep -q ${package} ${requirements_file}; then
echo "${package}: ${old_version} -> ${new_version}"
@ekreutz
ekreutz / ansible_variable_precedence.md
Last active May 28, 2025 08:13
Ansible variable precedence (order, hierarchy)
@F21
F21 / raft.go
Created November 15, 2017 05:05
Sample hashicorp/raft + hashicorp/serf app
package main
import (
"crypto/md5"
"flag"
"fmt"
"io"
"log"
"os"
"path/filepath"
@mrw34
mrw34 / postgres.sh
Last active March 26, 2025 21:35
Enabling SSL for PostgreSQL in Docker
#!/bin/bash
set -euo pipefail
openssl req -new -text -passout pass:abcd -subj /CN=localhost -out server.req -keyout privkey.pem
openssl rsa -in privkey.pem -passin pass:abcd -out server.key
openssl req -x509 -in server.req -text -key server.key -out server.crt
chmod 600 server.key
test $(uname -s) = Linux && chown 70 server.key
docker run -d --name postgres -e POSTGRES_HOST_AUTH_METHOD=trust -v "$(pwd)/server.crt:/var/lib/postgresql/server.crt:ro" -v "$(pwd)/server.key:/var/lib/postgresql/server.key:ro" postgres:12-alpine -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key