Skip to content

Instantly share code, notes, and snippets.

View sleeyax's full-sized avatar

Sleeyax sleeyax

View GitHub Profile
@sleeyax
sleeyax / tunnel.go
Created May 4, 2022 13:58 — forked from movsb/tunnel.go
An HTTP Tunnel Proxy, which implements the CONNECT method. Written in Golang, within 100 lines of code.
package main
import (
"io"
"log"
"net"
"net/http"
"sync"
)
@sleeyax
sleeyax / make_certs.sh
Last active April 22, 2022 12:28 — forked from mediaupstream/make_certs.sh
extract ca-certs, key, and crt from a pfx file
#!/bin/bash
#
# Usage:
# ./make_certs.sh test.example.com
#
# The required input to make_certs.sh is the path to your pfx file without the .pfx prefix
#
filename=$1
@sleeyax
sleeyax / Xamarin_XALZ_decompress.py
Last active October 10, 2021 16:32
Xamarin XALZ Decompression
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Function: decompress special Xamarin .dll files"""
"""
Background information and file format documentation:
https://github.com/xamarin/xamarin-android/pull/4686
Installation notes:
@sleeyax
sleeyax / ubuntu_disable_swap.sh
Last active May 28, 2021 09:17 — forked from davidcorbin/commands.sh
Ubuntu Kubernetes disable swap permanently
sudo vim /etc/fstab
# Comment out lines that have the word swap on them
sudo reboot
@sleeyax
sleeyax / extract-android-apk.txt
Created April 7, 2021 22:46
Extract android APK cheatsheet
adb shell pm list packages
adb shell pm path com.example.someapp
adb pull /data/app/com.example.someapp-2.apk path/to/desired/destination
@sleeyax
sleeyax / introspection_urlencoded.txt
Created April 7, 2021 19:36 — forked from localh0t/introspection_urlencoded.txt
Introspection query from GraphQL-JS (URL-encoded)
%0A%20%20query%20IntrospectionQuery%20%7B%0A%20%20%20%20__schema%20%7B%0A%20%20%20%20%20%20queryType%20%7B%20name%20%7D%0A%20%20%20%20%20%20mutationType%20%7B%20name%20%7D%0A%20%20%20%20%20%20subscriptionType%20%7B%20name%20%7D%0A%20%20%20%20%20%20types%20%7B%0A%20%20%20%20%20%20%20%20...FullType%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20directives%20%7B%0A%20%20%20%20%20%20%20%20name%0A%20%20%20%20%20%20%20%20description%0A%20%20%20%20%20%20%20%20locations%0A%20%20%20%20%20%20%20%20args%20%7B%0A%20%20%20%20%20%20%20%20%20%20...InputValue%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%0A%20%20fragment%20FullType%20on%20__Type%20%7B%0A%20%20%20%20kind%0A%20%20%20%20name%0A%20%20%20%20description%0A%20%20%20%20fields(includeDeprecated%3A%20true)%20%7B%0A%20%20%20%20%20%20name%0A%20%20%20%20%20%20description%0A%20%20%20%20%20%20args%20%7B%0A%20%20%20%20%20%20%20%20...InputValue%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20type%20%7B%0A%20%20%20%20%20%20%20%20...TypeRef%0A
@sleeyax
sleeyax / latency.txt
Created December 8, 2020 14:27 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@sleeyax
sleeyax / kubernetes-commands.md
Last active May 7, 2022 00:19
Super useful kubernetes commands

Kubernetes commands

Edit an existing secret using an external env file

kubectl create secret generic <secret-name> --from-env-file=.env.prod --dry-run -o yaml | kubectl apply -f -

Copy secret from one namespace to another

kubectl get secret mysecret --namespace=default --export -o yaml | kubectl apply --namespace=dev -f -

Delete all evicted pods

kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod

@sleeyax
sleeyax / eslint-cheatsheet.md
Last active July 14, 2020 21:18
eslint cheatsheet

eslint cheatsheet

Configuring rules

Disable eslint check for the next line:

// eslint-disable-next-line no-use-before-define
var thing = new Thing();

Current line:

@sleeyax
sleeyax / cgo.md
Created July 6, 2020 14:00 — forked from zchee/cgo.md
cgo convert list

See also, http://libraryofalexandria.io/cgo/

Using Go cgo

cgo has a lot of trap.
but Not "C" pkg also directory in $GOROOT/src. IDE's(vim) Goto command not works.

So, Here collect materials.