Skip to content

Instantly share code, notes, and snippets.

@fnky
fnky / ANSI.md
Last active May 24, 2024 18:11
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@IamMiracleAlex
IamMiracleAlex / create_snapshots.py
Created February 27, 2023 22:20
Move or sync database database in production to staging for testing (both database in different AWS accounts and VPCs)
import time
from datetime import datetime
import os
import boto3
from botocore.exceptions import WaiterError
from botocore.waiter import create_waiter_with_client
from celery import shared_task
from .custom_waiter import waiter_model
@rumansaleem
rumansaleem / clean-up-arch-linux.md
Created May 28, 2019 08:51
Instructions to clean up Arch Linux (Manjaro)

Contents

  • Clean pkg cache
  • Remove unused packages (orphans)
  • Clean cache in /home
  • remove old config files
  • Find and Remove
    • duplicates
    • empty files
    • empty directories
  • broken symlinks
@meta-ks
meta-ks / booster.js
Created July 27, 2023 09:01
audio booster for youtube and all
// Function to adjust the volume of a video element
function adjustVideoVolume(videoElement, volume) {
// Create an audio context
const audioCtx = new (window.AudioContext || window.webkitAudioContext)();
// Create a media element source from the video element
const source = audioCtx.createMediaElementSource(videoElement);
// Create a gain node to control the volume
const gainNode = audioCtx.createGain();
@rene-d
rene-d / colors.py
Last active May 24, 2024 18:05
ANSI color codes in Python
# SGR color constants
# rene-d 2018
class Colors:
""" ANSI color codes """
BLACK = "\033[0;30m"
RED = "\033[0;31m"
GREEN = "\033[0;32m"
BROWN = "\033[0;33m"
BLUE = "\033[0;34m"
@cb372
cb372 / riscv.md
Last active May 24, 2024 18:05
Writing an OS in Rust to run on RISC-V

(This is a translation of the original article in Japanese by moratorium08.)

(UPDATE (22/3/2019): Added some corrections provided by the original author.)

Writing your own OS to run on a handmade CPU is a pretty ambitious project, but I've managed to get it working pretty well so I'm going to write some notes about how I did it.

@weshouman
weshouman / README.md
Last active May 24, 2024 18:03
eBPF tips and tricks

The eBPF (Extended Berkeley Packet Filter) language is a low-level assembly-like language that is specifically designed for writing programs that can be loaded into the Linux kernel. These programs are typically used for networking, security, and observability tasks.

eBPF has its own domain-specific language (DSL), following are some information about it.

Characteristics of eBPF DSL:

  1. Low-Level: The language is closer to assembly than to high-level languages like C.

  2. Limited Instructions: eBPF has a limited set of instructions to ensure that programs are safe to run in the kernel space.

@ArtBIT
ArtBIT / GRUB_INIT_TUNE.md
Last active May 24, 2024 18:00
A collection of GRUB init tunes
@sekkr1
sekkr1 / android_gdb.md
Created August 12, 2019 15:27
Attaching GDB to Android apps' native libraries

How to GDB android native libraries

[1] Install NDK from android studio

[2] Push appropriate gdb-server to phone

adb push ~/android-sdk-linux/ndk-bundle/prebuilt/android-<arch>/gdbserver/gdbserver /data/local/tmp
adb shell "chmod 777 /data/local/tmp/gdbserver"
adb shell "ls -l /data/local/tmp/gdbserver"

[4] Forward ports

adb forward tcp:1337 tcp:1337

@Zafnok
Zafnok / LEARN.md
Last active May 24, 2024 17:58
Understanding how HVM works

Understanding how HVM works

Introduction

HVM takes the ideas of Interaction Combinators and combines it with the ideas of Type Systems, Functional Programming, and Compilers, to create an implementation of Yves Lafont's ideas into a highly parallelized runtime.

Resources

Start with the HVM whitepaper and HOW page of the repo, and if that makes sense to you, great! You're probably too smart for everything after. Otherwise, read into the next sections to develop the knowledge you're missing.

Intro to Lambda Calculus

Much of the Interaction Combinator papers are written with an audience presumed to be familiar with lambda calculus, so it is good to have some knowledge here before jumping into the Interaction Combinators section.

  • [Programming Languages](htt