Skip to content

Instantly share code, notes, and snippets.

View D4rk4's full-sized avatar
🏠
Working from home

Dmitry Galenko D4rk4

🏠
Working from home
View GitHub Profile
apiVersion: v1
kind: Namespace
metadata:
name: echoserver
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: echoserver
namespace: echoserver
@D4rk4
D4rk4 / ddos_discovery.md
Created February 16, 2021 20:06
DDoS origin discovery

Caveats!! a human brain must be used !!!

First, get ALL your access IPs from your HTTP server

cut -d' ' -f1 /var/log/nginx/access.log | sort | uniq > /tmp/all_ips

Now we can use a docker image to have the IPtoASN API https://iptoasn.com/ running locally

docker run -itd --name my-iptoasn -p 80:53661 ilyaglow/iptoasn-webservice

@D4rk4
D4rk4 / mx80_boot.txt
Created May 15, 2021 19:12 — forked from halmartin/mx80_boot.txt
Meraki MX80 wired-14-202005181203-G201ba9ed-rel-gazebo
U-Boot 2009.11-00043-gf4c39d3-serengeti_DEV_1.19.01 (Feb 15 2012 - 10:40:18)
CPU: AMCC PowerPC 460 APM86290 at 1000 MHz PLB=500 MHz
(SOC=1000 AXI=250 AHB=166 APB=83 EBC=100)
Internal PCI arbiter disabled
32 kB I-Cache 32 kB D-Cache
Board: Fullerene-2 - Meraki Fullerene Cloud Managed Router
I2C: ready
DRAM: -2 GB at 800MHz
Default enable MDIO for ETH0

Read-only debugging production server with ProxySQL

ProxySQL settings

docker-compose.yml

  proxysql:
    image: proxysql/proxysql
    ports:
      - 16032:6032
@D4rk4
D4rk4 / 99-disks.rules
Created September 17, 2024 10:31
SAS ZFS-friendly settings via udev
# Performance settings (it's defaults in OEM firmware, but need to by ajusted for NetApp disks)
ACTION=="add|change", KERNEL=="sd[a-z]*", ENV{ID_BUS}="scsi", RUN+="/usr/bin/sdparm -s --clear=RCD /dev/%k"
ACTION=="add|change", KERNEL=="sd[a-z]*", ENV{ID_BUS}="scsi", RUN+="/usr/bin/sdparm -s --clear=DRA /dev/%k"
ACTION=="add|change", KERNEL=="sd[a-z]*", ENV{ID_BUS}="scsi", RUN+="/usr/bin/sdparm -s --set=PERF /dev/%k"
ACTION=="add|change", KERNEL=="sd[a-z]*", ENV{ID_BUS}="scsi", RUN+="/usr/bin/sdparm -s --set=WCE /dev/%k"
# Background media scan (for SAS disks)
ACTION=="add|change", KERNEL=="sd[a-z]*", ENV{ID_BUS}="scsi", RUN+="/usr/bin/sdparm -p bc -s EN_BMS=1 /dev/%k"
ACTION=="add|change", KERNEL=="sd[a-z]*", ENV{ID_BUS}="scsi", RUN+="/usr/bin/sdparm -p bc -s BMS_I=48 /dev/%k"
ACTION=="add|change", KERNEL=="sd[a-z]*", ENV{ID_BUS}="scsi", RUN+="/usr/bin/sdparm -p bc -s MIN_IDLE=2000 /dev/%k"
ACTION=="add|change", KERNEL=="sd[a-z]*", ENV{ID_BUS}="scsi", RUN+="/usr/bin/sdparm -p bc -s MAX_SUSP=500 /dev/%k"
@D4rk4
D4rk4 / hyperv-migration-win.md
Created September 24, 2024 10:01 — forked from scyto/hyperv-migration-win.md
Migrating Windows Gen2 VMs from Hyper-V

How To migrate Gen2 Windows VM from Hyper-V

This assumes you have Windows Server 2022 Gen2 VM running on hyper-v that uses gen2 with UEFI and Secure Boot - it should work for win11 but i haven't tested that. This has only tested with a vanilla windows server 2022 VM so far (three times to write guide). I will comment this gist when i manage to move one of my domain controllers.

I suggest creating a fresh test windows VM and use this procedure on that test VM long before you try this on a production VM. And repeat after me 'i will backup all VMs with snapshots AND will backup with backup application before i do this`... ok...

this gist is part of this series

VM preparation