Skip to content

Instantly share code, notes, and snippets.

@ctsrc
ctsrc / README.md
Last active July 21, 2024 15:15 — forked from niw/README.en.md
Guide: Run FreeBSD 13.1-RELEASE for ARM64 in QEMU on Apple Silicon Mac (MacBook Pro M1, etc) with HVF acceleration (Hypervisor.framework)
@bee-san
bee-san / timsort.py
Last active August 15, 2021 10:28
An Python implementation of Timsort
# based off of this code https://gist.github.com/nandajavarma/a3a6b62f34e74ec4c31674934327bbd3
# Brandon Skerritt
# https://skerritt.tech
def binary_search(the_array, item, start, end):
if start == end:
if the_array[start] > item:
return start
else:
return start + 1
@nadavrot
nadavrot / Matrix.md
Last active July 21, 2024 17:27
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@tusing
tusing / Zeal60_UnderglowGuidePublic.md
Last active January 23, 2024 18:25
A guide detailing how to enable underglow on the Zeal60 with WS2812 LEDs.

RGB Underglow Strip on the Zeal60: A Guide

A. Connecting the strip

You might find the full PCB image helpful. Ignore the red boxes!

  1. Connect V+ to the receiving end of the thermistor labeled F1; connect GND to the board's GND pin. (Avoid connecting +V to the board's +5V pin - you will likely overload the thermistor, and you will limit your maximum brightness.)
@iAnatoly
iAnatoly / base64
Created August 4, 2016 17:55
One-liners encoding and decoding Base64 in powershell
[System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("SecretMessage"))
[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String("U2VjcmV0TWVzc2FnZQ=="))
@martijnvermaat
martijnvermaat / nixos.md
Last active July 13, 2024 09:08
Installation of NixOS with encrypted root
@erincerys
erincerys / create-memtest-usb.sh
Created December 21, 2015 00:39
Prepare a USB flash drive with syslinux and memtest86+ for RAM testing
#!/bin/bash
# Install dependencies for creating filesystem and installing bootloader
## This script is mostly system-independent, except for this part. Replace yaourt and the args with your own package manager
yaourt -S --noconfirm mtools syslinux dosfstools
# Plug in the flash drive, and find its device. Don't mount it.
lsblk
while [[ $(echo $FLASHDEV | grep -c \/dev\/sd[a-z]) -lt 1 && -b "$FLASHDEV" ]] ; do
read -p 'Which device (e.g. /dev/sdf)? ' FLASHDEV
@rehno-lindeque
rehno-lindeque / NixSetup.md
Last active April 2, 2024 20:18
NixOS Setup (Virtualized + Haskell + Gnome3 + XMonad)

Setup NixOS (Virtualized + Haskell + Gnome3 + XMonad)

Before you get started

This is pretty out of date now... you may want to look elsewhere

Newer guides than mine (mine is a bit dated and has a lot of rough edges):

Have you looked at these?

@jgstew
jgstew / clientsettings.cfg
Last active October 3, 2018 01:09
An example clientsettings.cfg to set the default BigFix client settings at install time. Only works with the Windows EXE installer or the OS X installer. For linux, see here: https://github.com/jgstew/tools/blob/master/bash/install_bigfix.sh
__RelaySelect_Automatic=1
_BESClient_Resource_StartupNormalSpeed=1
_BESClient_Download_RetryMinutes=1
_BESClient_Download_CheckAvailabilitySeconds=120
_BESClient_Resource_WorkIdle=20
_BESClient_Resource_SleepIdle=500
_BESClient_PowerHistory_EnablePowerHistory=1
_BESClient_Comm_WakeOnLanForwardingEnable=1
_BESClient_Comm_CommandPollEnable=1
_BESClient_Comm_CommandPollIntervalSeconds=7200
@jboner
jboner / latency.txt
Last active July 23, 2024 10:32
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