Skip to content

Instantly share code, notes, and snippets.

View teebow1e's full-sized avatar
💖
learning something..

Trung Tran teebow1e

💖
learning something..
View GitHub Profile
## install uv on OS
curl -LsSf https://astral.sh/uv/install.sh | sh
## create new project
uv init myproj
## install packages
uv add django requests "pandas>=2.3"
## remove package
@teebow1e
teebow1e / ghcr.md
Last active May 30, 2025 17:49 — forked from yokawasa/ghcr.md
[Selfhost] ghcr (GitHub Container Registry)

ghcr (GitHub Container Registry) quickstart

CLI

To push container images to ghcr, you need peronal access token (PAT) - see how to create PAT

  1. Get PAT (personal access token)

Personal Settings > Developer settings > Personal access tokens

@teebow1e
teebow1e / ccf.md
Last active May 30, 2025 17:49 — forked from Bara/ccf.md
[Selfhost] Caddy with Cloudflare Proxy

Create API Key on Github

  • My Profile
  • API Tokens
  • Create Token
  • Edit zone DNS (Template)
  • Change permissions from Edit to Read (I tested this with Edit)
  • Add your domains/zones under Zone Resource
  • Add your IPv(4/6) under Client IP Adress Filtering
  • Click on Continue to summary
  • Click on Create Token
@teebow1e
teebow1e / gen.sh
Created February 23, 2025 15:44
generate random string - look like secret, but not secret
tr -dc A-Za-z0-9 </dev/urandom | head -c 32 ; echo
# remote
./cloudflared --url tcp://127.0.0.1:3389
# local
./cloudflared access tcp --hostname uncertainty-saints-newark-martin.trycloudflare.com --url 127.0.0.1:3388
# rdp to 127.0.0.1:3388
@teebow1e
teebow1e / a.py
Created December 31, 2024 08:47
string -> string.fromcharcode js - xss
def string_to_fromcharcode(input_string):
# Convert each character in the string to its char code
char_codes = [str(ord(char)) for char in input_string]
# Create the JavaScript String.fromCharCode representation
fromcharcode_str = "String.fromCharCode(" + ",".join(char_codes) + ")"
return fromcharcode_str
# Example usage
input_string = input()
result = string_to_fromcharcode(input_string)
@teebow1e
teebow1e / content.md
Created November 2, 2024 16:40
[Golang] Static build

Static build

CGO_ENABLED=1 CC=musl-gcc go build --ldflags '-linkmode=external -extldflags=-static'

Reference

https://mt165.co.uk/blog/static-link-go/
https://gist.github.com/zmb3/2bf29397633c9c9cc5125fdaa988c8a8
@teebow1e
teebow1e / k6http.js
Created October 21, 2024 03:24
[K6] Test HTTP
import http from 'k6/http';
import { check, sleep } from 'k6';
import { randomString } from 'https://jslib.k6.io/k6-utils/1.1.0/index.js';
// Options for the load test scenario
export let options = {
stages: [
{ duration: '30s', target: 50 },
{ duration: '3m', target: 100 },
{ duration: '30s', target: 0 },
@teebow1e
teebow1e / gen.sh
Created October 16, 2024 07:28
[Utility] Generate hash-like string with length
#!/bin/bash
head /dev/urandom | tr -dc 'a-f0-9' | head -c 8
@teebow1e
teebow1e / ps1_ip.md
Created September 27, 2024 17:48
add ip address of an interface to bash PS1
get_ip() {
    # Replace 'eth0' with your interface name, such as 'wlan0' for Wi-Fi
    local interface="ens33"
    ip addr show $interface 2>/dev/null | grep 'inet ' | awk '{print $2}' | cut -d'/' -f1
}

then add [$(get_ip)] to PS1 var