Skip to content

Instantly share code, notes, and snippets.

View i8degrees's full-sized avatar

Jeffrey Carpenter i8degrees

View GitHub Profile
@i8degrees
i8degrees / NVMe_tweaks.md
Created April 21, 2025 23:10 — forked from v-fox/NVMe_tweaks.md
Linux kernel optimizations for NVMe

By default Linux distros are unoptimized in terms of I/O latency. So, here are some tips to improve that.

Most apps still don't do multi-threaded I/O access, so it's a thread-per-app which makes per-app speed always bottlenecked by single-core CPU performance (that's not even accounting for stuttering on contention between multiple processes), so even with NVMe capable of 3-6 GB/s of linear read you may get only 1-2 GB/s with ideal settings and 50-150/100-400 MB/s of un/buffered random read (what apps actually use in real life) is the best you can hope for.

All writes are heavily buffered on 3 layers (OS' RAM cache, device's RAM cache, device's SLC-like on-NAND cache), so it's difficult to get real or stable numbers but writes are largelly irrelevant for system's responsiveness, so they may be sacrificed for better random reads.

The performance can be checked by:

  • `fio --name=read --readonly --rw={read/randread} --ioengine=libaio --iodepth={jobs_per_each_worker's_command} --bs={4k/2M} --direct={0/1} --num
@i8degrees
i8degrees / nvme-vf
Created April 21, 2025 12:21 — forked from roolebo/nvme-vf
#!/bin/bash
# SPDX-License-Identifier: MIT
# Copyright (C) 2024 Roman Bolshakov.
# All rights reserved.
#
# The script was tested on Samsung PM173x with FW EPK9CB5Q and EPK9GB5Q.
#
# It's recommended to use at least VQ=3 VI=3 with PM173x for decent
# single-threaded I/O performance.
#

Steam Client on APFS Case Sensitive Mac OS Drive

If you are using APFS Case Sensitive File system and trying to use Steam, it will flicker & silently fail or show the following error message:

steam requires that '~/library/application support/steam/steam.appbundle/steam/contents/macos' be on a case-insensitive filesystem.

To fix the issue, follow the instruction here.

Run from your user account, NOT ROOT!

@i8degrees
i8degrees / sendkeys.awk
Created November 29, 2024 23:38 — forked from zambonin/sendkeys.awk
AWK script to send multiple `sendkey` commands to a QEMU virtual machine.
#!/usr/bin/env awk -f
#
# AWK script to send multiple `sendkey` commands to a QEMU virtual machine.
# It writes at a rate of roughly 40 keys per second, due to lower delays
# resulting in garbage output.
#
# It makes use of a TCP client created by an external utility, such as OpenBSD
# Netcat, to interact with QEMU's monitor and send a stream of `sendkey`
# commands. This is a practical way to transfer a small file or to script
# interactions with a terminal user interface.
Gigabytes (GB) Megabytes (MB) decimal Megabytes (MB) binary
1 GB 1,000 MB 1,024 MB
2 GB 2,000 MB 2,048 MB
3 GB 3,000 MB 3,072 MB
4 GB 4,000 MB 4,096 MB
5 GB 5,000 MB 5,120 MB
6 GB 6,000 MB 6,144 MB
7 GB 7,000 MB 7,168 MB
8 GB 8,000 MB 8,192 MB
@i8degrees
i8degrees / how-to-set-up-stress-free-ssl-on-os-x.md
Created August 13, 2017 22:17 — forked from jed/how-to-set-up-stress-free-ssl-on-os-x.md
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@i8degrees
i8degrees / index.html
Created July 9, 2016 11:43 — forked from anonymous/index.html
JS Bin Touchpad pinch demo // source http://jsbin.com/lotolelele
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Touchpad pinch demo" />
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
http://experimental.mural.ly/vnext-mural/sticky/200/webglbody {
-ms-scroll-rails: none;
}
@i8degrees
i8degrees / hosts.latest
Last active July 23, 2020 13:39
Ye'old pirates host config - hopefully early of a few revisions
# ...Adobe Products Activation Block...
127.0.0.1 na1r.services.adobe.com
127.0.0.1 na2m-pr.licenses.adobe.com
127.0.0.1 na4r.services.adobe.com
127.0.0.1 lm.licenses.adobe.com
127.0.0.1 lmlicenses.wip4.adobe.com
127.0.0.1 uds.licenses.adobe.com
127.0.0.1 192.150.14.69
#!/bin/sh -x ## or just ` curl -Ls http://git.io/vRozn | sh `.
## Downloads the Mac OS X 10.10 Recovery Partition update,
## Copy's over the 10.10 version of Disk Utility.app, then
## use git to apply a binary patch so it will run on 10.11+.
cd /tmp
rm -rf DU1010
mkdir DU1010