Skip to content

Instantly share code, notes, and snippets.

@zrruziev
zrruziev / NUMA node problem.md
Last active April 20, 2024 14:04
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)
@joeljacobs
joeljacobs / - instructions
Last active April 20, 2024 14:02
Rico SP C250DN Toner Reset on Raspberry Pi
Below are single-line commands to run in BASH on a Raspberry Pi to rewrite the toner chips to "full" for a Ricoh SP C250DN Printer.
You will need to have the 4 files below in the same directory: "black" "cyan" "magenta" and "yellow".
The chip is near one edge of the cartridge. The pad closest to the edge is GND, followed by VCC, DATA, and Clock.
On the Pi, connect VCC and GND to +3.3V and GND. Connect Data to (physical numbering) 3 and 5. They are the I2C Data and Clock pins.
Be sure i2c is enabled and installed.
modprobe -r i2c_bcm2708 ;modprobe i2c_bcm2708 baudrate=9600
@SaptakS
SaptakS / domain-age.php
Created January 20, 2016 08:48
PHP code to find Domain Age of a domain
<?php
$domain = $_GET['domain'];
$w = new DomainAge();
echo $w->age($domain);
class DomainAge
{
private $WHOIS_SERVERS = array(
"com" => array("whois.verisign-grs.com", "/Creation Date:(.*)/"),
"net" => array("whois.verisign-grs.com", "/Creation Date:(.*)/"),
@redbar0n
redbar0n / XState-boilerplate-refactor.mdx
Last active April 20, 2024 13:59
The MVC-widget - Through refactoring boilerplate out from an XState example

What if you could have vertically sliced MVC-widgets, that looked something like this?

Using React and XState.

//  A vertically sliced "MVC-widget"

//  VIEW:

export default function Users() {
@dcode
dcode / GitHub Flavored Asciidoc (GFA).adoc
Last active April 20, 2024 13:55
Demo of some useful tips for using Asciidoc on GitHub

GitHub Flavored Asciidoc (GFA)

@OrionReed
OrionReed / dom3d.js
Last active April 20, 2024 13:54
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯

VIDEOS MIGHT OUTDATED BUT TEXT IS NOT

this guide is not meant to help with leaking or any stupid things you might do to ruin experience for other people

Downloading

  • Get latest version from Github Actions not releases from here , if you dont have account you can use site like nightly.link to download it , Latest build
  • Extract zip file somewhere
chrome_bBlpF4CYiz.webm.mov

@szaydel
szaydel / umask-setting-user.txt
Created February 17, 2016 14:17
AFP on OSX tuning system settings
It may be necessary at times to modify umask settings in order to allow for shared file access.
This sets the umask to 0022, but other variants are also possible, assuming it is a value unix umask value.
# sudo launchctl config user umask 022
@victornpb
victornpb / start_server.command
Last active April 20, 2024 13:52
Bash script to start Minecraft server and keep it running if it crashes
#!/bin/bash
# Config
WINDOW_TITLE="Minecraft Server"
ONLINE_AUTH=true
RAM_INITIAL=512M
RAM_MAX=4G
RESTART_DELAY=10
################################################################################