Aug 22, 2017 | Malicious Code, Nginx, PHP, Ubuntu 14.04 Server
#trigger by wordpress https://wordpress.org/support/topic/link-templatephpsuspected/ cd /path/to/scan egrep -Rl '\$GLOBALS.*\\x|function.*for.*strlen.*isset|isset.*eval' * read more
Aug 17, 2017 | Linux Shell Scripting, Ubuntu 12.04 Server Management
Save current iptables settings using command iptables-save. We save it to /etc/network/iptables.v4.rules iptables-save > /etc/network/iptables.v4.rules Last we configure our box to restore it upon booting up the network interface. Configure your network interface file /etc/network/interfaces nano /etc/network/interfaces #under iface eth0 inet static .... pre-up iptables-restore < /etc/network/iptables.v4.rules tadaaa! short and... read more
Aug 16, 2017 | MySQL, Ubuntu 14.04 Server
Generating SSL Certificates for MySQL Daemon using openssl. cd /etc/mysql # Generate a CA key and certificate with SHA1 digest openssl genrsa 2048 > ca-key.pem openssl req -sha1 -new -x509 -nodes -days 3650 -key ca-key.pem > ca-cert.pem # Create server key and certficate with SHA1 digest, sign it and convert # the RSA key from PKCS #8 (OpenSSL 1.0 and newer) to the old PKCS #1 format openssl req -sha1 -newkey rsa:2048 -days 730 -nodes -keyout server-key.pem > server-req.pem openssl x509 -sha1 -req -in server-req.pem -days 730 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 > server-cert.pem openssl rsa -in server-key.pem -out server-key.pem # Create client key and certificate with SHA digest, sign it and convert # the RSA key from PKCS #8 (OpenSSL 1.0 and newer) to the old PKCS #1 format openssl req -sha1 -newkey rsa:2048 -days 730 -nodes -keyout client-key.pem > client-req.pem openssl x509 -sha1 -req -in client-req.pem -days 730 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 > client-cert.pem openssl rsa -in client-key.pem -out client-key.pem # Ensure mysql user got the right access chown mysql:adm *.pem # Configure MySQL to use the certificates nano my.cnf add lines ssl=1 ssl-ca=/etc/mysql/ca-cert.pem ssl-cert=/etc/mysql/server-cert.pem ssl-key=/etc/mysql/server-key.pem service mysql restart [/code] tadaaa! hope this... read more
Jun 26, 2015 | Linux Shell Scripting
Root access or sudo rights is required to perform this. #crontab manpage crontab [ -u user ] { -l | -r [ -i ] | -e } #Example for editing crontab for user "anotheruser" sudo crontab -u anotheruser -e #Example for listing crontab for user "anotheruser" sudo crontab -u anotheruser... read more
Apr 22, 2015 | SugarCRM, Uncategorized
How do I make a field in SugarCRM edit view read only? SugarCRM version >= 6.5 Add below configuration lines to <sugarcrm root>/custom/Extension/modules/<your module name>/metadata/editviewdefs.php: 'displayParams' => array ( 'field' => array ( 'disabled' => 'disabled', ), ),... read more
Apr 22, 2015 | Nginx, Ubuntu 12.04 Server Management, Uncategorized
Redirect single domain with www to non-www. For example, redirecting of http://www.dennylabs.com to http://dennylabs.com. Why do we need to redirect www to non-www or vice versa? It all because of SEO purposes. Google treats your content as duplicate when they are crawl-able from both www and non-www. Nginx configuration for single domain redirection of www to non-www . server { server_name www.dennylabs.com; return 301 $scheme://dennylabs.com$request_uri; } Nginx configuration for multiple domains redirection of www to non-www. server { server_name "~^www\.(.*)$" ; return 301 $scheme://$1$request_uri;... read more
Apr 2, 2015 | SugarCRM
How to configure relationship between 2 modules mandatory/ compulsory? Real life example, we have 2 custom module “Store” and “Machine Acquisition”. On new “Machine Acquisition” record creation, we need to ensure user select which “Store” the “Machine Acquisition” record belongs to. Solution: Add displayParams to the <sugar root>/custom/modules/<ModuleName>/metadata/editviewdef.php 'displayParams' => array( 'required' => true, ), Reference: SugarCRM... read more
Mar 19, 2015 | Linux Shell Scripting, Ubuntu 12.04 Server Management
List the rules for a specific chain. Example below list the “fail2ban-ssh-ddos” chain. iptables -L fail2ban-ssh-ddos --line-numbers Example output: Chain fail2ban-ssh-ddos (2 references) num target prot opt source destination 1 REJECT all -- 192.0.0.8 anywhere reject-with icmp-port-unreachable 2 RETURN all -- anywhere anywhere Delete rule line number 1: iptables -D fail2ban-ssh-ddos... read more
Feb 1, 2015 | MySQL
Are you encountering database connection errors on your WordPress site? Your database status could be on “stop/waiting” Solution (using putty): First we’ll check the status of mysql sudo su - service mysql status If it shows the mysql status is “stop/waiting” we can proceed to restart it. service mysql restart Once it’s restarted, it should be up and... read more
Dec 26, 2014 | Uncategorized
openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -out yourdomain.csr read more