Skip to content

Instantly share code, notes, and snippets.

View lqshow's full-sized avatar
🌴
I may be slow to respond.

LQ lqshow

🌴
I may be slow to respond.
View GitHub Profile
@xh4n3
xh4n3 / trace_dns_drops.bt
Created November 1, 2021 08:41
trace_dns_drops traces DNS drops by ip_vs_in and ipt_do_table.
#!/usr/bin/env bpftrace
/*
* trace_dns_drops traces DNS drops by ip_vs_in and ipt_do_table.
*
* Background:
* 1. Before 5.9, ip_vs_in can cause UDP packets drops when IPVS RS deleted
* and source port reused, See https://github.com/kubernetes/kubernetes/issues/71514 for more details.
* 2. Misconfiguration of iptables can cause DNS drops.
*
* Usage:
@piyueh
piyueh / GCP_Slurm_Terraform.md
Last active December 6, 2022 03:03
Scripts to create a Slurm cluster on GCP with Terraform

README

Steps

  1. Install Google Cloud SDK: to manipulate cloud resources

  2. Install Terraform: to create/destroy clusters from pre-defined specs

@iamcryptoki
iamcryptoki / fix-sysctl.txt
Created July 29, 2019 09:20
Fix sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-iptables.
$ modprobe bridge
$ echo "net.bridge.bridge-nf-call-iptables = 1" >> /etc/sysctl.conf
$ sysctl -p /etc/sysctl.conf
sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-iptables: No such file or directory sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-ip6tables: No such file or directory
# SOLUTION
$ modprobe br_netfilter
$ sysctl -p /etc/sysctl.conf
@vik-y
vik-y / aliases-kafka.sh
Last active March 20, 2025 01:25 — forked from diegoicosta/aliases-kafka.sh
Aliases useful for working with kafka
#KAFKA ALIAS TO BE USED INSIDE DOCKER
export KAFKA_HOME=/opt/kafka
export BROKER="172.17.0.1:32768"
export BOOTSTRAP="172.17.0.1:32768"
export ZK="172.17.0.1:2181"
alias k-list-topics="$KAFKA_HOME/bin/kafka-topics.sh --list --zookeeper $ZK"
alias k-create-topic="$KAFKA_HOME/bin/kafka-topics.sh --create --zookeeper $ZK --replication-factor 1 --partitions 3 --topic"
@matthewpalmer
matthewpalmer / pod.yaml
Created October 22, 2018 00:57
Example for using NFS volume in pod
# Create a pod that reads and writes to the
# NFS server via an NFS volume.
kind: Pod
apiVersion: v1
metadata:
name: pod-using-nfs
spec:
# Add the server as an NFS volume for the pod
volumes:
@chris-peng-1244
chris-peng-1244 / winston-customize-timestamp-alias.js
Created July 27, 2018 08:03
winston@3.0 customize timestamp
import {createLogger, format, transports } from 'winston';
const {combine, timestamp, printf } = format;
const myFormat = printf((info, opts) => {
return `${info.time_is_money}: ${info.message}`;
});
const logger = createLogger({
format: combine(
timestamp({
@pantsel
pantsel / docker-compose.yml
Last active October 2, 2025 02:21
example docker-compose.yml for kong, postgres and konga
version: "3"
networks:
kong-net:
driver: bridge
services:
#######################################
# Postgres: The database used by Kong
@mattmccabe
mattmccabe / server.ts
Last active July 7, 2019 08:30
NestJS Swagger Setup
async function bootstrap() {
const server = express();
const app = await NestFactory.create(ApplicationModule, server);
const options = new DocumentBuilder()
.setTitle('My API')
.setDescription('Rest API')
.setVersion('1.0')
.setSchemes("https")
@asukakenji
asukakenji / 0-go-os-arch.md
Last active February 14, 2026 09:48
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@edsiper
edsiper / kubernetes_commands.md
Last active April 8, 2025 09:02
Kubernetes Useful Commands