Skip to content

Instantly share code, notes, and snippets.

@RikshaDriver
RikshaDriver / 0-compile-r8152-qnap.md
Last active May 8, 2024 03:08
Compiling Realtek 8152, 8156 and 8157 ( RTL8152 ) drivers for QNAP NAS

Compiling Realtek RTL 8152, 8156 and 8157 drivers for QNAP NAS

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.

rt_2 5gbe_qnap

@sloanlance
sloanlance / clone-private-github-repo-in-google-colab.ipynb
Last active May 8, 2024 03:07
clone-private-github-repo-in-google-colab.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Lisprez
Lisprez / epoll.go
Created March 29, 2019 06:47 — forked from tevino/epoll.go
Golang example for using epoll
package main
import (
"fmt"
"net"
"os"
"syscall"
)
const (
@jboner
jboner / latency.txt
Last active May 8, 2024 03:00
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

Mount Volumes into Proxmox VMs with Virtio-fs

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!

@abel0b
abel0b / install-linux-perf-on-wsl2.sh
Last active May 8, 2024 02:58
Install perf on WSL 2
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
@natesubra
natesubra / no_mp.bat
Created May 21, 2020 16:10
Disable Windows Defender - Powershell
# disable
powershell -command 'Set-MpPreference -DisableRealtimeMonitoring $true -DisableScriptScanning $true -DisableBehaviorMonitoring $true -DisableIOAVProtection $true -DisableIntrusionPreventionSystem $true'
# Or exclude
powershell -command 'Add-MpPreference -ExclusionPath "c:\temp" -ExclusionProcess "c:\temp\yourstuffs.exe"'
@b01
b01 / download-vs-code-server.sh
Last active May 8, 2024 02:51
Linux script to download latest VS Code Server, good for Docker (tested in Alpine).
#!/bin/sh
# Copyright 2023 Khalifah K. Shabazz
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the “Software”),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
:0: the only difference between digitalriver and technet is the _naming_, nothing else!
:1: please VERIFY md5/sha1-sums after each download (msdn-links containing proof of sha1-sums are linked behind each iso)
:2: the isos are provided as is
:3: if you\'re a microsoft representative, please dont be pissed, i just help your customers where you leave \'em in the dark (i do not provide keys here!), thank you!
## DIGITALRIVER ## ## TECHNET ## ## MD5 ## ## SHA-1 ## ## MSDN ##
------------- de_windows_7_starter_with_sp1_x86_dvd_u_678545.iso 7e88e30b655dc9bb8ce0a2e2a4f803f3 37bb946b83ef5ed801a634bd644abf03bf15952a 46892
------------- de_windows_7_starter_n_with_sp1_x86_dvd_u_678311.iso ae512ac4abd6e5bfc9323011e19efc43 d91321298c5483ea74e2264020c36adcffccaae6 46923
------------- de_windows_7_home_basic_with_sp1_x86_dvd_u_676467.iso 9cf2cf1d30404b9fa71acf4db7e28d67 5b86b6690b2ef236e71b256794a625c44d846952 47165