Skip to content

Instantly share code, notes, and snippets.

View sub314xxl's full-sized avatar

Konstantin Mokhnatkin sub314xxl

  • Moscow, Russian Federation
View GitHub Profile
@v0lkan
v0lkan / nginx.conf
Last active June 4, 2025 19:21
Configuring NGINX for Maximum Throughput Under High Concurrency
user web;
# One worker process per CPU core.
worker_processes 8;
# Also set
# /etc/security/limits.conf
# web soft nofile 65535
# web hard nofile 65535
# /etc/default/nginx
@Iman
Iman / clean.sh
Last active June 11, 2025 13:45
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#!/bin/sh
#Check the Drive Space Used by Cached Files
du -sh /var/cache/apt/archives
#Clean all the log file
#for logs in `find /var/log -type f`; do > $logs; done
logs=`find /var/log -type f`
for i in $logs
@Badgerati
Badgerati / jenkins.ps1
Last active August 5, 2024 23:38
PowerShell wrapper around the inbuilt Jenkins CLI
########################################################
# Author: Matthew Kelly (Badgerati)
#
# This is a PowerShell wrapper around the inbuilt Jenkins CLI.
# It simplifies the calls to Jenkins, by just allowing you
# to call commands with a simple "jenkins" call.
#
# Best used with the path to the script in your PATH.
#
# Requirements:
@rkeithhill
rkeithhill / powershell.json
Last active March 20, 2025 09:49
PowerShell snippets file for Visual Studio Code - place in your ~\AppData\Roaming\Code\User\Snippets directory
{
"Condition statement": {
"prefix": "cond",
"body": [
"$1 { $0; break }"
],
"description": "Switch condition statement"
},
"Condition single quoted string statement": {
"prefix": "condsqstr",
@mondain
mondain / public-stun-list.txt
Last active June 18, 2025 22:55
Public STUN server list
23.21.150.121:3478
iphone-stun.strato-iphone.de:3478
numb.viagenie.ca:3478
s1.taraba.net:3478
s2.taraba.net:3478
stun.12connect.com:3478
stun.12voip.com:3478
stun.1und1.de:3478
stun.2talk.co.nz:3478
stun.2talk.com:3478
@olih
olih / jq-cheetsheet.md
Last active June 15, 2025 15:50
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@rkeithhill
rkeithhill / VSCode-settings.json
Last active October 30, 2024 13:33
My Visual Studio Code user settings
// Place your settings in this file to overwrite the default settings
{
"debug.toolBarLocation": "docked",
"diffEditor.ignoreTrimWhitespace": true,
"editor.codeLens": true,
"editor.detectIndentation": false,
"editor.dragAndDrop": false,
"editor.renderWhitespace": "none",
@so0k
so0k / kubectl.md
Last active February 4, 2025 17:16
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@CMCDragonkai
CMCDragonkai / stay-awake.ps1
Last active May 13, 2025 12:31
Keep Windows Awake Temporarily (Prevent Sleep, Display Off or Away Mode) #cli #powershell #windows
#!/usr/bin/env powershell
# This script can keep the computer awake while executing another executable, or
# if no executable was passed in, then it stays awake until this script stops.
# There are 3 different ways of staying awake:
# Away Mode - Enable away mode (https://blogs.msdn.microsoft.com/david_fleischman/2005/10/21/what-does-away-mode-do-anyway/)
# Display Mode - Keep the display on and don't go to sleep or hibernation
# System Mode - Don't go to sleep or hibernation
# The default mode is the System Mode.
# Away mode is only available when away mode is enabled in the advanced power options.
@ageis
ageis / systemd_service_hardening.md
Last active May 14, 2025 22:12
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict