Skip to content

Instantly share code, notes, and snippets.

View darthShadow's full-sized avatar
💭
I may be slow to respond.

Anagh Kumar Baranwal darthShadow

💭
I may be slow to respond.
  • Lavelle Networks
  • Bangalore, India
  • 06:28 (UTC +05:30)
View GitHub Profile
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@vasanthk
vasanthk / System Design.md
Last active August 23, 2024 19:56
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active August 24, 2024 21:08 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@gagarine
gagarine / fish_install.md
Last active August 13, 2024 20:13
Install fish shell on macOS Mojave with brew

Installing Fish shell on MacOS (Intel and M1) using brew

Fish is a smart and user-friendly command line (like bash or zsh). This is how you can instal Fish on MacOS and make your default shell.

Note that you need the https://brew.sh/ package manager installed on your machine.

Install Fish

brew install fish

@smammy
smammy / macOS-IPv6-Tunnel-DNS-HOWTO.md
Created December 13, 2018 19:14
How to convince macOS to do IPv6 DNS lookups when your only IPv6 address is via a VPN or tunnel of some sort

This was a huge hassle to figure out, so I wrote up a little guide in hopes that others would find it helpful:

How to convince macOS to do IPv6 DNS lookups when your only IPv6 address is via a VPN or tunnel of some sort

The Problem

macOS's domain name resolver will only return IPv6 addresses (from AAAA records) when it thinks that you have a valid routable IPv6 address. For physical interfaces like Ethernet or Wi-Fi it's enough to set or be assigned an IPv6 address, but for tunnels (such as those using utun interfaces) there are some extra annoying steps that need to be taken to convince the system that yes, you indeed have an IPv6 address, and yes, you'd like to get IPv6 addresses back for DNS lookups.

I use wg-quick to establish a WireGuard tunnel between my laptop and a Linode virtual server. WireGuard uses a utun user-space tunnel device to make the connection. Here's how that device gets configured:

@e00E
e00E / airvpn.md
Last active October 3, 2023 20:28
Why does a client connected to the AirVPN vpn service prefer IPv4 over IPv6 addresses?
#!/usr/bin/env python3
'''
calisuck: index, filter-out smartly and download ebooks from Calibre open directories
Installation:
You need python 3.5 installed
Download the file as a zip and unzip-it and get into the dir
@fryfrog
fryfrog / Android-SHIELD Android TV.xml
Last active November 8, 2022 18:31
A customized Plex profile for the Nvidia Shield, which goes in ./Library/Application Support/Plex Media Server/Profiles/
<!-- Put in ./Library/Application Support/Plex Media Server/Profiles/Android-SHIELD Android TV.xml -->
<!-- Author: Donald Webster fryfrog@gmail.com -->
<?xml version="1.0" encoding="utf-8"?>
<Client name="SHIELD Android TV">
<Identification>
<Header name="User-Agent" substring="SHIELD Android TV" />
</Identification>
<TranscodeTargets>
<VideoProfile container="mkv" codec="h264" audioCodec="aac" context="streaming" />
<MusicProfile container="flac" codec="flac" id="StereoMusicTranscodeProfile" />
@robertbaker
robertbaker / .env
Last active March 26, 2021 08:34
Traefik 2.0 example config with google forward-auth
UID=1000
TLD=mydomain.com
# ACME
ACME_EMAIL=admin@mydomain.com
CLOUDFLARE_EMAIL=admin@mydomain.com
CLOUDFLARE_API_KEY=xxxx
# OAUTH
OAUTH_CLIENT_ID=xxxx
@FHRNet
FHRNet / lambda_function.py
Created January 4, 2020 20:42
HetrixTools - Make Twilio calls through webhooks with AWS Lambda
#
# This microservice links HetrixTools and Twilio together through webhooks.
# If HetrixTools detects downtime, this microservice is called, which calls your phone/SIP number
# and announces which monitor detected an issue using TTS.
#
# GET Parameters:
# - token = Must match SecretKey
# - repeat = How many times should the message be repeated (optional, default 2)
# - to = Which number / SIP destination to call
#