Skip to content

Instantly share code, notes, and snippets.

Avatar

Vpnwall Services vpnwall-services

View GitHub Profile
@vpnwall-services
vpnwall-services / mysql-purge-binlog.md
Created Feb 12, 2021
[MYSQL PURGE BINLOG] MySQL Purge binlogs #mysql #purge #delete #binlog
View mysql-purge-binlog.md

List all binary logs

SHOW BINARY LOGS;

Delete binary logs older than 3 days

PURGE BINARY LOGS BEFORE DATE(NOW() - INTERVAL 3 DAY);

Drop old tables / rebuild tables

@vpnwall-services
vpnwall-services / jail.local
Created Feb 1, 2021 — forked from Nihisil/jail.local
Send notifications to the Slack from fail2ban
View jail.local
...
action_with_slack_notification = %(banaction)s[name=%(__name__)s, port="%(port)$
slack[name=%(__name__)s]
action = %(action_with_slack_notification)s
...
@vpnwall-services
vpnwall-services / sshtunnel-supervisor.conf
Created Jan 18, 2021
[SSHTUNNEL] SSH Tunnel to bind localhost only to workstation with supervisor #bash #ssh #tunnel #sshtunnel #bind #localhost #mysql #supervisor
View sshtunnel-supervisor.conf
[program:ssh_tunnel]
directory=/tmp/
command=ssh -L 8888:127.0.0.1:3306 -i /root/.ssh/tunnel.key user@remotehost.local -NnT
autostart=true
autorestart=true
user=root
redirect_stderr=true
numprocs=1
stdout_logfile=/tmp/ssh_tunnel.log
@vpnwall-services
vpnwall-services / CLAMAV-101.md
Last active Jan 19, 2021
[CLAMAV 101] ClamAV 101 #bash #clamav #signatures
View CLAMAV-101.md

CLAMAV 101

  • Add MD5 custom signatures sigtool --md5 test.exe >> /root/clamav_signatures.hdb

  • Generate signatures for all files found in a specific folder find . -maxdepth 1 -type f -exec sigtool --md5 {} >> /root/clamav_signatures.hdb \;

  • Use custom signature with report and delete infected files

@vpnwall-services
vpnwall-services / VBOX-101.md
Created Jan 1, 2021
[VBOX 101] Vbox 101 #vbox #101 #bash
View VBOX-101.md

VBOX 101

  • Boot physical W10 hard drive VBoxManage internalcommands createrawvmdk -filename /path/to/diskname.vmdk -rawdisk /dev/sdX
@vpnwall-services
vpnwall-services / WP PERF 101.md
Last active Dec 25, 2020
[Find Wordpress Performances Issues] FInd Wordpress performances issues #bash #wpcli #wp-cli #performances #issues
View WP PERF 101.md

WP PERF 101

Install module wp package install wp-cli/profile-command

Run module wp profile stage

Run module on specific part

@vpnwall-services
vpnwall-services / TR-101.md
Created Dec 25, 2020
[TR 101] TR 101 #tr #101 #remove #characters #bash #script #newlines #spaces #tabs #carriagereturn
View TR-101.md

TR 101

Remove spaces, tabs, newlines and carriage returns characters tr -d '\040\011\012\015'

@vpnwall-services
vpnwall-services / MOUNT-101.md
Created Dec 15, 2020
[MOUNT 101] Mount 101 #mount #101 #debian
View MOUNT-101.md

MOUNT 101

Mount SMB Share mount -t cifs -o username=myuser,rw,iocharset=utf8,file_mode=0777 //xxx.xxx.xxx.xxx/winshare windows/

@vpnwall-services
vpnwall-services / nginx-vhost-wordpress.conf
Created Dec 11, 2020
[Nginx VHOST Wordpress Example 2] Nginx VHOST Wordpress Example 2 #nginx #vhost #example
View nginx-vhost-wordpress.conf
server{
server_name myplatform.local;
listen 80;
# error_log /var/log/nginx/myplatform-error.log;
# access_log /var/log/nginx/myplatform-access.log;
# root /usr/local/nginx/html/myplatform/;
# index index.html;
# location /.well-known/pki-validation/ {
@vpnwall-services
vpnwall-services / jessie-to-stretch-upgrade.sh
Last active Dec 8, 2020
[Jessie to Stretch] Debian Jessie to Stretch upgrade #bash #debian #upgrade #jessie #stretch #apt
View jessie-to-stretch-upgrade.sh
#!/bin/bash
wget http://security-cdn.debian.org/debian-security/pool/updates/main/a/apt/libapt-pkg4.12_1.0.9.8.6_amd64.deb
wget http://security-cdn.debian.org/debian-security/pool/updates/main/a/apt/apt-transport-https_1.0.9.8.6_amd64.deb
dpkg -i *.deb
cat << EOF > /etc/apt/sources.list
deb http://deb.debian.org/debian stretch main contrib non-free
deb-src http://deb.debian.org/debian stretch main contrib non-free
deb http://security.debian.org/ stretch/updates main contrib non-free
deb-src http://security.debian.org/ stretch/updates main contrib non-free
deb http://deb.debian.org/debian stretch-updates main contrib non-free