Skip to content

Instantly share code, notes, and snippets.

View NathanAdhitya's full-sized avatar

Nathan Adhitya NathanAdhitya

View GitHub Profile
@hanasuru
hanasuru / rod
Last active January 24, 2025 05:55
Reverse octal-dump
#!/usr/bin/env python
from __future__ import unicode_literals
from __future__ import division
import struct
import sys
import re
RULE = re.compile(r'(\d{7,})((\s?\d{6}){0,8})')
@dlqqq
dlqqq / ryzen_bug.md
Last active April 26, 2025 15:03 — forked from wmealing/C-states.md
AMD Ryzen "Freezing" Bug on GNU/Linux Systems

Random "Freezing" with AMD Ryzen CPUs

It seems that numerous GNU/Linux users (including myself) have been having issues with the system randomly "freezing" during light usage. From journalctl output and anecdotal accounts, it is speculated that the AMD Ryzen CPUs do not support other C-states for power management very well (at least on GNU/Linux distributions), and the freezing may be resolved by limiting the C-state of the CPU.

Possible Solution

Limiting the C-state of the CPU can be done through the addition of the following kernel boot parameter.

processor.max_cstate=1
@bitnik
bitnik / cihan.py
Last active October 3, 2024 10:54
Scan pdfs and rename them according to data in barcodes they contain.
import tempfile
import glob
import argparse
# import xlrd
import pandas
from os.path import join, basename
from shutil import copyfile
from pdf2image import convert_from_path # , convert_from_bytes
from pyzbar.pyzbar import decode
# from PIL import Image
@fuxingloh
fuxingloh / app.js
Last active July 31, 2024 14:31
How to use express.js and passport.js with G Suite SAML Apps SSO
const express = require('express')
const SamlStrategy = require('passport-saml').Strategy
const passport = require('passport')
const cookieSession = require('cookie-session')
const cookieParser = require('cookie-parser')
// Create express instance
const app = express()
@tsolar
tsolar / laravel-subdirectory.conf
Last active February 5, 2025 05:29
Laravel in subdirectory nginx example
server {
client_body_in_file_only clean;
client_body_buffer_size 32K;
client_max_body_size 300M;
sendfile on;
send_timeout 300s;
# Port that the web server will listen on.
#listen 80;