Skip to content

Instantly share code, notes, and snippets.

{
$schema: https://vega.github.io/schema/vega/v3.0.json
data: [
{
// query ES based on the currently selected time range and filter string
name: rawData
url: {
%context%: true
%timefield%: @timestamp
index: winlogbeat-*
@cGandom
cGandom / RaspberryPi4-qemu.md
Last active November 27, 2025 16:14
Emulating Raspberry Pi 4 with Qemu

Emulating Raspberry Pi 4 with Qemu

Just a quick update before we dive in: what we're actually doing here is running Raspberry Pi OS (64-bit) on a QEMU virtual ARM setup. This isn't full-blown hardware emulation of the Raspberry Pi 4, but more about creating a virtual environment for the OS. It doesn't mimic all the specific hardware features of the Pi 4, but it's pretty useful and great for general testing. I turned to this solution mainly to extract a modified sysroot from the Raspberry Pi OS, something not readily available in other resources. For those looking into detailed emulation of the actual Raspberry Pi 4's hardware in QEMU, check out this link for the latest updates: https://gitlab.com/qemu-project/qemu/-/issues/1208.

Hope it helps! :D

Shortcomings: No GUI yet, only console.

Steps

@hashmil
hashmil / StableDiffusion-prompt-generator.txt
Last active April 6, 2024 11:10
Stable Diffusion Prompt Generator (Modified from u/Veselyi_kot)
You are an expert AI image prompt generator. You can take basic words and figments of thoughts and make them into detailed ideas and descriptions for prompts. I will be copy pasting these prompts into an AI image generator (Stable Diffusion). Please provide the prompts in a code box so I can copy and paste it.
You need to generate an input prompt for a text-to-image neural network. The system accepts as correct the query string, where all arguments are separated by commas.
The words in prompt are crucial. Users need to prompt what they want to see, specifying artist names, media sources, or art styles to get desired results. Be descriptive in a manner similar to prompts provided below about what you want. It is more sensitive to precise wording. That includes adjectives and prepositions like “in front of [x]“, and “taken by [camera name]“.
It also supports weights. By bracketing the words you can change their importance. For example, (rainy) would be twice as important compared to "rainy" for the model, and
@zrruziev
zrruziev / NUMA node problem.md
Last active July 7, 2025 20:48
Fixing "successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero" problem

What is NUMA (Non-Uniformed Memory Access)

Non-Uniform Memory Access (NUMA) is one of the computer memory design methods used in multiprocessor systems, and the time to access the memory varies depending on the relative position between the memory and the processor. In the NUMA architecture, when a processor accesses its local memory, it is faster than when it accesses the remote memory. Remote memory refers to memory that is connected to another processor, and local memory refers to memory that is connected to its own processor. In other words, it is a technology to increase memory access efficiency while using multiple processors on one motherboard. When a specific processor runs out of memory, it monopolizes the bus by itself, so other processors have to play. , and designate 'access only here', and call it a NUMA node.

1. Check Nodes

lspci | grep -i nvidia
  
01:00.0 VGA compatible controller: NVIDIA Corporation TU106 [GeForce RTX 2060 12GB] (rev a1)
data = [{"Word":"average","Offset":51100000,"Duration":4700000},{"Word":"household","Offset":55900000,"Duration":4500000},{"Word":"income","Offset":60500000,"Duration":3700000},{"Word":"is","Offset":64300000,"Duration":1300000},{"Word":"up","Offset":65700000,"Duration":1900000},{"Word":"ten","Offset":67700000,"Duration":2100000},{"Word":"percent","Offset":69900000,"Duration":4200000},{"Word":"from","Offset":74200000,"Duration":1800000},{"Word":"four","Offset":76100000,"Duration":2500000},{"Word":"years","Offset":78700000,"Duration":2300000},{"Word":"ago","Offset":81100000,"Duration":4100000},{"Word":"and","Offset":87700000,"Duration":2300000},{"Word":"our","Offset":90100000,"Duration":900000},{"Word":"customers","Offset":91100000,"Duration":4700000},{"Word":"are","Offset":95900000,"Duration":700000},{"Word":"spending","Offset":96700000,"Duration":4700000},{"Word":"twenty","Offset":101500000,"Duration":3200000},{"Word":"percent","Offset":104800000,"Duration":4000000},{"Word":"more","Offset":108900000,"Duration
@webdev23
webdev23 / 💾RePack
Last active September 6, 2025 10:21
💾RePack bookmarklet. Dump static page in one html file, highlight contents, embed styles, convert images as data-uri, remove scripts.
// Bookmarklet
javascript:void (()=>{let e="";try{document.designMode="on",onmouseup=()=>{document.execCommand("backColor",!1,"chartreuse"),window.getSelection().removeAllRanges()};var n=/^\s*('|")/;[...document.styleSheets].forEach((t=>{[...t.rules].forEach((t=>{var o,c;e+=(o=t.cssText,c=function(e){var n;(n=e,fetch(n).then((e=>e.blob())).then((e=>new Promise(((n,t)=>{const o=new FileReader;o.onloadend=()=>n(o.result),o.onerror=console.log(n,t),o.readAsDataURL(e)}))))).then((e=>{console.log("RESULT:",e)}))},[/(@import\s+)(')(.+?)(')/gi,/(@import\s+)(")(.+?)(")/gi,/(url\s*\()(\s*')([^']+?)(')/gi,/(url\s*\()(\s*")([^"]+?)(")/gi,/(url\s*\()(\s*)([^\s'")].*?)(\s*\))/gi].reduce((function(e,t,o){return e.replace(t,(function(e,t,o,r,s){var a=c(r);return console.log(t,o,a,s),n.test(a)&&n.test(o)&&(o=s=""),t+o+a+s}))}),o))}))})),[...document.querySelectorAll("link")].forEach((e=>{e.outerHTML=""})),[...document.querySelectorAll("source")].forEach((e=>{var n;(n=e.src,fetch(n).then((e=>e.blob())).then((e=>new Promise(((
@pedrolamas
pedrolamas / docker-iptables-fix.sh
Created August 18, 2020 19:32
Script to fix Docker iptables on Synology NAS
#!/bin/bash
currentAttempt=0
totalAttempts=10
delay=15
while [ $currentAttempt -lt $totalAttempts ]
do
currentAttempt=$(( $currentAttempt + 1 ))
echo "Attempt $currentAttempt of $totalAttempts..."
@deyixtan
deyixtan / sublime_text_patch.md
Last active July 25, 2025 07:17
Sublime Text Patching Guide

Automated Patching

Download slt.py python script (supports multiple build) from this repository.

Usage

python slt.py <"sublime_text file path">


Manual Patching

@sgeto
sgeto / InstallNpcap.ps1
Last active September 10, 2024 11:01
A Non-Interactive Npcap Installation Script
# requires -version 4
#
# Copyright (C) 2018 Ali Abdulkadir <[email protected]> <[email protected]>
#
# 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, sub-license, and/or sell copies of the Software,
@raineorshine
raineorshine / human-readable-hash-comparisons.md
Last active July 21, 2024 20:31
An aesthetic comparison of a few human-readable hashing functions.

An Aesthetic Comparison of Human-Readable
Hashing Functions

The following compares the output of several creative hash functions designed for human readability.

sha1's are merely used as arbitrary, longer, distributed input values.

input 1 word output 2 word output 3 word output