Skip to content

Instantly share code, notes, and snippets.

@ThinGuy
ThinGuy / add-arch-2-new-sources.sh
Last active May 5, 2024 10:00
Fix apt architecture error messages: "...doesn't support architecture 'i386'"
# To prevent unsuppoorted architecture error messages from apt on Ubuntu 24.04 (Noble Numbat)
# with the new apt sources format
# Example error messages on `apt update` after a fresh install:
# N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'https://packages.microsoft.com/repos/edge stable InRelease' doesn't support architecture 'i386'
# N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'https://dl.google.com/linux/chrome/deb stable InRelease' doesn't support architecture 'i386'
#################################################
### SINGLE-ARCH (i.e. fix arch-related error) ###
#################################################
@MaxXor
MaxXor / btrfs-guide.md
Last active May 5, 2024 10:00
Btrfs guide to set up an LUKS-encrypted btrfs raid volume with included maintenance & recovery guide

Encrypted Btrfs storage setup and maintenance guide

Initial setup with LUKS/dm-crypt

This exemplary initial setup uses two devices /dev/sdb and /dev/sdc but can be applied to any amount of devices by following the steps with additional devices.

Create keyfile:

dd bs=64 count=1 if=/dev/urandom of=/etc/cryptkey iflag=fullblock
chmod 600 /etc/cryptkey
@vasanthk
vasanthk / System Design.md
Last active May 5, 2024 09:57
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@yorickdowne
yorickdowne / noble.md
Last active May 5, 2024 09:49
Ubuntu Noble Numbat

Ubuntu Noble Numbat

This is a placeholder for the 15th August 2024 release of Ubuntu 24.04.1

To start, read the official release notes.

If your install fits into "vanilla Ubuntu plus maybe a handful of 3rd-party repos", then this guide for a simple upgrade to Ubuntu 24.04 "Noble Numbat" from Ubuntu 22.04 "Jammy Jellyfish" can be helpful. 3rd-party repos are handled with a find command.

@thatkookooguy
thatkookooguy / sleep-sort.js
Last active May 5, 2024 09:48 — forked from vstarck/sleep_sort.js
Sleep Sort in JavaScript | http://t.co/nWJACyK
// from: http://dis.4chan.org/read/prog/1295544154/170
function sleepSort(list, callback) {
const result = [];
list.forEach((i) => setTimeout(() => {
result.push(i);
if (result.length == list.length) {
callback(result);
}
@taskylizard
taskylizard / fmhy.md
Last active May 5, 2024 09:48
/r/freemediaheckyeah, in one single file (view raw)
@pszemraj
pszemraj / calculate_code_readability.py
Created November 6, 2023 17:01
heuristics for language agnostic code readability index
import re
from itertools import chain
def calculate_readability(code_string:str) -> float:
code = code_string.splitlines()
# Heuristic 1: Line length
max_line_length = 80
long_lines = sum(1 for line in code if len(line) > max_line_length)
@appeltel
appeltel / pubsub.py
Last active May 5, 2024 09:40
asyncio pubsub example
import asyncio
import random
class Hub():
def __init__(self):
self.subscriptions = set()
def publish(self, message):
@Klerith
Klerith / pasos-node-ts-jest.md
Created August 19, 2023 18:35
Note + TypeScript + Jest = Testing

Pasos para configurar Jest con TypeScript, en Node

Documentación oficial sobre Jest

  1. Instalaciones de desarrollo (super test es útil para probar Express)
npm install -D jest @types/jest ts-jest supertest
For a more organised and more update list please visit https://github.com/RayZz-/LCU-Arguments
This list will no longer be updated please refer to the repo linked above
These are known command line arguments for the LCU(including helper) some maybe outdated
or overtime may become outdated or some information maybe incorrect
if you would like to contribute please comment with updated information.
Usage example:
--app-name=kappa