I’m back!

Life is not always perfect and I needed to leave this site into forgottenness for quite some time. Next I’ll release the Prestashop modules free of charge – a link to GitHub will follow. For the rest of products & … Continue reading

Select Biggest MySQL tables

SELECT CONCAT(table_schema, ‘.’, table_name), CONCAT(ROUND(table_rows / 1000000, 2), ‘M’) rows, CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), ‘G’) DATA FROM information_schema.TABLES ORDER BY `DATA` DESC LIMIT 100

Change slug for an already registered post type

function wpti_custom_post_type_args( $args, $post_type ) { if ( $post_type === ‘my-registered-custom-post-type’ ) { $args[‘rewrite’] = array( ‘slug’ => ‘my-new-slug’ ); } return $args; } Unfortuantely it doesn’t work with the default post types like post/page

ERROR: can not find RHNS CA file

When rpm -e rhn-client-tools-2.0.2-8.el7.noarch rhnsd-5.0.13-5.el7.x86_64 rhn-check-2.0.2-8.el7.noarch yum-rhn-plugin-2.0.1-6.el7.cloudlinux.noarch rhn-setup-2.0.2-8.el7.noarch rhnlib-2.5.65-2.el7.noarch

Debug PHP spam mails

touch /var/log/mail_php.log chmod 777 /var/log/mail_php.log vi sendmail-wrapper.sh #!/bin/sh logger -p mail.info sendmail-wrapper.sh: \ site=${HTTP_HOST}, \ client=${REMOTE_ADDR}, \ script=${SCRIPT_NAME}, \ pwd=${PWD}, \ uid=${UID}, \ user=$(whoami) /usr/sbin/sendmail -t -i $* chmod +x /usr/local/bin/sendmail-wrapper.sh then vi /usr/local/bin/env.php chmod +x /usr/local/bin/env.php in global /etc/cl.selector/global_php.ini … Continue reading

Apache reverse SSL proxy

In http conf you can use: ServerName mydomain.com SSLEngine On SSLCertificateFile cert.crt SSLCertificateKeyFile key.key SSLCACertificateFile bundle.cabundle ProxyPass / http://where_to_redirect/ flushpackets=on ProxyPassReverse / http://where_to_redirect/

Avoid brute force for wordpress

Not only it poses a security risk by hackers/bots trying to break into your wordpress install but also for a system admin it’s a nightmare because it may increase the server load. A solution would be to install a wordpress … Continue reading

http/2 apache centos7

1. Using epel test repository you can install nghttp2 and libnghttp2-devel libraries. 2. then get and compile openssl using ./config shared -fPIC make make install 3. create symlinks in /usr/lib64/libssl.so.1.0.0 /usr/lib64/libcrypto.so.1.0.0 to /usr/local/ssl/lib/libcrypto.so.1.0.0 /usr/local/ssl/lib/libssl.so.1.0.0 4. because for now cpanel doesn’t … Continue reading

Linux – create a new partition command line

My situation: there was RAID setup between 3 physical hard disks, however one of them was considerable bigger – about a couple of TBytes. I needed the additional space for other purposes so I needed to create a new partition … Continue reading

Import public certificate and private key to Windows

We have our private key file named private.key and server certificate received from your certificate authority named here ServerCertificate.cer Step 1: for windows we need to generate the pfx file so with openSSL: openssl pkcs12 -export -out certificate.pfx -inkey private.key … Continue reading