localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
Sunday, December 26, 2021
Fix lc_* message error when start postgres
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
Dynamic install module Nginx
$ cd nginx-version
$ ./configure --with-compat --add-dynamic-module=../ModSecurity-nginx
$ make modules
$ cp objs/ngx_http_modsecurity_module.so /etc/nginx/modules
Tuesday, June 1, 2021
Build Nginx from source for Debian 10
apt install libssl-dev
wget https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz
tar -zxf pcre-8.44.tar.gz
cd pcre-8.44
./configure
make
cd \
wget http://zlib.net/zlib-1.2.11.tar.gz
tar -zxf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure
make
cd \
wget http://nginx.org/download/nginx-1.20.1.tar.gz
mkdir -p nginx/3party_module
mkdir -p nginx/nginx-rtmp-module
touch nginx/3party_module/config
touch nginx/nginx-rtmp-module/config
cd nginx-1.20.1
./configure --prefix=/home/othername/nginx --sbin-path=/home/othername/nginx/nginx --conf-path=/home/othername/nginx/nginx.conf --pid-path=/home/othername/nginx/nginx.pid --with-http_ssl_module --with-stream --with-mail=dynamic --add-module=/home/othername/nginx/nginx-rtmp-module --add-dynamic-module=/home/othername/nginx/3party_module --with-pcre=../pcre-8.44 --with-zlib=../zlib-1.2.11
make
make install
Builde portable nodejs
wget https://nodejs.org/dist/latest-v12.x/node-v12.22.1-linux-x64.tar.gz
tar xvf node-v12.22.1-linux-x64.tar.gz
nano .profile
# Nodejs
VERSION=v12.22.1
DISTRO=linux-x64
export PATH=/home/lucian/node-$VERSION-$DISTRO/bin:$PATH
Sunday, March 7, 2021
Ubuntu 20.04 glitch screen after suspend
sudo apt purge xserver-xorg-video-intel