Skip to content

Instantly share code, notes, and snippets.

04e6b3ca909f512ded95c8ac8e7c73bd6e73cfd6ec2726d70c1747d5b1f76ca92bba9538da3f140ea0a84b86d14eafab9ff83efecff81a521db58f1c6f6a2841a8
@microraptor
microraptor / quota
Last active August 4, 2018 23:19
This bash script displays information and a percentage bar of a defined quota. The total, unit and source of the used quota has to be defined in the file. quota.html takes the used quota from a file with only a number in the same directory.
#!/usr/bin/env bash
#######################################
# This script displays information and a percentage bar of a defined quota.
# The total, unit and source of the used quota has to be defined below.
# Color output and a GUI notification can be enabled.
# License: MIT
#######################################
# Unofficial strict mode
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Quota">
<title>Show Calendar</title>
<link href="https://fonts.googleapis.com/css?family=VT323" rel="stylesheet">
<style>
body {
@microraptor
microraptor / find-deep.sh
Last active March 7, 2020 15:19
find-deep - Find files or directories with given strings which are in the name or content
#!/bin/bash
####
# Find files or directories with given strings which are in the name or content
#
# Usage: find-deep PATH QUERY-STRING...
# Multiple strings can be passed.
# Ignores case and colors the output.
# Uses these two commands for each string:
# find PATH -iname *QUERY-STRING*
@microraptor
microraptor / ecc.md
Created May 9, 2020 20:08
An Overview of ECC Memory on Ryzen

Usually ECC memory is used in servers and not desktop workstations. However, Ryzen supports it, unlike Intel desktop CPUs. Except Ryzen non-Pro APUs (those with integrated graphics), don't have ECC support. The mainboard also has to support it and luckily most Asrock, Asus and some Gigabytes do. Please note that the ECC functionality has nothing directly to do with being registered and memory for Ryzen still has to be unregistered/unbuffered like in a normal desktop build.

The most common type of ECC memory has single-error correction and double-error detection (SECDED). Correctable 1-bit errors are corrected automatically. If an uncorrectable 2-bit error occurs, Linux will kill the process the memory is assigned to, while Windows goes straight to a BSOD stating an uncorrectable error occurred.

A small benefit of this compared to non-ECC memory is that obviously occasional 1-bit errors have no effect instead of the chance of silently corrupting data. However, errors should be incredible rare for stable cloc

@microraptor
microraptor / sponsor-skip.lua
Created June 21, 2021 22:54
This is a MPV (https://mpv.io/) script and should be placed into the scripts folder of its config folder. The script skips sponsor segments. It is meant to be used with downloaded Youtube videos via yt-dlp that have chapters marked with sponskrub.
--[[
This is a MPV (https://mpv.io/) script and should be placed into the scripts folder of its config folder.
The script skips sponsor segments.
It is meant to be used with downloaded Youtube videos via yt-dlp that have chapters marked with sponskrub:
https://github.com/yt-dlp/yt-dlp#sponskrub-sponsorblock-options
It also works with mpv_sponsorblock.
The actions for each type of segment can be configured below or in script-opts/sponsor-skip.conf.
All six segment types can be tested with these videos:
@microraptor
microraptor / rates.csv
Last active November 30, 2023 18:20
Preset rates and rates of established pilots for multicopter flight controllers. Collected in summer 2021. See also: https://github.com/betaflight/betaflight/wiki/Rate-Calculator
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 4.
"type","name","comment","source","roll_pitch_identical","roll_pitch_yaw_identical","roll_max_vel","pitch_max_vel","yaw_max_vel","roll_bf_rc_rate","roll_bf_super_rate","roll_bf_rc_expo","pitch_bf_rc_rate","pitch_bf_super_rate","pitch_bf_rc_expo","yaw_bf_rc_rate","yaw_bf_super_rate","yaw_bf_rc_expo","roll_actual_center","roll_actual_expo","pitch_actual_center","pitch_actual_expo","yaw_actual_center","yaw_actual_expo","roll_quick_expo","pitch_quick_expo","yaw_quick_expo","roll_kiss_rc_rate","roll_kiss_rate","roll_kiss_rc_curve","pitch_kiss_rc_rate","pitch_kiss_rate","pitch_kiss_rc_curve","yaw_kiss_rc_rate","yaw_kiss_rate","yaw_kiss_rc_curve"
,"Betaflight Default","the rate curve can’t be recreated with the Betaflight rate model","Betaflight Firmware",TRUE,TRUE,670,670,670,,,,,,,,,,70,0,70,0,70,0,,,,,,,,,,,,
,"Old Betaflight Default","default until BF 4.3","Betaflight Firmware","TRUE","TRUE",667,667,667,1,0.7,0,1,0.7,0,1,0.7,0,,,,,,,,,,,,,,,,,,
,"KISS Default","converted from KISS rates","KISS Firmware","TRUE","T