Skip to content

Instantly share code, notes, and snippets.

View sergey-cheperis's full-sized avatar

Sergey Cheperis sergey-cheperis

View GitHub Profile
@sergey-cheperis
sergey-cheperis / khugepaged-lockup.md
Created December 10, 2021 11:57
Resolve khugepagesd 100% CPU usage or soft lockup

Issue

When running calculations with high rate of memory allocation, khugepaged can use 100% CPU or even cause CPU lockup messages in the kernel log:

INFO: task khugepaged:212 blocked for more than 120 seconds.

Solution

Disable transparent huge pages.

@sergey-cheperis
sergey-cheperis / kvm-hugepages.md
Last active January 7, 2022 17:20
Resolve slow startup of a KVM guest with 480 GiB RAM by preallocating huge pages

Issue

A guest with 480 GiB RAM on a 512 GiB machine is taking several minutes to start because memory pre-allocation is not fast enough (approx. 2 GiB/sec).

Solution

The solution is to have the necessary amount of RAM preallocated in the huge page pool, and to make QEMU/KVM use the pool for the guest.

  1. Check which page size is supported by the platform:
@sergey-cheperis
sergey-cheperis / proxmox7.1-ast25000-issue.md
Last active March 21, 2024 14:09
Resolve Proxmox 7.1 "installation aborted" on SuperMicro with AST 2500

Issue

On SuperMicro AS-4124GS-TNR server with ASPEED AST2500 BMC, Proxmox 7.1 installation does not start with "installation aborted" message.

Details

After setting up DHCP and Chrony, Proxmox fails to start the graphical installer and drops into the shell:

...
Starting Chrony for opportunistic time-sync... Starting a root shell on tty3.
@sergey-cheperis
sergey-cheperis / Makefile
Created November 13, 2021 13:29
Generic Makefile for a Go daemon
PREFIX=/usr/local
PROGRAM=<CHANGEME>
.PHONY: build clean install uninstall
bin/$(PROGRAM): src/*.go
go build -o bin/$(PROGRAM) src/*.go
build: bin/$(PROGRAM)
@sergey-cheperis
sergey-cheperis / pin-nvidia.sh
Last active May 16, 2023 22:04
Prevent NVIDIA driver from auto-updating and breaking vast.ai
#!/bin/bash
# This script "pins" currently installed nvidia driver to prevent it from auto-updating and breaking running vast.ai services.
# It creates the file /etc/apt/preferences.d/nvidia-manual-pin.
#
# From time to time, you'll still need to update the driver manually. Only do this while no vast.ai jobs are running
# (except your default jobs). Follow these steps:
#
# 1. Stop vast.ai and related things: `systemctl stop vastai docker cron`
# 2. Remove the pin: `rm -f /etc/apt/preferences.d/nvidia-manual-pin`
NSLog(@"UIFontWeightUltraLight = %@", @(UIFontWeightUltraLight));
NSLog(@"UIFontWeightThin = %@", @(UIFontWeightThin));
NSLog(@"UIFontWeightLight = %@", @(UIFontWeightLight));
NSLog(@"UIFontWeightRegular = %@", @(UIFontWeightRegular));
NSLog(@"UIFontWeightMedium = %@", @(UIFontWeightMedium));
NSLog(@"UIFontWeightSemibold = %@", @(UIFontWeightSemibold));
NSLog(@"UIFontWeightBold = %@", @(UIFontWeightBold));
NSLog(@"UIFontWeightHeavy = %@", @(UIFontWeightHeavy));
NSLog(@"UIFontWeightBlack = %@", @(UIFontWeightBlack));
@sergey-cheperis
sergey-cheperis / RNfontWeights.js
Created January 31, 2018 13:34 — forked from knowbody/RNfontWeights.js
React Native Font Weight Cheatsheet iOS
{ fontWeight: '100' }, // Thin
{ fontWeight: '200' }, // Ultra Light
{ fontWeight: '300' }, // Light
{ fontWeight: '400' }, // Regular
{ fontWeight: '500' }, // Medium
{ fontWeight: '600' }, // Semibold
{ fontWeight: '700' }, // Bold
{ fontWeight: '800' }, // Heavy
{ fontWeight: '900' }, // Black
@sergey-cheperis
sergey-cheperis / firefox-decrypt.cpp
Created December 9, 2017 20:37
Example program to decrypt passwords saved by Firefox for Windows
// Example program to decrypt passwords saved by Firefox for Windows.
//
// Uses NSS libraries: https://github.com/sergey-cheperis/nss-nspr-windows
// Uses JSON library: https://github.com/nlohmann/json
//
// Compile with MSVC:
// cl /I<path-to-nss>\include /EHsc firefox-decrypt.cpp /link /LIBPATH:<path-to-nss>\release\x64\lib
//
// NSS DLL's should be put to the .exe directory or to a directory in your PATH
//

Keybase proof

I hereby claim:

  • I am sergey-cheperis on github.
  • I am czz (https://keybase.io/czz) on keybase.
  • I have a public key ASBD0ul_mi546i4ImIIoacpyzVmfSknyC0QY-UzsPhcjLQo

To claim this, I am signing this object: