Categorii
General

Configurare fisier swap


# initializare
dd if=/dev/zero of=/swapfile count=1024 bs=1M
chown root:root /swapfile
chmod 600 /swapfile
# Make it into a swap file
mkswap /swapfile
# Mount swap file
swapon /swapfile
# configurare fstab pentru a pastra la reboot
cp -av /etc/fstab /etc/fstab.bckp
echo /swapfile swap swap defaults 0 0 >> /etc/fstab # Care!! '>>'

Categorii
General

Verifica domenii pe servere cPanel care nu mai sunt local


for user in $(whmapi1 listaccts | awk '/user:/ {print $2}'); do domain=$(whmapi1 accountsummary user=$user | awk '/domain:/ {print $2}'); assignedip=$(whmapi1 accountsummary user=$user | awk '/ip:/ {print$2}') ; dnsip=$(dig +short $domain); dnsmx=$(dig MX +short $domain @8.8.8.8 | awk '{print $2}' | xargs dig +short); if [[ $dnsip != $assignedip ]]; then echo -n "$user:$domain - A - FAILS"; if [[ "$dnsmx" == "$assignedip" ]]; then echo -e " but MX for $user:$domain does point locally"; else echo ""; fi; fi ; done

Categorii
General

Stergere link-uri simbolice

Pentru a sterge toate link-urile simbolice(symlinks) din directorul curent:

find . -maxdepth 1 -type l -exec rm -f {} \;
Categorii
General

ID container pentru top 10 procese openvz

ps -e h -o pid --sort -pcpu | head -10 | vzpid -

Va afisa id-ul procesului, id-ul containerului openvz si numele procesului.

Categorii
General

umount device is busy

La umount pentru o partitie primim mesajul:

umount: /media/sda2: device is busy

Pentru a verifica ce anume foloseste partitia:

fuser -m /dev/sda2
/dev/sda2:          254308c

Verificam procesul cu pid-ul 254308

ps aux|grep 254308
mysql     254308  1.3  2.9 509928 120704

In cazul de fata e vorba de serviciul mysql.

Categorii
General

Interogare reverse DNS cu dig

Pentru interogare rDNS pe langa comanda host se poate folosi dig
dig +noall +answer -x 8.8.8.8
8.8.8.8.in-addr.arpa. 43199 IN PTR google-public-dns-a.google.com.

Categorii
General

Actualizare plesk din consola

/usr/local/psa/admin/sbin/autoinstaller
Categorii
General

Apache – No space left on device: Cannot create SSLMutex

La pornirea apache apare urmatoarea eroare:

Apache - No space left on device: Cannot create SSLMutex

Solutia:

ipcs -s | grep apache | awk ' { print $2 } ' | xargs ipcrm sem

Si incercam din nou start la apache.

Varianta 2
Adaugam in /etc/sysctl.conf linia

„kernel.sem = 512 32000 100 512”

si rulam

sysctl -p; service httpd start

Categorii
General

Kill la toate procesele unui utilizator

Putem da kill la toate procesele unui utilizator cu

kill -9 `ps -u utilizator -o "pid="`
Categorii
General

Vulnerabilitate SolusVM

Comunicat SolusLabs:

It has been brought to our attention that a security vulnerability has been found in the Client, Reseller and Admin areas of SolusVM. Even though the chances of this vulnerability being used against a SolusVM installation is low, we have released version 1.7.02 as a Critical security release and advise you to upgrade immediately.