Skip to content

Instantly share code, notes, and snippets.

View gitdek's full-sized avatar

Joseph gitdek

  • 20:39 (UTC -04:00)
View GitHub Profile
@gitdek
gitdek / sudoers
Created November 24, 2017 05:02
sudoers
Defaults env_keep += "DISPLAY HOME"
Defaults !tty_tickets
Defaults timestamp_timeout=15
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
Defaults badpass_message="Password is wrong."
Defaults insults # turns off the badpass_message parameter
Defaults passwd_tries=5
Host_Alias HOST = madly
Host_Alias LAN = 192.168.1.0/255.255.255.0
#!/bin/bash
#
# har har
f=3 b=4
for j in f b; do
for i in {0..7}; do
printf -v $j$i %b "\e[${!j}${i}m"
done
done
#!/usr/bin/perl -w
use warnings; use strict;
# modified by dek on 2014-05-08
## Settings
our $daemon = 0; #run as a daemon or not (0/1)
our $logging = 0; #logging on or off (0/1)
our $logfile = 'proxydaemon.log';
@gitdek
gitdek / marking
Last active November 20, 2017 13:20
My my most favorite snipper, which also ends up saving me so much timeu
export MARKPATH=$HOME/.marks
function jump {
cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1"
}
function mark {
mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$1"
}
function unmark {
rm -i "$MARKPATH/$1"
}
@jboner
jboner / latency.txt
Last active October 16, 2025 23:33
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