Skip to content

Instantly share code, notes, and snippets.

View fnzv's full-sized avatar
🌐

Sami fnzv

🌐
View GitHub Profile
@fnzv
fnzv / krew-install.sh
Created November 24, 2023 09:04
Install kubectl krew on ubuntu
(
set -x; cd "$(mktemp -d)" &&
OS="$(uname | tr '[:upper:]' '[:lower:]')" &&
ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" &&
KREW="krew-${OS}_${ARCH}" &&
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" &&
tar zxvf "${KREW}.tar.gz" &&
./"${KREW}" install krew
)
@fnzv
fnzv / setting-up-mobile-data-tiles-android-13.txt
Last active July 30, 2023 11:53
How to setup mobile data tiles on Android 13
Install Shizuku
Install Better internet tiles
Connect your device to an adb shell and launch this command:
- adb.exe shell sh /storage/emulated/0/Android/data/moe.shizuku.privileged.api/start.sh
Open Shizuku and check that is running (as an alternative it's possible to Pair ADB without a computer by doing ADB via WIFI and use your phone split screen to confirm permissions)
Open Better internet tiles and add quick toggles
@fnzv
fnzv / developer-permissions.yaml
Created June 11, 2023 10:20
Create SA,Role,Rolebinding for a development namespace on K8s
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Namespace
metadata:
name: developer
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: developer-sa
@fnzv
fnzv / gen_alpha_numeric.sh
Created October 20, 2022 18:12
Generate random Alpha Numeric strings on txt file oneliner
for i in {1..100000}; do echo $(tr -dc A-Za-z0-9 </dev/urandom | head -c 5) >> output.txt;
done;
@fnzv
fnzv / hostmon.sh
Created July 10, 2022 17:32
Monitor LAN hosts and ship notifications to TG - example script
#!/bin/bash
#
#Script to monitor the network LAN ARP segment and send out notifications in case of changes
#Set it up via cronjob - e.g. */5 * * * * root cd /var/hostmon && bash hostmon.sh
#Save previous scan
cp scan.txt previousscan.txt
# Exception lists to be populated for flapping cases / dhcp / low wifi connection - Name or MAC address)
excluded_list=(Samsung FF:FF:46:FF:FF:FF)
Replace from line 30 to end of document
:30,.s/pattern1/pattern2/g
@fnzv
fnzv / delete.js
Created February 28, 2021 10:48 — forked from tidusjar/delete.js
Delete all movies that have been 'downloaded' in Radarr. Mass/bulk deleting.
// Go to Radarr and click 'settings' => 'general'.
// Open the JavaScript Console in Google Chrome (View => Developer => Javascript Console)
// Past the following in. Hit enter and away you go.
const key = document.getElementsByClassName('x-api-key')[0].value;
if (!key) {
alert('Navigate to /settings/general and run again');
}
@fnzv
fnzv / ipmi_example.sh
Created April 11, 2020 22:29
exclude ipmi intrusion example
./check_ipmi_sensor -H 10.1.102.130 -U xxxx -P xxxx -L xxxx -xST Physical_Security,OEM_Reserved,Session_Audit -xT Physical_Security
@fnzv
fnzv / iterm2.md
Created March 19, 2020 16:42 — forked from cgswong/iterm2.md
iterm2 shortcut cheat sheet

Note: You may have to go into Preferences (⌘,) -> Profiles -> Keys and enable Left option (⌥) key acts as: +Esc for the option commands to work.

Modifier Symbol
Option
Command
Control
Caps Lock
Shift
@fnzv
fnzv / shortcuts.txt
Created March 19, 2020 16:40
Quick shortcuts for future reference :)
# Quitting VIM fastly
ESC + ZZ (equal to wq! if file name is already set)
# Quitting VIM fastly no saving
ESC + ZQ
# Split pane
Command + d (iTerm2 split pane vertically)