Skip to main content

Posts

Showing posts from June, 2015

Limit the minute cron to minimum 15 minutes

#!/bin/bash ls -1 /var/spool/cron/| grep -v '^root'|while read u; do         cat /var/spool/cron/${u}|\         awk '{print $1":"$2":"$3":"$4":"$5":"$NF}'|\         while read entry;         do                 mn=$(echo ${entry}|awk -F':' '{print $1}');                 if [[ ${mn} == "*" || ${mn} =~ "\*\/[0-14]$" ]];                 then                         echo "Minutely script found -> ${u}";                         echo "Changing to normal" indexsed=1 sed -i 's#^*[^ ][0-1][0-4]#*/15#'$indexsed /var/spool/cron/${u} sed -i 's#^*[^ ][0-9] #*/15 #'$indexsed /var/spool/cron/${u} sed -i 's#^[0-15] #*/15 #' /var/spool/cron/${u} sed -i 's#^[:*:] #*/15 #' /var/spool/cron/${u}               fi;         done; done

Ghost CMS installation

 yum install nodejs npm --enablerepo=epel  curl -L https://ghost.org/zip/ghost-latest.zip -o ghost.zip unzip -uo ghost.zip -d  /home/user/public_html cd /home/user/public_html  npm start --production  http:// :2368 Adding proxy in apache virtual host     ProxyRequests off     ProxyPass / http://127.0.0.1:2368/ To run ghost forever  cd /path/to/ghost/folder sudo npm install -g pm2 echo "export NODE_ENV=production" >> ~/.profile source ~/.profile pm2 kill pm2 start index.js --name ghost ┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬────────────┬──────────┐ │ App name │ id │ mode │ pid   │ status │ restart │ uptime │ memory     │ watching │ ├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼────────────┼──────────┤ │ ghost    │ 0  │ fork │ 15823 │ online │ 1       │ 0s     │ 7.953 MB   │ disabled │

Procmail to execute a script and redirect mail to SPAMCOP

yum install procmail ls /usr/bin/procmail /usr/bin/procmail* cat /home/user/.procmailrc #Whatever recipes you'll use #The order of the recipes is significant :0 | /home/username/mime.sh in filter you can set rules to pipe  ##Rule3 if  $h_X-Spam-Status: begins "Yes" then  pipe "/usr/bin/procmail -Y -a /home/user/.procmailrc" endif  mime.sh #!/bin/sh # ENTER PATH OF THE EMAILS THAT ARE TO BE SUBMITTED TO SPAMCOP FPATH="/home/user/mail/domain/spam-redirect-test/cur/" FPATH2="/home/user/mail/domain/spam-redirect-test/new/" # ENTER YOUR SPAMCOP EMAIL ADDRESS EMAIL="quick.*******@spam.spamcop.net" ################################################################# ################################################################# cd $FPATH for FILENAME in * do         # Create email and submit it to the supplied spamcop address         /usr/local/bin/mime-construct \         --subject "`cat $FILENAME | grep Sub

Changing PHP in FCGI, SUPHP, and CGI

CGI ======== # CGI configuration for PHP5 Action application/x-httpd-php5 /cgi-sys/php5 AddType application/x-httpd-php5 .php5 .php .php3 .php2 .phtml FCGI ======= FCGIWrapper /home/usernam/php-cgi .php Suphp ========= in premain2.conf Allow from All    suPHP_AddHandler application/x-httpd-php5.3        AddType application/x-httpd-php5.3 .php

Secure SSL

openssl  ./config --prefix=/usr/local/newopenssl  curl ssl ./configure --prefix=/opt/curlssl --with-ssl=/usr/local/newopenssl --enable-http --enable-ftp LDFLAGS=-L/usr/local/newopenssl/lib CPPFLAGS=-I/usr/local/newopenssl/include root@server [~]# cat /var/cpanel/easy/apache/rawopts/Apache2_4 --with-ssl=/usr/local/newopenssl/bin LDFLAGS=-L/usr/local/newopenssl/lib CPPFLAGS=-I/usr/local/newopenssl/include root@server [~]# cat /var/cpanel/easy/apache/rawopts/all_php5 --with-openssl=/usr/local/newopenssl --with-curl=/opt/curlssl whm>apache configuration> global  cipher suite  ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DH