Discover gists
""" | |
Produces load on all available CPU cores. | |
Requires system environment var STRESS_MINS to be set. | |
""" | |
from multiprocessing import Pool | |
from multiprocessing import cpu_count | |
import time | |
import os |
const subjects = [ | |
{ | |
name: "Quizzes", | |
icon_custom_emoji_id: "5433614043006903194", | |
text: "Quizzes Topic", | |
}, | |
// etc | |
]; | |
const telegramToken = ""; | |
const chatId = ""; |
#!/usr/bin/swift | |
import Foundation | |
let path = URL(fileURLWithPath: NSString(string: "~/Library/Application Support/.ffuserdata").expandingTildeInPath) | |
let data = try! NSData(contentsOf: path) as Data | |
let dictionary = try! NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(data) as! NSDictionary | |
let mutableDictionary = dictionary.mutableCopy() as! NSMutableDictionary | |
for (key, value) in mutableDictionary { |
Many QNAP NAS devices only come with 1Gbe network interfaces. These devices can easily benefit from a simple network upgrade by connecting the ubiquitious 2.5Gbe USB NICs from Realtek. Unfortunately, some of the older QNAP NAS systems do not support the newer r8156 based 2.5Gbe NICs or r8157 based 5Gbe NICs as they run an older 4.x linux kernel and the r8152 source files included with the older linux kernel are based off an older codebase that predates the 8156/8157 series.
With some elbow grease however, we can build support for the 2.5 & 5 Gbe adapters and easily upgrade functionality.
package main | |
import ( | |
"fmt" | |
"net" | |
"os" | |
"syscall" | |
) | |
const ( |
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 |
Part of collection: Hyper-converged Homelab with Proxmox
Virtio-fs is a shared file system that lets virtual machines access a directory tree on the host. Unlike existing approaches, it is designed to offer local file system semantics and performance. The new virtiofsd-rs Rust daemon Proxmox 8 uses, is receiving the most attention for new feature development.
Performance is very good (while testing, almost the same as on the Proxmox host)
VM Migration is not possible yet, but it's being worked on!
apt install flex bison | |
git clone https://github.com/microsoft/WSL2-Linux-Kernel --depth 1 | |
cd WSL2-Linux-Kernel/tools/perf | |
make -j8 | |
sudo cp perf /usr/local/bin |