Skip to content

Instantly share code, notes, and snippets.

View sleeyax's full-sized avatar

Sleeyax sleeyax

View GitHub Profile
@sleeyax
sleeyax / reinstall-grub.sh
Last active February 20, 2023 09:59 — forked from ppartarr/reinstall-grub.sh
Reinstall grub after Windows updates (Arch & Windows dual boot)
#!/usr/bin/env bash
# list partitions
lsblk -f
# mount the root partition
mount /dev/nvme1n1p2 /mnt
# mount the boot partition
mount /dev/nvme1n1p1 /mnt/boot
@sleeyax
sleeyax / http_proxy.go
Created May 12, 2022 11:14 — forked from jim3ma/http_proxy.go
Register Dialer Type for HTTP&HTTPS Proxy in golang
package main
import (
"bufio"
"fmt"
"net"
"net/http"
"net/url"
"crypto/tls"
@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 / 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 / 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 / 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.

@sleeyax
sleeyax / README.md
Created June 8, 2020 13:48 — forked from roachhd/README.md
Basics of BrainFuck

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

BrainFuck Programming Tutorial by: Katie

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

INTRODUCTION

@sleeyax
sleeyax / technic-platform-api.md
Last active May 15, 2019 18:58 — forked from EpicKiwi/technic-platform-api.md
Reverse engeneering of the Technic platform API

Technic platform API

This is an attempt of reverse engineer the Technic platform API with a simple Wireshark and an official laucher. This is a simple HTTP based API returning JSON.

Global parameters

URL parameter build is always required to perform a request. The value can be anything but it seems to be a build number of the lauche; maybe for tracking reasons. If this parameters is not present in URL query parameters, all requests will return 401 Unauthorized response.