Skip to content

Instantly share code, notes, and snippets.

View Laeeth's full-sized avatar

Laeeth Isharc Laeeth

View GitHub Profile
@Laeeth
Laeeth / OVERLAYFS
Created April 8, 2021 01:02 — forked from mutability/OVERLAYFS
readonly root via overlayfs
- install the two shellscripts into the appropriate places under /etc/initramfs-tools
- run update-initramfs
- put "overlay=yes" on the kernel command line
- reboot
With the overlay in place, the real root is mounted readonly on /ro.
Only the root fs is changed, other filesystems are mounted normally.
Remove "overlay=yes" (or change it to something other than yes) and reboot to go back to readwrite.
(This probably means that you want the commandline config to live somewhere other than on the root fs, e.g. under /boot)
@vedang
vedang / hey_notmuch!
Last active March 29, 2024 17:48
Notmuch configuration for Hey.com Style workflows.
- Specific Notmuch filters (and saved-searches) for:
+ The Feed (newsletters, blogs)
+ The Paper trail (receipts, ledger)
+ Screened Inbox (mail from folks you actually want to read)
+ Previously Seen (important mail that you've already read)
+ Unscreened Inbox (potential spam / stuff you don't want)
- Elisp Functions to move / categorize emails from a particular sender.
+ Adds tags needed by filters defined above to all email sent by a particular sender
+ Creates an entry in a DB file, which is used by the Notmuch post-new script when indexing new email, to auto-add the relevant tags.
@schveiguy
schveiguy / get_recursive.d
Created February 21, 2020 17:49
Another recursive range possibility, using simple linked-list stack.
import std.range;
struct StackFrame(T)
{
StackFrame* prev;
T range;
}
struct StackRange(T, alias recurse) if (isInputRange!(typeof(recurse(T.init))))
{
@elliottmorris
elliottmorris / historical_approval.R
Last active July 29, 2023 14:00
historical presidential approval ratings
rm(list = ls()) #reset the environment
library(tidyverse)
library(lubridate)
library(mgcv)
exponent_weight <- function(i) {
exp(-0.04*i)
}
TODAY_DAY <- difftime(Sys.Date(),as.Date("2017-01-21"))
@stain
stain / .notmuch-config
Last active November 13, 2023 08:17
NotMuch hooks for selectively sorting to inbox, moving archived messages to other folder. offlineimap syncs to /home/USER/mail/company and /home/USER/mail/org1
[database]
path=/home/USER/mail
[user]
name=MyName MySurname
primary_email=me@example.com
other_email=me@example.org
@MIvanchev
MIvanchev / article.md
Last active April 4, 2023 13:39
Ever wondered what it takes to run Windows software on ARM? Then this article might be for you!
@Khady
Khady / config.el
Last active February 27, 2023 12:25
OCaml and Reasonml emacs configuration
(use-package company
:ensure t
:custom
(company-quickhelp-delay 0)
(company-tooltip-align-annotations t)
:hook
((prog-mode utop-mode) . company-mode)
:config
(company-quickhelp-mode 1)
:bind

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@ericpulvino
ericpulvino / dhcp_snooping.sh
Last active June 3, 2019 14:28
Quick Script to Emulate Basic DHCP Trusted Ports / DHCP Snooping / DHCP Filtration
#!/bin/bash
# Root Check
if [ $(whoami) != 'root' ]; then
echo "ERROR: Must be root to run $0"
exit 1;
fi
TRUSTED_PORTS=( swp1 swp3 )
@Laeeth
Laeeth / latency.txt
Created October 27, 2015 02:57 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
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
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms