Skip to content

Instantly share code, notes, and snippets.

View mlouielu's full-sized avatar
🎯
floating

Louie Lu mlouielu

🎯
floating
View GitHub Profile
@zrruziev
zrruziev / NUMA node problem.md
Last active June 24, 2024 12:42
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)
@chrisaycock
chrisaycock / pcap_udp.cpp
Last active December 22, 2023 11:04
Example for accessing UDP packets in a pcap file
// answer to https://quant.stackexchange.com/q/55088/35
// compile with c++ pcap_udp.cpp -lpcap
#include <iostream>
#include <pcap/pcap.h>
#include <netinet/if_ether.h>
#include <netinet/ip.h>
#include <netinet/udp.h>
@Shreeyak
Shreeyak / realsense_recorder.py
Last active June 7, 2023 15:18
Script to record series of images from a realsense D400 series stereo camera using python API.
# pyrealsense2 is required.
# Please see instructions in https://github.com/IntelRealSense/librealsense/tree/master/wrappers/python
import pyrealsense2 as rs
import numpy as np
import cv2
import argparse
from os import makedirs
from os.path import exists, join
import shutil
import json
@PedroHLC
PedroHLC / kdeconnect.service
Created October 9, 2018 02:37
What I'm using to start kdeconnect in archlinux with i3 right now...
[Unit]
Description=KDE Connect
After=graphical.target
[Service]
Environment=DISPLAY=:0
ExecStart=/usr/lib/kdeconnectd
ExecStop=/usr/bin/kquitapp5 kdeconnectd
Restart=on-failure
BusName=org.kde.kdeconnect
@privatwolke
privatwolke / gather_dict.py
Created September 20, 2017 13:27
Python: Gather a dictionary of asyncio Task instances while preserving keys
async def gather_dict(tasks: dict):
async def mark(key, coro):
return key, await coro
return {
key: result
for key, result in await gather(
*(mark(key, coro) for key, coro in tasks.items())
)
}
@fire1ce
fire1ce / oh-my-zsh on openwrt or lede-project.md
Last active April 26, 2024 05:00
Install oh-my-zsh on openwrt/lede-project

Install oh-my-zsh on OpenWrt

Install Requirements Packages

opkg update && opkg install ca-certificates zsh curl git-http

Install oh-my-zsh

@xiaohanyu
xiaohanyu / draw_array_stack_by_tikz.org
Last active May 3, 2023 11:33
Demo of drawing an array stack by LaTeX TikZ in Emacs Org-mode.

This is a demo solution for exercise 10.1-1 of the famous CLRS’s Introduction to Algorithms, 3rd Edition book.

Clone and compile the Linux kernel
==================================
# Use some extra directory for all the components needed
cd c2c/
# Clone the repository (this will take a *few minutes*)
c2c$ git clone https://github.com/CTU-IIG/802.11p-linux.git
c2c$ cd 802.11p-linux
# Checkout particular branch