domains=(domain1.com domain2.com domain3.com)
printf ' -d %s' ${domains[*]} | xargs certbot --apache
it runs such command:
certbot --apache -d domain1.com -d domain2.com -d domain3.com
domains=(domain1.com domain2.com domain3.com)
printf ' -d %s' ${domains[*]} | xargs certbot --apache
it runs such command:
certbot --apache -d domain1.com -d domain2.com -d domain3.com
paste from input to remote server ssh server_ip "cat - >> /tmp/some_file.txt" << "EOF" > asasas > asasas > asasas > EOF
check process rabbitmq-server matching "/usr/lib/erlang/erts-6.2/bin/beam"
group rabbitmq
start program = "/etc/init.d/rabbitmq-server start"
stop program = "/etc/init.d/rabbitmq-server stop"
if failed port 5672 type tcp then restart
if 3 restarts within 3 cycles then timeout
Mongodb 3:
use admin
db.createUser(
{
user: "username",
pwd: "password",
roles: [ "root" ]
}
)
MongoDB older:
db.createUser({ user: "mongoadmin" , pwd: "mongoadmin", roles: ["userAdminAnyDatabase", "dbAdminAnyDatabase", "readWriteAnyDatabase"]})<
/code>
RENAME USER 'user'@'localhost' TO 'user'@'%';
cat /some/file | grep -oE '[^ ]+$'
grep -h "" ./*.txt
#include
#include
struct utmp foo;
main()
{
printf("%lu\n", sizeof foo);
return 0;
}
Perl:
$utmp_size = utmp_record_size_goes_here;
$wtmp_file = "wtmp filename goes here";
open WTMP, "+<", $wtmp_file or die "$wtmp_file: ", $!;
seek WTMP, -10 * $utmp_size, 2;
truncate WTMP, tell(WTMP);
close WTMP;
apt install software-properties-common -y
add-apt-repository ppa:ondrej/php
apt install php7.3 php7.3-fpm php7.3-mysql -y
apt install php7.4 php7.4-fpm php7.4-mysql -y
podman run --name=ubuntu1 -it ubuntu:latest /bin/bash
su - postgres
/usr/bin/pg_ctl reload
SELECT pg_reload_conf();
https://www.zabbix.com/download_agents/
c:\zabbix\zabbix_agentd.exe -c c:\zabbix\zabbix_agentd.conf -i
ubuntu fix time
ntpdate 1.lt.pool.ntp.org
server 0.lt.pool.ntp.org
erver 3.europe.pool.ntp.org
server 2.europe.pool.ntp.org
C:\>net user User
sudo dd if=/dev/zero of=loop.img bs=100M count=10
sudo losetup -fP loop.img
sudo losetup -a
sudo mkfs.ext4 loop.img
mkdir loopfs
sudo mount -o loop /dev/loop0 loopfs
sudo touch loopfs/input.txt
sudo umount loopfs
sudo debugfs -R 'stat input.txt' /dev/loop0'
debugfs 1.45.5 (07-Jan-2020)
Inode: 15 Type: regular Mode: 0644 Flags: 0x80000
Generation: 1856443764 Version: 0x00000000:00000001
User: 0 Group: 0 Project: 0 Size: 42313
File ACL: 0
Links: 1 Blockcount: 88
Fragment: Address: 0 Number: 0 Size: 0
ctime: 0x5f2f4acc:78970acc -- Sun Aug 12 04:01:00 2020
atime: 0x5f33c7f3:7fd665f4 -- Sun Aug 12 04:01:00 2020
mtime: 0x5f2f4acc:78970acc -- Sun Aug 12 04:01:00 2020
crtime: 0x5f2f4acc:b79f2b04 -- Sun Aug 12 04:01:00 2020
Size of extra inode fields: 32
Extended attributes:
security.selinux (37) = "unconfined_u:object_r:unlabeled_t:s0\000"
Inode checksum: 0x6371117e
EXTENTS:
(0-10):33280-33290
sudo debugfs -w -R 'set_inode_field input.txt crtime 201808090101' /dev/loop0
sudo debugfs -w -R 'set_inode_field input.txt ctime 201808090101' /dev/loop0
Sometimes also need: echo 2 > /proc/sys/vm/drop_caches
Another way, but is not recommended to change system time:
NOW=$(date) && date -s "2022-08-10 21:10:10" && touch input.txt && date -s "$NOW"