mysqldump -h localhost --single-transaction database_name | 7z a -si backup.sql.7z
Category Archives: linux
7z centos 8
dnf install epel-release
dnf install p7zip p7zip-plugins
apache http_x_forwarded_for to remote_addr
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
linux date time calculator
python -c "from datetime import date as d; print(d.today() - d(2020, 10, 24))"
41 days, 0:00:00
linux find name with uppercase
find /some/path/ | grep -v "[a-z]"
rsync keep permissions and ownership
Good just to resync files:
rsync -avz --no-perms --no-owner --no-group
cat file list one line with spaces delimiter
grep pattern file | tr '\n' ' '
podman mount local directory
sudo podman run --name=ubuntu-1 --privileged --mount type=bind,source=/home/user/some_files,target=/root -p 9080:80 -it ubuntu:18.04 /bin/bash
git from source install
apt-get install dh-autoreconf libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev
apt-get install asciidoc xmlto docbook2x
ln -s /usr/bin/db2x_docbook2texi /usr/bin/docbook2x-texi
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz
tar -xf git-2.9.5.tar.gz
cd git-2.9.5
make configure
./configure --prefix=/opt/git
make all doc info
make prefix=/opt/git install install-doc install-html install-info
cat >> /etc/profile << EOF export GIT_HOME=/opt/git export PATH=${GIT_HOME}/bin:${PATH} EOF ource /etc/profile git --version also cant get update: git clone git://git.kernel.org/pub/scm/git/git.git
cache.h:42: error: expected specifier-qualifier-list before ‘z_stream’
yum install zlib-devel
Can’t locate ExtUtils/MakeMaker.pm
yum install perl-devel
/bin/sh: line 1: asciidoc: command not found
yum install asciidoc
/bin/sh: line 1: xmlto: command not found
yum install xmlto
iptables delay port
Simulate delayed and dropped packets
iptables -A INPUT -m statistic --mode random --probability 0.01 -j DROP
docker detach from running container
To detach the tty without exiting the shell, use the escape sequence Ctrl+P followed by Ctrl+Q. More details here.
Additional info from this source:
docker run -t -i → can be detached with ^P^Qand reattached with docker attach
docker run -i → cannot be detached with ^P^Q; will disrupt stdin
docker run → cannot be detached with ^P^Q; can SIGKILL client; can reattach with docker attach