Skip to content

Instantly share code, notes, and snippets.

View itzwam's full-sized avatar
🔧
Can we fix it ? No it's f*cked !

toinux itzwam

🔧
Can we fix it ? No it's f*cked !
  • 0x69
  • /dev/null
View GitHub Profile
@itzwam
itzwam / if-up.d__iptables.sh
Last active April 7, 2024 11:54
IFUPDOWN2 IPTables script without duplicates
#!/bin/bash -x
# Adds IPTables rules only if they aren't found in the firewall config
IPTABLES="$(command -v iptables)"
IPTABLESS="$(command -v iptables-save)"
iptables() {
while [[ $# -gt 0 ]]; do
case "$1" in
@itzwam
itzwam / draconsole.sh
Created March 5, 2024 16:48
iDRAC Serial console
#!/bin/bash
# IDRAC_PASS=iciilfautentrerlemotdepassedesidrac
# ou bien l'exporter en variable d'environment
# ou alors l'inscrire dans le fichier ~/.config/sshpass/idrac
set -x
function check_deps() {
for cmd in expect ssh; do
@itzwam
itzwam / caddyconfig.lua
Last active March 5, 2024 16:10
GitLab CI/CD -> GoHugo -> MinIO / S3
domain.tld {
# Usefull variables to avoid repetion
vars s3Path bucketname/path/to/website/without/leading/slash
# Force HTML Mime-Type
@html path *.html
header @html Content-Type text/html
# Rewrite paths ending with '/' to '/index.html',
# because the S3 backend (Minio) sends an ugly XML directory listing otherwise.
@itzwam
itzwam / interfacesd_wireguard
Created October 22, 2023 17:56
IFUPDown2 compatible Wireguard configuration file
#auto vrf_KITTEN
#iface vrf_KITTEN
# vrf-table auto
auto wgXXXX
iface wgXXXX
ipv6-addrgen off
address 2001:db8::xxx::xxx/127
mtu xxx
@itzwam
itzwam / interfaces.d_wireguard
Created October 22, 2023 17:53
IFUpDown2-Compatible WireGuard configuration
#auto vrf_KITTEN
#iface vrf_KITTEN
# vrf-table auto
auto wgXXXX
iface wgXXXX
ipv6-addrgen off
address 2axx:xxx:xxx::xxx/127
mtu xxx
@itzwam
itzwam / podman-compose.initd
Created October 22, 2023 01:31
Podman-Compose wrapper OpenRC Service script
#!/sbin/openrc-run
: ${SUBCFGDIR:=/root/compose}
DOCKER_COMPOSE_UP_ARGS=${DOCKER_COMPOSE_UP_ARGS-"--no-build --no-recreate --no-deps"}
SUBSVC="${SVCNAME#*.}"
[ -z "${SUBSVC}" ] && exit 1
: ${SUBCFG:="${SUBCFGDIR}/${SUBSVC}/docker-compose.yml"}
DOCOCMD="/usr/bin/podman-compose"
export COMPOSE_HTTP_TIMEOUT=300
@itzwam
itzwam / tmux-cssh.rb
Created March 19, 2022 12:24
Tmux - Cluster SSH HomeBrew Formulas
class TmuxCssh < Formula
desc ""
homepage "https://github.com/peikk0/tmux-cssh"
license ""
head "https://github.com/peikk0/tmux-cssh.git", :branch => "master"
depends_on "tmux"
def install
@itzwam
itzwam / bira.zsh-theme
Created November 16, 2021 17:02
Bira + battery + @ color
# ZSH Theme - Preview: https://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png almost that
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
if [[ $UID -eq 0 ]]; then
local user_host='%{$terminfo[bold]$fg[red]%}%n$terminfo[bold]$fg[green]@$terminfo[bold]$fg[red]%m %{$reset_color%}'
local user_symbol='#'
else
local user_host='%{$terminfo[bold]$fg[green]%}%n$terminfo[bold]$fg[red]@$terminfo[bold]$fg[green]%m %{$reset_color%}'
local user_symbol='$'
fi
@itzwam
itzwam / haveibeenpwned.py
Created December 30, 2018 23:12
HaveIBeenPwned python tool
#######################################
# Python haveIBeenPwned interface
# usage : python haveibeenpwned.py [email]
# author : iTzwam
# github : https://github.com/itzwam
import requests
import sys
print("[#] Python HaveIBeenPwned interface")
@itzwam
itzwam / iploc2.py
Created December 30, 2018 18:28
python ip-api.com tool
import requests
import sys
import ipaddress
############################
# showinfos(ip)
#
def showinfos(ip):
response = requests.get("http://ip-api.com/json/{}?fields=130623".format(ip))