Categorii
Cum sa

Extragere adrese de email

Le extragem, le sortam, si le afisam doar pe cele unice:

awk -v RS='[[:alnum:]_.]+@[[:alnum:]_]+[.][[:alnum:]]+' 'RT{print RT}' |sort|uniq
Categorii
Cum sa

451 4.4.0 DNS temporary failure

Eroarea apare pe servere de email QMail

# yum install pdns-recursor
# service pdns-recursor start
# chkconfig pdns-recursor on

Apoi in /etc/resolv.conf

nameserver 127.0.0.1

Pachetul pdns-recursor e disponobil in EPEL

Categorii
Cum sa

Upgrade windows 2012 server

Upgrade de la windows 2012 standard trial la windows 2012 standard sau datacenter.
Din powershell aflam editia curenta:
dism.exe /online /Get-CurrentEdition
Editii la care putem face upgrade:
dism.exe /online /Get-TargetEditions
Facem upgrade:
dism.exe /online /Set-Edition:ServerDatacenter /AcceptEula /ProductKey:KEY-KEY-KEY-KEY

Categorii
Cum sa

named.conf corupt servere cPanel

/usr/local/cpanel/scripts/rebuilddnsconfig
/etc/init.d/named restart

Categorii
Cum sa

Install kernel headers

Instalare kernel headers centos

yum install kernel-devel

Pentru kernelul curent, pe care s-a bootat

 yum install kernel-devel-$(uname -r)
Categorii
Cum sa

Setare gateway CentOS

ip route replace default via 192.168.0.1 dev eth0
Verificam cu
ip route show

Categorii
Cum sa

Curatare fisiere php cu prima linie modificata

Un pic de bash + perl

find . -type f -name \*.php -exec grep -rl 'isset($GLOBALS' {} \; |xargs -i -n 1 perl -pi -e "s/^<\?php.+isset\(\$GLOBALS.*$/\<\?php/g" {}

Ce face – cauta in toate fisierele php care contin <\?php + $GLOBALS si inlocuieste cu <\?php

Categorii
Cum sa

Sincronizare ceas din terminal Windows Server

w32tm /config /syncfromflags:manual /manualpeerlist:time.windows.com /update
Categorii
Cum sa

SymLinks ClamAV pe servere cu cPanel

ClamAV instalat de cpanel se afla in /usr/local/cpanel/3rdparty/bin/

ln -s /usr/local/cpanel/3rdparty/bin/freshclam /usr/local/bin/freshclam
ln -s /usr/local/cpanel/3rdparty/bin/clamscan /usr/local/bin/clamscan
ln -s /usr/local/cpanel/3rdparty/bin/clamd /usr/local/bin/clamd
ln -s /usr/local/cpanel/3rdparty/bin/clamav-config /usr/local/bin/clamav-config

Categorii
Cum sa

Instalare clamav pe servere cu cPanel din consola


/scripts/update_local_rpm_versions --edit target_settings.clamav installed
/scripts/check_cpanel_rpms --fix --targets=clamav