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

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

apiVersion: v1
kind: Namespace
metadata:
name: echoserver
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: echoserver
namespace: echoserver
### 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 / ton-install.sh
Last active September 15, 2019 12:32
TON full node installation script for Debian 10
#!/bin/bash
export DEBCONF_FRONTEND=noninteractive
apt-get -y purge console-setup
apt-get update
apt-get -o Dpkg::Options::="--force-confold" -o Dpkg::Options::="--force-confdef" install -yq libghc-zlib-dev gperf build-essential make wget libreadline-dev git ccache libmicrohttpd-dev libssl-dev cmake libgflags-dev --allow-downgrades --allow-remove-essential --allow-change-held-packages
apt-get -o Dpkg::Options::="--force-confold" -o Dpkg::Options::="--force-confdef" dist-upgrade -yq
cd /usr/src
git clone --recurse-submodules -j8 https://github.com/ton-blockchain/ton
mkdir /tmp/ton-build
cd /tmp/ton-build
@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 ]
@D4rk4
D4rk4 / pwn-h0tb0x.sh
Last active May 19, 2019 20:59
Usage: pwn-h0tb0x.sh /path/to/pmkid_HOTBOXABCD_6C-2E-85-FE-BE-AA_2029-03-07T10-47-49.16800
#!/bin/bash
nethex=`echo ${1}|cut -f2 -d_|sed 's/HOTBOX//'|tr '[:upper:]' '[:lower:]'`
dict='/tmp/hothex.dict'
append_hex () {
while read pref
do
from=00 to=ff
if test "${#from}" -gt "${#to}"; then
format="$pref%0${#from}x$nethex\n"
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