Skip to content

Instantly share code, notes, and snippets.

@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
@enisozgen
enisozgen / is_command_exist.yml
Last active May 8, 2024 02:47
ansible tasks that Checks if a program exists from a Bash script
- name: Check is rvm installed
shell: command -v rvm >/dev/null 2>&1
register: is_rvm_exist
ignore_errors: yes
- debug: msg="{{ is_rvm_exist.rc }}" # it returns rc 1
- debug: var=is_rvm_exist
- name: Check is ls installed
shell: command -v ls >/dev/null 2>&1

UniFi Sonos Configuration

Our goal today is to configure a VLAN for "Internet of Things" devices that is sequestered from our default private network. Devices on the private network are free to initiate connections into our IoT VLAN, but devices in the IoT VLAN should not be able to initiate connections to one another or to the private network.

The focus of this document is the configuration of UniFi system to allow Sonos speakers to operate across VLANs. Creating the VLAN itself is left to the user (there are many other guides out there that cover this topic). For our discussion, here are the networks we'll be working with:

  • 10.1.1.0/24 - this is our Private network where our trusted devices live.
  • 10.1.20.0/24 - this is our IoT network configured as VLAN 20; Sonos devices live here.

Sonos Speakers

Each Sonos speaker is assigned a static IP address via a DHCP reservation. These static IP addresses enable us to write some targeted firewall to allow the Sonos software to work across our V