Category Archives: Linux
VPS Benchmarks: Amazon EC2 and Lightsail, Azure, DigitalOcean, Google, Hostworld, Linode, OVH, UpCloud, VPSServer, VPS.net, Vultr
I recently needed to have a look at moving some services to a different VPS provider for redundancy so I decided to benchmark my options to compare them. The plan selected was whichever had 16GB of RAM (though Google is 15GB). The selected datacenter was always London (Azure only says… Continue reading
Install OSSIM/OSSEC agent (CentOS 7)
I couldn’t find proper instructions on doing this anywhere so here are mine: In your OSSIM portal go to Environment -> Assets & Groups -> Add Assets and enter the name/IP of the asset you want to add. On the agent run: yum -y install libevent-devel pcre2-devel openssl-develwget https://github.com/ossec/ossec-hids/archive/3.6.0.tar.gztar xzf… Continue reading
VPS video encoding speed comparison
I was looking at VPS providers for batch video encoding runs. These numbers are in no way a comprehensive test, I was just surprised by some of them so I thought I’d share. My source file is a 04:17 1080p mp4 and I ran it through HandbrakeCLI to create an… Continue reading
CentOS 7 Apache with PHP 7.1 and FCGId
Right, installing PHP 7.1 is simple, just get the Webtatic repo and install it # rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm # yum install -y mod_php71w php71w-cli php71w-common php71w-gd php71w-mbstring php71w-mcrypt php71w-mysqlnd php71w-xml php71w-opcache If you want to use FCGId instead of mod_php install and configure FPM and mod_fcgid (make sure you remove… Continue reading
PHPMailer NTLM (MS Exchange) SMTP authentication
PHPmailer does not work with NTLM authentication and insists on using mhash() which is deprecated – so you need to edit the file in /extras called ntlm_sasl_client.php Find the code that checks if mhash() is installed and replace the 3 mhashes with hash instead: || !function_exists($function = “mhash”) ) {… Continue reading
Postfix ban failed logins script
Fail2ban hasn’t been working for me, I still have people running brute force attacks on my Postfix server, so I though I’d rig up something myself. This consists of a bash script that identifies multiple failures and bans them, run on cron every 10 minutes. It checks for both smtp… Continue reading
Convert HTML table to CSV
Just a quick one – I needed a script to convert a table to a csv, so this is what I came up with. See the annotations for notes: //html table is in variable $report $report = str_replace(array(“\n”, “\r”), “”, $report); //remove existing line breaks $report = str_replace(‘”‘, ‘\”‘, $report);… Continue reading
Linode Xen to KVM upgrade breaks quotas
On a Linode Virtualmin CentOS 6 the upgrade from Xen to KVM breaks quotas with the following error: repquota: Cannot stat() mounted device /dev/root: No such file or directory The issue is that the symbolic link /dev/root is linking to /dev/xvda which has been replaced by /dev/sda so the symlink… Continue reading
Fix nss-softokn rpm/yum issue in CentOS 6
The recent update to nss-softokn breaks rpm/yum updates in CentOS 6. To restore functionality run these commands: For 64-bit: # wget http://mirror.centos.org/centos/6/updates/x86_64/Packages/nss-softokn-freebl-3.14.3-19.el6_6.x86_64.rpm # rpm2cpio nss-softokn-freebl-3.14.3-19.el6_6.x86_64.rpm | cpio -idmv # cd lib64 # cp libfreeblpriv3.* /lib64 # yum update For 32-bit: # wget http://mirror.centos.org/centos/6/updates/i386/Packages/nss-softokn-freebl-3.14.3-19.el6_6.i686.rpm # rpm2cpio nss-softokn-freebl-3.14.3-19.el6_6.i686.rpm | cpio -idmv #… Continue reading