Skip to content

Instantly share code, notes, and snippets.

View bonifaido's full-sized avatar

Nándor István Krácser bonifaido

View GitHub Profile
@mjkstra
mjkstra / arch_linux_installation_guide.md
Last active November 17, 2024 16:36
A modern, updated installation guide for Arch Linux with BTRFS on an UEFI system
@coin8086
coin8086 / tls-in-a-nutshell.md
Last active November 2, 2024 11:46
TLS in a Nutshell

TLS in a Nutshell

TOC

  • What's TLS?
  • TLS Protocol
  • TLS Implementation

What's TLS?

@lloeki
lloeki / arch-xhyve.sh
Created August 27, 2015 17:22
Run Arch Linux in xhyve
#!/bin/bash
tmp=$(mktemp -d)
pushd "$tmp"
iso=/Users/lloeki/Downloads/archlinux-2015.08.01-dual.iso
echo "fixing disk"
dd if=/dev/zero bs=2k count=1 of=tmp.iso
dd if=$iso bs=2k skip=1 >> tmp.iso
echo "mounting disk"
@ksvbka
ksvbka / CharDev_READ_ME
Last active March 26, 2024 20:05
Char_dev - A char driver example
B1: Build charDev bang cach su dung lenh make.
B2: Xem major trong log bang lenh dmesg
B3: Chinh sua file loadcript.sh de phu hop voi major trong he thong
B4: Build va chay chuong trinh test kiem tra ket qua
package design;
import java.lang.invoke.CallSite;
import java.lang.invoke.LambdaMetafactory;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodHandles.Lookup;
import java.lang.invoke.MethodType;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
@benjchristensen
benjchristensen / DebounceBuffer.java
Last active March 1, 2024 15:46
DebounceBuffer: Use publish(), debounce() and buffer() together to capture bursts of events.
import java.util.List;
import java.util.concurrent.TimeUnit;
import rx.Observable;
import rx.Subscriber;
import rx.schedulers.Schedulers;
public class DebounceBuffer {
public static void main(String args[]) {
@amirkdv
amirkdv / Transparent Proxy to docker containers.md
Last active August 22, 2020 02:14
Transparent Proxy to docker containers

This is an example of using Linux Kernel's Transparent Proxy to route all TCP traffic to docker containers without having to resort to PROXY protocol which is not supported by some applications (e.g. sshd). To get the demo to work you only need vagrant installed:

git clone [this-gist] tproxy-demo
cd tproxy-demo
vagrant up
@carlos8f
carlos8f / gist:3473107
Last active September 5, 2020 15:44
siege Mac OS X caveats
Mac OS X has only 16K ports available that won't be released until socket
TIME_WAIT is passed. The default timeout for TIME_WAIT is 15 seconds.
Consider reducing in case of available port bottleneck.
You can check whether this is a problem with netstat:
# sysctl net.inet.tcp.msl
net.inet.tcp.msl: 15000
# sudo sysctl -w net.inet.tcp.msl=100
@jboner
jboner / latency.txt
Last active November 18, 2024 08:23
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
@nominolo
nominolo / interp.c
Created May 9, 2012 12:49
Clang Ubuntu compilation error.
#include <stdio.h>
#include <stdint.h>
/*
This file tests a direct-threaded interpreter with the ability to
switch the mode (by modifying the dispatch table).
It uses one non-standard feature supported by GCC and Clang on Darwin,
namely "Labels as Values" (the syntax "&&label_name").