Skip to content

Instantly share code, notes, and snippets.

View kapb14's full-sized avatar
😤

Aleksandr Karushin kapb14

😤
View GitHub Profile
@flox1an
flox1an / default.conf
Last active March 18, 2026 18:16
nginx config that uses the oauth2-proxy (via auth_request) to authenticate against gitlab and then proxies all requests to a backend service while setting the auth headers X-User and X-Email
server {
listen 80;
server_name localhost;
location /oauth2/ {
proxy_pass http://oauth-proxy:4180;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Auth-Request-Redirect $request_uri;
@cherts
cherts / wget_on_bash.sh
Created April 28, 2021 12:05
Wget on pure Bash
#!/usr/bin/env bash
#
# Program: Wget on pure bash <wget_on_bash.sh>
#
# Author: Mikhail Grigorev <sleuthhound at gmail dot com>
#
# Current Version: 1.0.0
#
# License:
@cherts
cherts / get_linux_scheduler.sh
Last active March 3, 2023 13:21
Get Linux i/o scheduler and params
for i in $(ls -1 /sys/block/ | grep -oE 'sd[a-z]|nvme.*'); do echo -n "$i: rotational: $(cat /sys/block/$i/queue/rotational) | \
scheduler: $(cat /sys/block/$i/queue/scheduler) | \
nr_requests: $(cat /sys/block/$i/queue/nr_requests) | \
rq_affinity: $(cat /sys/block/$i/queue/rq_affinity)"; [ -f "/sys/block/$i/queue/read_ahead_kb" ] && echo -n " | read_ahead_kb: $(cat /sys/block/$i/queue/read_ahead_kb)"; [ -f "/sys/block/$i/queue/iosched/writes_starved" ] && echo -n " | writes_starved: $(cat /sys/block/$i/queue/iosched/writes_starved)"; [ -f "/sys/block/$i/queue/iosched/read_expire" ] && echo -n " | read_expire: $(cat /sys/block/$i/queue/iosched/read_expire)"; echo ""; done #| awk '!(NR%2){print p "\t\t\t" $0}{p=$0}'
@cherts
cherts / hotplug_add_cpu_and_mem.sh
Created September 1, 2021 09:34
Hotplug add CPU and Memory
#!/bin/bash
# Bring CPUs online
for CPU_DIR in /sys/devices/system/cpu/cpu[0-9]*
do
CPU=${CPU_DIR##*/}
echo "Found cpu: '${CPU_DIR}' ..."
CPU_STATE_FILE="${CPU_DIR}/online"
if [ -f "${CPU_STATE_FILE}" ]; then
if grep -qx 1 "${CPU_STATE_FILE}"; then