List all binary logs
SHOW BINARY LOGS;
Delete binary logs older than 3 days
PURGE BINARY LOGS BEFORE DATE(NOW() - INTERVAL 3 DAY);
SHOW BINARY LOGS;
PURGE BINARY LOGS BEFORE DATE(NOW() - INTERVAL 3 DAY);
... | |
action_with_slack_notification = %(banaction)s[name=%(__name__)s, port="%(port)$ | |
slack[name=%(__name__)s] | |
action = %(action_with_slack_notification)s | |
... |
[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 |
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
VBoxManage internalcommands createrawvmdk -filename /path/to/diskname.vmdk -rawdisk /dev/sdX
Install module
wp package install wp-cli/profile-command
Run module
wp profile stage
Run module on specific part
Remove spaces, tabs, newlines and carriage returns characters
tr -d '\040\011\012\015'
Mount SMB Share
mount -t cifs -o username=myuser,rw,iocharset=utf8,file_mode=0777 //xxx.xxx.xxx.xxx/winshare windows/
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/ { |
#!/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 |