Skip to content

Instantly share code, notes, and snippets.

View rusxakep's full-sized avatar
💭
I may be slow to respond.

rusxakep

💭
I may be slow to respond.
View GitHub Profile
@rusxakep
rusxakep / init-start
Created July 3, 2021 11:35 — forked from yleshchuk/init-start
Change country to unlock channels, increase TX-power
#!/bin/sh
# https://github.com/RMerl/asuswrt-merlin.ng/wiki/User-scripts
# Tested on EU-model, channels changes work, however increasing TX-power probably not.
nvram set 0:ccode=US
nvram set 0:regrev=0
nvram set 1:ccode=US
nvram set 1:regrev=0
nvram set wl0_country_code=US
nvram set wl0_country_rev=0
nvram set wl0_reg_mode=off
@rusxakep
rusxakep / ASUS RT-AC87U
Created June 24, 2021 21:08 — forked from francoism90/README.md
Change country to unlock channels, increase TX-power
# Login into router using SSH and execute listed commands (AT OWN RISK!).
# To apply the settings on boot, paste the same settings in init-start.
nvram set asuscfe0:ccode=US
nvram set asuscfe1:ccode=US
nvram set asuscfe0:regrev=0
nvram set asuscfe1:regrev=0
nvram set asuscfecommit=1
nvram set 0:ccode=US
nvram set 1:ccode=US
nvram set 0:regrev=0
@rusxakep
rusxakep / 001-README.md
Created November 9, 2020 17:38 — forked from shbatm/001-README.md
Home Assistant USBIP Z-Wave Setup w/ More Robust Restart Management
@rusxakep
rusxakep / security.conf
Created October 9, 2020 23:02 — forked from mattia-beta/security.conf
NGINX Security Config
## Block SQL injections
set $block_sql_injections 0;
if ($query_string ~ "union.*select.*\(") {
set $block_sql_injections 1;
}
if ($query_string ~ "union.*all.*select.*") {
set $block_sql_injections 1;
}
@rusxakep
rusxakep / ddos.conf
Created October 9, 2020 20:23 — forked from mattia-beta/ddos.conf
IPtables DDoS Protection for VPS
### 1: Drop invalid packets ###
/sbin/iptables -t mangle -A PREROUTING -m conntrack --ctstate INVALID -j DROP
### 2: Drop TCP packets that are new and are not SYN ###
/sbin/iptables -t mangle -A PREROUTING -p tcp ! --syn -m conntrack --ctstate NEW -j DROP
### 3: Drop SYN packets with suspicious MSS value ###
/sbin/iptables -t mangle -A PREROUTING -p tcp -m conntrack --ctstate NEW -m tcpmss ! --mss 536:65535 -j DROP
### 4: Block packets with bogus TCP flags ###
@rusxakep
rusxakep / mount_qcow2.md
Created October 3, 2020 23:08 — forked from shamil/mount_qcow2.md
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@rusxakep
rusxakep / self-signed-certificate-with-custom-ca.md
Created September 30, 2020 16:47 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
#
# A CORS (Cross-Origin Resouce Sharing) config for nginx
#
# == Purpose
#
# This nginx configuration enables CORS requests in the following way:
# - enables CORS just for origins on a whitelist specified by a regular expression
# - CORS preflight request (OPTIONS) are responded immediately
# - Access-Control-Allow-Credentials=true for GET and POST requests