Monday, January 23, 2023
Sunday, December 26, 2021
Fix lc_* message error when start postgres
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
Saturday, June 19, 2021
Install nftables
apt update
apt install make git autoconf autogen libtool bison flex asciidoc libgmp-dev libreadline-dev pkg-config
git clone -b libmnl-1.0.4 git://git.netfilter.org/libmnl
cd libmnl
sh autogen.sh
./configure
make -j 4 install
echo "install libnftnl-1.2.0"
cd
git clone -b libnftnl-1.2.0 git://git.netfilter.org/libnftnl
cd libnftnl
sh autogen.sh
./configure --libdir=/lib/x86_64-linux-gnu/
make -j 4 install
echo "install nftables v0.9.9"
cd
git clone -b v0.9.9 git://git.netfilter.org/nftables
cd nftables
sh autogen.sh
./configure --libdir=/lib/x86_64-linux-gnu/
make -j 4 install
echo "add crontab on reboot"
echo "@reboot root nft -f /etc/nftables.conf" >> /etc/crontab
Monday, June 7, 2021
Build mysql from Source
apt build-dep mariadb-server
mkdir mariadb-build
cd mariadb-build
git clone -b 10.5 https://github.com/MariaDB/server.git
mkdir mariadb
cd mariadb
cmake ../server -DBUILD_CONFIG=mysql_release
make package
Wait about 30 min for build, it will export binary file tarball .tar.gz
Copy that file to home and extract it
cd mariadb-version
Create some directories for log, config...
mkdir log
mkdir tmp
mkdir database
mkdir binlog
Create my.cnf file and .sh files for simplified action
Copy shared libraries to portablelib, use generate_portablelib.sh
Sunday, June 6, 2021
Program open port 80 with normal user
sudo setcap 'cap_net_bind_service=+ep' /path/to/program
Saturday, June 5, 2021
Portable Mongodb
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian10-4.4.6.tgz
tar xvf mongodb-linux-x86_64-debian10-4.4.6.tgz
cd mongodb-linux-x86_64-debian10-4.4.6/
mkdir database
mkdir logs
touch logs/mongodb.log
nano start_mongo.sh
cd bin
./mongod --dbpath ../database --directoryperdb --logpath ../logs/mongodb.log &
nano stop_mongo.sh
cd bin
./mongod --dbpath ../database --directoryperdb --logpath ../logs/mongodb.log --shutdown