Skip to content

Instantly share code, notes, and snippets.

View sleeyax's full-sized avatar

Sleeyax sleeyax

View GitHub Profile
@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.

@sleeyax
sleeyax / go2c.md
Last active October 13, 2024 01:39
CGO <-> C conversions list
Type C Call method Go type Bytes (byte) Numerical range
char C.char byte 1 -128~127
signed char C.schar int8 1 -128~127
unsigned char C.uchar uint8 1 0~255
short int C.short int16 2 -32768~32767
short unsigned int C.ushort uint16 2 0~65535
int C.int int 4 -2147483648~2147483647
unsigned int C.uint uint32 4 0~4294967295
long int C.long int32 or int64 4 -2147483648~2147483647
@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 / extracting_WPA_Enterprise_account_credentials.md
Created March 3, 2020 18:21
Extracting stored wifi WPA(2)-Enterprise credentials on Windows 10

Extracting WPA(2)-Enterprise credentials

Step by step guide for n00bs.

Requirements

Make sure you have the following software installed:

Guide

Open cmd as administrator, navigate to the directory where you downloaded the extractor tool and run it for the first time:

@sleeyax
sleeyax / README.md
Created February 29, 2020 19:39
Identifying TLS/SSL cipher suites

Identifying TLS/SSL cipher suites

A few methods to identify TLS/SSL cipher suites of a website.

nmap

nmap -Pn -p 443 --script=ssl-enum-ciphers <domain or ip>

python

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
ssl_sock = ssl.wrap_socket(s,cert_reqs=ssl.CERT_REQUIRED, ca_certs='/etc/ssl/certs/ca-certificates.crt')
@sleeyax
sleeyax / PimpMyStremio-on-Android.md
Last active February 25, 2025 17:47
PimpMyStremio on Android guide

PimpMyStremio on android

This guide teaches you how to install PimpMystremio on your android device. Please keep in mind that this is just an expirement. I strongly recommend to use PMS on your computer when possible.

You do not need root access or a high end phone to follow this guide. The only thing you need is +-2.5GB of free storage and a basic understanding of linux.

Installation

Preparation

First of all, go to the playstore and install termux (?). Temux is a terminal emulator that allows you to run basic linux commands on your android device. We will use this to install a Ubuntu chroot/proot container that will run PMS.

Secondly, go get the Hacker's Keyboard. It makes typing and navigation on termux way easier.

@sleeyax
sleeyax / README.md
Created May 31, 2019 20:28
README.md template

Title

Subtitle, small description or quote

forthebadge

Features