Skip to content

Instantly share code, notes, and snippets.

@andrwj
andrwj / egos_throttle.sh
Created July 1, 2019 14:41 — forked from golimpio/egos_throttle.sh
Run cputhrottle for a list of applications in order to limit their CPU usage.
#!/bin/bash
# Run cputhrottle for a list of applications in order to limit their CPU usage.
# This script needs `pidof` and `cputhrottle` installed, which can be installed from homebrew.
# NOTE: This script was tested on MacOS only.
if [[ $EUID > 0 ]]; then
echo "Please run this script as root/sudo"
exit 1
fi
@andrwj
andrwj / nginx-tuning.md
Created July 30, 2019 20:24 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@andrwj
andrwj / install_emscripten.bat
Created May 12, 2020 07:40 — forked from marcusbelcher/install_emscripten.bat
Install Emscripten / Emsdk on Windows 10 via CMD
git clone https://github.com/juj/emsdk.git
cd emsdk
rd /s /q clang
rd /s /q emscripten
rd /s /q java
rd /s /q node
rd /s /q python
rd /s /q zips
git reset --hard HEAD
git checkout master
@andrwj
andrwj / colorscheme-override.md
Created June 2, 2020 05:46 — forked from romainl/colorscheme-override.md
The right way to override any highlighting if you don't want to edit the colorscheme file directly

The right way to override any highlighting if you don't want to edit the colorscheme file directly

Suppose you have weird taste and you absolutely want:

  • your visual selection to always have a green background and black foreground,
  • your active statusline to always have a white background and red foreground,
  • your very own deep blue background.

Your first reflex is probably to put those lines somewhere in your vimrc:

@andrwj
andrwj / composing-software.md
Created June 14, 2020 15:22 — forked from rosario/composing-software.md
Eric Elliott's Composing Software Series
@andrwj
andrwj / emacs-pkg-install.sh
Created June 11, 2021 18:49 — forked from padawanphysicist/emacs-pkg-install.sh
Install emacs packages from the command-line
#!/bin/bash
#
# I wrapped the code constructed in
#
# http://hacks-galore.org/aleix/blog/archives/2013/01/08/install-emacs-packages-from-command-line
#
# in a single bash script, so I would a single code snippet.
#
# Package to be installed
@andrwj
andrwj / README.md
Created June 29, 2021 04:18 — forked from zeevro/README.md
Pebble SDK installation script

Now that Pebble servers are gone, some old components in the SDK need to be patched or replaced so they can fetch what they need from Rebble.

This script downloads and installes everything needed to build projects and also run the emulator.

Was tested on Ubuntu 18.04.2 on WSL.

@andrwj
andrwj / Raspberry Pi 4 Arm64 Kernel Cross-Compile.md
Created September 17, 2021 13:31 — forked from G-UK/Raspberry Pi 4 Arm64 Kernel Cross-Compile.md
Building the Raspberry Pi 4 Arm64 Linux Kernel

The Raspberry Pi foundation have now released a beta version of an official 64-bit Kernel which can be installed using the rpi-update script. The rpi-update script can be found at https://github.com/Hexxeh/rpi-update/blob/master/rpi-update or through the Raspbian repositories

Introduction

The objective of these instructions is to build a stock 64bit Linux Kernel for use on the Raspberry Pi 4B on a Debian x64 machine (Windows Subsystem for Linux in my case), and deploy on the Raspberry Pi.

Notes:

  • Transfer to Pi is using my NAS in this example, replace with shared drive/memory stick etc. as required.
    • (N: drive on Windows and /mnt/NAS on Linux in this example).
  • For a specific Kernel version replace the 4.19 with the wanted version in the git clone command.
  • Greater than 3GB RAM only currently available on Kernel 4.19
@andrwj
andrwj / gist:c575f728f8dca8af7aad315744db47d4
Created September 19, 2022 16:12 — forked from cuu/gist:92bfa28a9b6de421834e5f9f408a12a4
lineage os 19.1 kernel .config for rpi4 cm4
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 5.10.112 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="real-aarch64-linux-android-gcc (GCC) 4.9.x 20150123 (prerelease)"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=40900
CONFIG_LD_VERSION=227000000
CONFIG_CLANG_VERSION=0
CONFIG_LLD_VERSION=0