python -m http.server 1111
Serving HTTP on 0.0.0.0 port 1111 (http://0.0.0.0:1111/) …
Monthly Archives: February 2020
cPanel imunify antivirus
yum install imunify-antivirus-cpanel
/opt/alt/php73/usr/bin/php -n -d short_open_tag=on -d extension=json.so -d extension=mbstring.so -d extension=leveldb.so /opt/ai-bolit/ai-bolit-hoster.php --smart --deobfuscate --avdb /var/imunify360/files/sigs/v1/aibolit/ai-bolit-hoster.db --no-html --json_report . --json-stdout --memory 2048M --listing /var/imunify360/tmp/tmpopv7tg06 --progress /var/imunify360/tmp/ai_bolit_progress_15820124375361592.json --with-suspicious --size 1048576 --cloud-assist IMUNIFYAV --cloudscan-size 10485760
deny from all apache 2.4
Require all denied
create tuntap
sudo ip tuntap add dev tap0 mode tap
sudo ip addr add 192.168.200.1/24 dev tap0
sudo ip route | grep tap0
192.168.200.0/24 dev tap0 proto kernel scope link src 192.168.200.1 linkdown
Useful:
sudo ip link set tap0 up
sudo ip route add 192.168.200.0/24 dev tap0 src 192.168.200.1
clean __pycache__
find /some/python/path -type d -name __pycache__ -exec rm -r {} \+
‘utf-8’ codec can’t decode byte 0xf0 in position 0: invalid continuation byte virt-install
Error: --disk path=/var/lib/libvirt/images/centos7.qcow2,size=15,device=disk,bus=virtio,format=qcow2: 'utf-8' codec can't decode byte 0xf0 in position 0: invalid continuation byte
sudo virt-install --connect=qemu:///system --network=bridge:virbr0 --extra-args="ks=http://192.168.0.101:1111/centos7.cfg console=tty0 console=ttyS0,115200" --name=aaa --disk path=/var/lib/libvirt/images/centos7.qcow2,size=15,device=disk,bus=virtio,format=qcow2 --ram 1500 --vcpus=1 --check-cpu --accelerate --hvm --location=http://mirror.cherryservers.com/centos/7/os/x86_64/ --nographics
virsh # pool-list
Name State Autostart
------------------------------------
boot-scratch active yes
images active yes
tmp active yes
virtio-win active yes
vit active yes
virsh # pool-destroy vit
Pool vit destroyed
virsh # pool-destroy virtio-win
Pool virtio-win destroyed
'utf-8' codec can't decode byte 0xf0 in position 0: invalid continuation byte error was because of virStorageVolGetName:
File "/usr/lib64/python3.7/site-packages/libvirt.py", line 3650, in name
ret = libvirtmod.virStorageVolGetName(self._o)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf0 in position 0: invalid continuation byte
[Mon, 17 Feb 2020 15:26:54 virt-install 57908] DEBUG (cli:263) File "/usr/share/virt-manager/virt-install", line 1005, in
virt-install should be working now again
strace log to file
sudo strace -f -o /tmp/strace-virt sudo virt-install
pyenv install failed
sudo dnf install zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel xz xz-devel libffi-devel findutils
fedora 31 upgrade
sudo dnf upgrade --refresh
sudo dnf install dnf-plugin-system-upgrade
sudo dnf system-upgrade download --releasever=31
sudo dnf system-upgrade reboot
Error: any valid prefix is expected rather than
You can not set IP out of IP range:
The reason each number can only reach up to 255 is that each of the numbers is really an eight digit binary number (octet).
sudo ip addr add 192.168.256.100/24 dev tap1 # Bad
sudo ip addr add 192.168.255.100/24 dev tap1 # OK
error: unpacking of archive failed on file /usr/sbin/suexec;5e440e82: cpio: cap_set_file
Running transaction
Installing : httpd-2.4.6-90.el7.centos.x86_64 1/1
Error unpacking rpm package httpd-2.4.6-90.el7.centos.x86_64
error: unpacking of archive failed on file /usr/sbin/suexec;5e440e82: cpio: cap_set_file
Verifying : httpd-2.4.6-90.el7.centos.x86_64 1/1
Failed:
httpd.x86_64 0:2.4.6-90.el7.centos
/var/lib/lxc/new.server.lt/config
lxc.cap.drop =
lxc.cap.drop = mac_admin mac_override setpcap
lxc.cap.drop = sys_module sys_nice sys_pacct
lxc.cap.drop = sys_rawio sys_time
echo “%_netsharedpath /sys:/proc” >> /etc/rpm/macros.dist
Transaction test succeeded
Running transaction
Installing : httpd-2.4.6-90.el7.centos.x86_64
apache backlog monitoring
ss -lti '( sport = :http )' | grep unacked
If its fine, you should not see any unacked values
php enable hsts
<?php header("strict-transport-security: max-age=100");
Without https you will get NET::ERR_CERT_AUTHORITY_INVALID error:
You cannot visit website.com right now because the website uses HSTS. Network errors and attacks are usually temporary, so this page will probably work later.
openvz stop service in group of nodes
for i in `prlctl list | awk '$5 ~ /database_servers*/ {print $5}'`; do prlctl exec $i service firewalld stop; done
sysbench mariadb
sysbench \
--db-driver=mysql \
--mysql-table-engine=innodb \
--oltp-table-size=100000 \
--oltp-tables-count=12 \
--num-threads=4 \
--mysql-host=192.168.200.110 \
--mysql-db=test_database \
--mysql-port=3306 \
--mysql-user=sbtest \
--mysql-password=password \
--test=/usr/share/sysbench/tests/include/oltp_legacy/parallel_prepare.lua \
run