Monthly Archives: July 2020

borg backup

borg init -e repokey /path/to/repo
borg create /path/to/repo::Day1 ~/public_html
borg create -v --stats /path/to/repo::Day2 ~/public_html

performance-critical code (chunking, compression, encryption) is implemented in C/Cython
local caching of files/chunks index data
quick detection of unmodified files

lz4 (super fast, low compression)
zstd (wide range from high speed and low compression to high compression and lower speed)
zlib (medium speed and compression)
lzma (low speed, high compression)

postfix remove received header

vi /etc/postfix/header_checks
/^Received:.*with ESMTPSA/ IGNORE
/^Received:/ IGNORE
/^X-Originating-IP:/ IGNORE
/^X-Mailer:/ IGNORE
/^Mime-Version:/ IGNORE

vi /etc/postfix/
mime_header_checks = regexp:/etc/postfix/header_checks
header_checks = regexp:/etc/postfix/header_checks

postmap /etc/postfix/header_checks
postfix reload

cloudflare style SNI proxy

git clone

yum groupinstall "Development Tools"
yum install autoconf automake curl gettext-devel libev-devel pcre-devel perl pkgconfig rpm-build udns-devel
cd sniproxy
./ && ./configure && make dist
rpmbuild --define "_sourcedir `pwd`" -ba redhat/sniproxy.spec
yum install /root/rpmbuild/RPMS/x86_64/sniproxy-0.6.0+git.10.g822bb80-1.el7.x86_64.rpm
sniproxy -c /etc/sniproxy.conf

Centos 7 x86_64:

laravel hacked database

Its serious security issue this default Laravel configuration. because .env file and database credentials are not protected. So you need to create a .htaccess file in same folder to protect it:

<Files .env>
order allow,deny
Deny from all

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]