Skip to content

Instantly share code, notes, and snippets.

@doodaz
doodaz / (Almost) automatically install oh-my-posh.md
Created December 27, 2024 03:10 — forked from lendidenko/(Almost) automatically install oh-my-posh.md
This is a guide that helps you install oh-my-posh and its necessary boilerplate without deep dive to their documentation

(Almost) automatically install oh-my-posh

This is a guide that helps you install oh-my-posh and its necessary boilerplate without deep dive to their documentation

0. Pre-requisites

In this guide, it is assumed that you have installed:

  1. VS Code (User setup, not system one);
  2. PowerShell 6+, whatever way (Microsoft Store, WinGet, Portable);
@doodaz
doodaz / optimal_mtu.md
Created February 21, 2024 02:35 — forked from nitred/optimal_mtu.md
Wireguard Optimal MTU

About

  • I faced bandwidth issues between a WG Peer and a WG server. Download bandwidth when downloading from WG Server to WG peer was reduced significantly and upload bandwidth was practically non existent.
  • I found a few reddit posts that said that we need to choose the right MTU. So I wrote a script to find an optimal MTU.
  • Ideally I would have liked to have run all possible MTU configurations for both WG Server and WG Peer but for simplicity I choose to fix the WG Server to the original 1420 MTU and tried all MTUs from 1280 to 1500 for the WG Peer.

Testing

  • On WG server, I started an iperf3 server
  • On WG peer, I wrote a script that does the following:
    • wg-quick down wg0
  • Edit MTU in the /etc/wireguard/wg0.conf file
@doodaz
doodaz / aws_disable_auto_minor_version_upgrades.sh
Created October 30, 2023 17:05 — forked from gordonmurray/aws_disable_auto_minor_version_upgrades.sh
Simple script to list all RDS instances and then disable Automatic Minor Version Upgrades
# Simple script to list all RDS instances and then disable Automatic Minor Version Upgrades
# list RDS instances to a file
aws rds --region eu-west-1 describe-db-instances | jq -r '.DBInstances[].DBInstanceIdentifier' > rds.log
# loop over the items in the file, disable auto minor version upgrades
while read rds; do
aws rds modify-db-instance --region eu-west-1 --db-instance-identifier ${rds} --no-auto-minor-version-upgrade
sleep 5
done <rds.log
@doodaz
doodaz / README.md
Created May 11, 2023 23:39 — forked from Eyjafjallajokull/README.md
AWS EBS - Find unused snapshots

This script can help you find and remove unused AWS snapshots and volumes.

There is hardcoded list of regions that it searches, adjust the value to suit your needs.

Use snapshot.py snapshot-report to generate report.csv containing information about all snapshots.

snapshot.py snapshot-cleanup lets you interactively delete snapshot if it finds it is referencing unexisting resources.

./snapshots.py --help
@doodaz
doodaz / Linux_Administrator_Daily_Tasks
Created October 19, 2022 19:46 — forked from githubfoam/Linux_Administrator_Daily_Tasks
Linux_Administrator_Daily_Tasks
------------------------------------------------------------------------------------------
#CLI shortcut keystrokes(linux&MAC)
Ctrl+L: Clear the screen. This is similar to running the “clear” command.
Ctrl+C: Interrupt (kill) the current foreground process running in in the terminal. This sends the SIGINT signal to the process
Ctrl+Z: Suspend the current foreground process running in bash. This sends the SIGTSTP signal to the process. To return the process to the foreground later, use the fg process_name command.
Ctrl+D: Close the bash shell.This is similar to running the exit command
Ctrl+L: Clear the screen. This is similar to running the “clear” command.
Ctrl+S: Stop all output to the screen. This is particularly useful when running commands with a lot of long, verbose output, but you don’t want to stop the command itself with Ctrl+C.
Ctrl+Q: Resume output to the screen after stopping it with Ctrl+S.
@doodaz
doodaz / jconsole-proxy.sh
Created August 24, 2022 23:29 — forked from dsc/jconsole-proxy.sh
jconsole via ssh proxy
#!/bin/bash
#/ jc -- jconsole via ssh proxy
#/
#/ Usage: jc [options] HOST JMX_PORT [PROXY_PORT=JMX_PORT] [JMX_HOST=HOST]
#/
#/ Starts a SOCKS proxy via ssh to connect to a
#/ JVM running on a remote and protected machine.
#/
#/ Arguments:
@doodaz
doodaz / upgrade.sh
Created August 8, 2022 21:47 — forked from bocharsky-bw/upgrade.sh
Shell Script for Upgrade Ubuntu via APT in one step
#!/bin/bash
TEXT_RESET='\e[0m'
TEXT_YELLOW='\e[0;33m'
TEXT_RED_B='\e[1;31m'
sudo apt-get update
echo -e $TEXT_YELLOW
echo 'APT update finished...'
echo -e $TEXT_RESET
@doodaz
doodaz / gist:011dabc45c1bebb8c32281f004b3d216
Created March 29, 2022 08:10 — forked from vvuksan/gist:3100171
JMX collection using command line JMX client
#!/bin/bash
if [ $# -ne 3 ]; then
echo "You need to supply both JMX host and port and metric. Exiting ..."
exit 1
fi
JAVA_BIN="/usr/bin/java"
JMX_CMDLINE="/opt/ganglia/cmdline-jmxclient-0.10.3.jar"
GMETRIC_BIN="/usr/bin/gmetric -d 180"
@doodaz
doodaz / gist:37fc58a09bf494f026078d8cd015326b
Created March 29, 2022 08:10 — forked from vvuksan/gist:7f60f5552c2b96f39b16
Packet loss to Digital Ocean JFK
$ mtr -c 20 -r -w -z x.x.x.x
Start: Sat Dec 27 11:19:47 2014
HOST: xxxxxx Loss% Snt Last Avg Best Wrst StDev
<snip>
3. AS11426 gig10-0-0-424.rlghnca-rtr2.nc.rr.com 0.0% 20 19.2 25.6 10.6 73.2 13.1
4. AS11426 cpe-024-025-062-150.ec.res.rr.com 0.0% 20 14.2 14.3 10.8 36.4 5.3
5. AS11426 be31.chrcnctr01r.southeast.rr.com 0.0% 20 16.7 20.6 16.7 23.5 1.8
6. AS7843 bu-ether34.atlngamq46w-bcr00.tbone.rr.com 0.0% 20 28.5 24.7 20.6 33.9 3.6
7. AS7843 bu-ether21.atlngamq47w-bcr01.tbone.rr.com 0.0% 20 27.6 25.7 22.2 32.8 3.0
8. AS7843 107.14.17.190 0.0% 20 25.0 24.0 20.1 61.9 9.0