Skip to content

Instantly share code, notes, and snippets.

@LQ80
LQ80 / backup_mysql_databases.bat
Created May 1, 2021 21:39
Backup MySQL Databases Batch File
@echo off
SET DIR="c:\wamp64\bin\mysql\mysql5.7.28\data\*"
FOR /D %%i IN (%DIR%) DO (
c:\wamp64\bin\mysql\mysql5.7.28\bin\mysqldump.exe -u root %%~nxi > DB\%%~nxi.sql
ECHO %%~nxi.sql
)
@LQ80
LQ80 / MS_SQL_-_Export_Binary_field_to_file.txt
Last active May 1, 2021 21:47
MS SQL - Export Binary field to file
bcp "SELECT [filedata] FROM [database].[dbo].[files] where [id] = {ID NUMBER}" queryout "{OUTPUT FILE NAME}" -S {MS SQL SERVAER NAME}\SQLEXPRESS -T -f bcp.fmt
@LQ80
LQ80 / iptables_forward.txt
Last active September 3, 2021 14:55
iptables forward
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/24 -j MASQUERADE
iptables -t nat -A PREROUTING -i eth0 -d 192.168.1.36 -p tcp --dport 8080 -j DNAT --to-destination 192.168.0.36:80
Other Commands:
===============
iptables -F
iptables -F -t nat
iptables -S