Skip to content

Instantly share code, notes, and snippets.

View vkaylee's full-sized avatar

Lee Tuan vkaylee

  • Ho Chi Minh City, Vietnam
  • 14:59 (UTC +07:00)
View GitHub Profile
@hydrz
hydrz / install.sh
Last active October 23, 2024 13:11
High Availability K3s and Kube-vip with Cilium
#!/bin/sh
set -e
set -o noglob
# Usage: ./install.sh [options]
#
# Example:
# Installing on first master node run:
# ./install --num 3 --vip 192.168.2.10 --iface eth0
# Installing on other master nodes run:
@Integralist
Integralist / README.md
Last active July 7, 2025 15:07
Go: timeouts and custom http client #go #http #dns

Server Timeouts
Go Server Timeouts

Tip

Use context.WithTimeout when you need to enforce timeouts on internal operations like database queries or HTTP calls, especially when you want to propagate cancellation signals through the call stack to prevent resource leaks or manage goroutines. It's ideal for fine-grained control within a handler. In contrast, use http.TimeoutHandler when you want a simple way to enforce a timeout on the entire HTTP handler response, particularly when you don’t control the handler logic or don’t need to cancel ongoing work—it only cuts off the response after the timeout but doesn’t stop the underlying processing.

Warning

Be careful when using http.TimeoutHander. If automatically applied to all handlers (as part of a middleware pipeline) then it will not work when it comes to a streaming endpoint (see the relevant Cloudflare article linked in the NOTE below).

**Client Ti

@cetinajero
cetinajero / ddrescue.md
Last active May 8, 2025 19:26
Guide for using Ddrescue to recover data

Guide for using Ddrescue to recover data

Start command:

ddrescue -d /dev/sda output.img output.mapfile

NOTE: If direct disc access is not available in your system, try raw devices.

@davydany
davydany / IPTABLES-CHEATSHEET.md
Last active June 1, 2025 22:08
IP Tables (iptables) Cheat Sheet

IP Tables (iptables) Cheat Sheet

IPTables is the Firewall service that is available in a lot of different Linux Distributions. While modifiying it might seem daunting at first, this Cheat Sheet should be able to show you just how easy it is to use and how quickly you can be on your way mucking around with your firewall.

Resources

The following list is a great set of documentation for iptables. I used them to compile this documentation.

@reasonset
reasonset / zsh_parellel_queue_sock.zsh
Created June 6, 2016 05:13
Multi thread programming in Zsh with Socket Queue version.
#!/usr/bin/zsh
zmodload zsh/net/socket
producer() {
typeset -i threads="$1"
typeset -i deadcount=0
shift
@CMCDragonkai
CMCDragonkai / bash_interactive_and_login.sh
Last active August 5, 2023 09:54
Bash & ZSH: Interactive and Login Shells
#!/usr/bin/env bash
[[ $- == *i* ]] && echo "This Bash Shell is Interactive Shell" || echo "This Bash Shell is Not a Interactive Shell"
shopt -q login_shell && echo "This Bash Shell is a Login Shell" || echo "This Bash Shell is Not a Login Shell"
@denji
denji / golang-tls.md
Last active June 28, 2025 04:34 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)