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
@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

Read-only debugging production server with ProxySQL

ProxySQL settings

docker-compose.yml

  proxysql:
    image: proxysql/proxysql
    ports:
      - 16032:6032
@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
@D4rk4
D4rk4 / ddos_discovery.md
Created February 16, 2021 20:06 — forked from KoeSystems/ddos_discovery.md
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

### Keyboard config
d-i debian-installer/locale string en_US.UTF-8
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string us
d-i keyboard-configuration/xkb-keymap us
d-i keyboard-configuration/xkb-keymap select us
d-i keyboard-configuration/toggle select No toggling
d-i keyboard-configuration/variantcode string American English
### Network configuration
@D4rk4
D4rk4 / gist:a95e90e7db26bec58ac12d4a69d1e78e
Created October 5, 2019 11:44 — forked from andrewlkho/gist:3d05108ddb363243198d93526980522e
Expanding storage on a Raspberry Pi using Amazon S3

I've been playing around with a Raspberry Pi hosted with Mythic Beasts and wanted a way to keep a large number of infrequently-accessed files on the server. A cost-effective place to store such data is on Amazon S3. After looking around at ways to mount an S3 bucket on the Raspberry Pi and have it appear as a regular filesystem, I came across s3backer. This provides a single file, divided into blocks, each of which is stored as an S3 object. A filesystem is mounted onto this file using a loopback mount. This setup has many benefits which are explained well in the README. Here's how to set it up on the Raspberry Pi.

I'm going to assume that you have an S3 bucket mybucket created and a user with credentials to access it. Although not explicitly specified, some of the commands below need to be run as root.

First, install prerequisites (the first line is

@D4rk4
D4rk4 / 99-keepwanalive
Last active May 22, 2019 21:15 — forked from navhaxs/99-keepwanalive
openwrt wan auto reconnect hotplug script
#!/bin/bash
# Place me in /etc/hotplug.d/iface/99-keepwanalive
IFNAME='wlan0'
if [ "$ACTION" = "ifdown" -a "$INTERFACE" = "$IFNAME" ]; then
COUNTER=0
PASS=0
while [ $PASS -eq 0 ]
A. Create Installation DVD ISO Via Dism:
1. Extract Win 10 Enterprise version of the mirror sources folder install.wim to D drive temp directory
2. In the temp directory to create WimMount folder, and execute the following command to mount the wim file
Dism /Mount-Wim /WimFile:D:\temp\install.wim /Index:1 /MountDir:D:\temp\WimMount
3. Show the current version
Dism /Image:D:\temp\WimMount /Get-CurrentEdition
4. Show current version
Dism /Image:D:\temp\WimMount /Get-TargetEditions
@D4rk4
D4rk4 / kmskeys10.txt
Last active July 11, 2021 17:28 — forked from CHEF-KOCH/kmskeys10.txt
Windows 10 KMS Keys
Windows.10.and.Office.2016.gVLK
#####################################################################
Error
“Error: 0xC004F069 On a computer running Microsoft Windows non-core edition, run ‘slui.exe 0x2a 0xC004F069’ to display the error text”
Solution
Find available target editions
DISM.exe /Online /Get-TargetEditions
@D4rk4
D4rk4 / improved-lnd-bitcoind-mainnet.md
Created June 25, 2018 10:57 — forked from tiero/improved-lnd-bitcoind-mainnet.md
Detailed guide to installing LND and Bitcoind on Ubuntu 16.04 LTS for Mainnet