Skip to content

Instantly share code, notes, and snippets.

View John-Lin's full-sized avatar
👋
hi

Che-Wei Lin John-Lin

👋
hi
View GitHub Profile
@glennmatlin
glennmatlin / claude_code_hooks_for_uv.md
Last active February 10, 2026 18:58
Claude Code hooks for working with `uv`

Claude Code Hooks for working with uv

by Glenn Matlin / glennmatlin on all socials

What This Does

Prevents Claude Code from using pip, python, pytest, etc. directly in projects that use uv for Python environment management. Instead, Claude is guided to use uv run, uv add, etc.

Smart detection:

  • Only activates in directories with pyproject.toml
@lattner
lattner / TaskConcurrencyManifesto.md
Last active February 8, 2026 23:00
Swift Concurrency Manifesto
@coco98
coco98 / kube-registry.yaml
Created May 2, 2017 16:31
Docker registry on minikube
apiVersion: v1
kind: ReplicationController
metadata:
name: kube-registry-v0
namespace: kube-system
labels:
k8s-app: kube-registry
version: v0
spec:
replicas: 1
@StevenACoffman
StevenACoffman / Comparison of multi-host Docker networking.md
Last active June 27, 2022 09:14
Comparison of multi-host Docker networking
@vishalwy
vishalwy / compare.py
Last active September 5, 2022 09:57
Compares /proc/stat vs top
#!/usr/bin/env python
import re
import os
import sys
import threading
import subprocess
import getopt
import time
@zed
zed / run-script-on-alert-pipe.py
Last active March 30, 2023 18:28
React to snort alert
#!/usr/bin/env python
"""Run `snort -A console` command using a pipe.
Warning! Alerts are delayed until snort's stdout buffer is flushed.
"""
from __future__ import print_function
from subprocess import Popen, PIPE, STDOUT
snort_process = Popen(['snort', '-A', 'console', '-c', 'snort.conf'],
stdout=PIPE, stderr=STDOUT, bufsize=1,
@phalt
phalt / main.go
Created December 3, 2014 14:51
Simple HTTP API in Go
package main
import (
"github.com/gin-gonic/gin"
"database/sql"
"github.com/coopernurse/gorp"
_ "github.com/mattn/go-sqlite3"
"log"
"time"
"strconv"
@tmarshall
tmarshall / aws-sns-example.js
Last active October 30, 2022 06:12
aws-sdk sns example, in Node.js
var AWS = require('aws-sdk');
AWS.config.update({
accessKeyId: '{AWS_KEY}',
secretAccessKey: '{AWS_SECRET}',
region: '{SNS_REGION}'
});
var sns = new AWS.SNS();
@afolarin
afolarin / resource_alloc_docker.md
Last active December 22, 2025 22:00
Resource Allocation in Docker

#Container Resource Allocation Options in docker-run

now see: https://docs.docker.com/engine/reference/run/#runtime-constraints-on-resources

You have various options for controlling resources (cpu, memory, disk) in docker. These are principally via the docker-run command options.

##Dynamic CPU Allocation -c, --cpu-shares=0
CPU shares (relative weight, specify some numeric value which is used to allocate relative cpu share)

@ozooxo
ozooxo / gist:10600945
Last active June 22, 2025 12:17
Set up honeyd (ubuntu 12.04)
# installation
sudo apt-get install honeyd
sudo apt-get install nmap #(supported software for port scanning)
# check my eth0 address
ifconfig
### eth0 Link encap:Ethernet HWaddr 00:26:2d:f9:db:be <-----------------use this one
### inet addr:192.168.0.103 Bcast:192.168.0.255 Mask:255.255.255.0
### inet6 addr: fe80::226:2dff:fef9:dbbe/64 Scope:Link