Archive / Linux

RSS feed for this section

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

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

install redmine – centos

Intalling redmine on an old linux centos machine was not straightforward for me, after installing ruby from source (repo had an old version and I wanted to have redmine 3.0) I got stuck in little things (missing libraries) so finally … Continue reading

install ruby

# check if ruby is installed gem -v cd /usr/src wget http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.1.tar.gz tar -xvf ruby-2.2.1.tar.gz cd ruby-2.2.1 yum install libffi yum install libffi-devel yum install openssl ./configure –with-openssl-dir=/usr make make install # ruby gems wget http://production.cf.rubygems.org/rubygems/rubygems-2.4.6.tgz ruby setup.rb

update mysql using yum

On one of the servers I needed to do an upgrade for mysql so I found am easy way to do it following the instructions from the mysql website. As a summary this is what you need to do: wget … Continue reading