Skip to content

Instantly share code, notes, and snippets.

@SuriyaRuk
SuriyaRuk / jump.sh
Created October 11, 2024 07:13 — forked from tuxfight3r/jump.sh
kubectl jump server via kubectl port-forward
#!/usr/bin/env bash
# Allows you to connect to remote endpoints via port forward
set -e
TEMP_POD_NAME=db-jump-server
LOCAL_PORT=3307
REMOTE_HOST=prod.abc123.region-1.rds.amazonaws.com
REMOTE_PORT=3306
function cleanup {
@SuriyaRuk
SuriyaRuk / 01.bash_shortcuts_v2.md
Created September 25, 2024 14:42 — forked from tuxfight3r/01.bash_shortcuts_v2.md
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line
@SuriyaRuk
SuriyaRuk / lsof_netstat_on_macos.md
Created January 14, 2024 12:31 — forked from rollwagen/lsof_netstat_on_macos.md
lsof / netstat on macos

lsof / netstat on macos

lsof - list open files

  • display (list) all open TCP+UDP ports and grep for listening ones
    • sudo lsof -i -P | grep LISTEN
      COMMAND     PID           USER   FD   TYPE             DEVICE SIZE/OFF   NODE NAME
      launchd       1           root   11u  IPv6 0x26dd73cb700390df      0t0    TCP *:22 (LISTEN)
      ....
@SuriyaRuk
SuriyaRuk / README.md
Created December 24, 2022 19:07 — forked from djfdyuruiry/README.md
WSL 2 - Enabling systemd

Enable systemd in WSL 2

NOTE: If you have Windows 11 there is now an official way to do this in WSL 2, use it if possible - see MS post here (WINDOWS 11 ONLY)

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of install-sg.sh to a new file /tmp/install-sg.sh:

@SuriyaRuk
SuriyaRuk / sysctl.conf
Created June 1, 2022 07:27 — forked from maprangzth/sysctl.conf
ubuntu sysctl performance tuning
# Kernel sysctl configuration file for Linux
#
# Version 1.12 - 2015-09-30
# Michiel Klaver - IT Professional
# http://klaver.it/linux/ for the latest version - http://klaver.it/bsd/ for a BSD variant
#
# This file should be saved as /etc/sysctl.conf and can be activated using the command:
# sysctl -e -p /etc/sysctl.conf
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and sysctl.conf(5) for more details.
@SuriyaRuk
SuriyaRuk / 20211210-TLP-WHITE_LOG4J.md
Created December 12, 2021 09:46 — forked from SwitHak/20211210-TLP-WHITE_LOG4J.md
BlueTeam CheatSheet * Log4Shell* | Last updated: 2021-12-12 0023 UTC