for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done | sort -k 2 -n -r | less
php_version: 7.4 | |
php_version_redhat: "{{ php_version | regex_replace ('[.~]', '') }}" | |
###Will return | |
###"msg": 74 |
#on old | |
mysqldump -udebian-sys-maint -p$PASSWORD mysql user > user_table_dump.sql | |
#on new | |
mysql -udebian-sys-maint -p$PASSWORD mysql < user_table_dump.sql | |
#login to mysql | |
mysql> flush privileges; |
rsync -rtvzplogDH --numeric-ids --exclude=/etc/fstab --exclude=/etc/network/* --exclude=/proc/* --exclude=/tmp/* --exclude=/sys/* --exclude=/dev/* --exclude=/mnt/* --exclude=/boot/* /* root@$DESTINATION_HOST:/ |
mkdir move/ | |
export UGIDLIMIT=500 | |
awk -v LIMIT=$UGIDLIMIT -F: '($3>=LIMIT) && ($3!=65534)' /etc/passwd > /root/move/passwd.mig | |
awk -v LIMIT=$UGIDLIMIT -F: '($3>=LIMIT) && ($3!=65534)' /etc/group > /root/move/group.mig | |
awk -v LIMIT=$UGIDLIMIT -F: '($3>=LIMIT) && ($3!=65534) {print $1}' /etc/passwd | tee - |egrep -f - /etc/shadow > /root/move/shadow.mig | |
cp /etc/gshadow /root/move/gshadow.mig | |
scp -r /root/move/* [email protected]:/path/to/location | |
mkdir /root/newsusers.bak |
##how to show docker run line command
docker ps -a --no-trunc
Here are some useful things to know for managing an Exim 4 server. This assumes a prior working knowledge of SMTP, MTAs, and a UNIX shell prompt.
Message-IDs and spool files The message-IDs that Exim uses to refer to messages in its queue are mixed-case alpha-numeric, and take the form of: XXXXXX-YYYYYY-ZZ. Most commands related to managing the queue and logging use these message-ids.
There are three -- count 'em, THREE -- files for each message in the spool directory. If you're dealing with these files by hand, instead of using the appropriate exim commands as detailed below, make sure you get them all, and don't leave Exim with remnants of messages in the queue. I used to mess directly with these files when I first started running Exim machines, but thanks to the utilities described below, I haven't needed to do that in many months.
Files in /var/spool/exim/msglog contain logging information for each message and are named the same as the message-id.
Files in /var/spool/exim/input are named after the mes
sed -i 's/domain1\.com/domain2\.com/d' | |
sed -i '/<?php/c\<?php' | |
#Add line (/n) after line what contain pattern | |
grep -rl 'pattern' public_html/ |xargs sed -i "s/1; ?>/1; ?>\n/g" | |
#remove line what contain | |
grep -rl 'pattern' public_html/ |xargs sed -i '/pattern/d' |
/etc/sysconfig/network-scripts/ifcfg-enp2s0 | |
IPV6INIT=no | |
BOOTPROTO=static | |
DEVICE=enp2s0 | |
ONBOOT=yes | |
UUID="ccea7d4f-855b-496e-945b-da7fe543b725" | |
IPADDR=104.193.150.10 | |
NETMASK=255.255.255.248 | |
GATEWAY=104.193.150.9 |