Category Archives: Linux

Bash scripting – loops, string concatenation and passing arguments

I’ve just created some very basic bash script to automate my task, that is to run behat tests for several test directories. It involves passing argument from command line, doing loops on arrays and concatenating strings. See below for more … Continue reading

Posted in Linux | Tagged , , , | Leave a comment

Slackware nginx update – 1.4.1 – security fix

A news in Ars Technica caught my attention today and it is about a widespread attack on web servers that includes Apache and nginx. My server is nginx therefore, I quickly updated my server to apply 1.4.1 version (my current … Continue reading

Posted in Linux | Tagged , , , | Leave a comment

Setting up nginx + php-fpm on Slackware 14.0

For Slackware 14.0, it is now easy to setup an nginx webserver with PHP support via php-fpm. If you do a full install with Slackware 14.0, you can get PHP 5.4.x and php-fpm as this packages are shipped by stock … Continue reading

Posted in Linux, Slackware | Tagged , , , | Leave a comment

Log real IP address with CloudFlare and nginx

When you have a website behind the CloudFlare DNS (using its CDN services), chances are your nginx access logs are logging CloudFlare IP addresses. This is due to the fact that your are serving content where CloudFlare acts as proxy. … Continue reading

Posted in Linux | Tagged , , , | Leave a comment

Get top IP addresses from access log

Using basic Linux commands, we can get top IP addresses that keeps hitting our web servers, whether they are valid visitors or attackers. The command is a combination of awk, sort and uniq. Given that the first column of the … Continue reading

Posted in Linux | Tagged , , , , , | 2 Comments

Slackware Linux – Strengthen security – block the rest of the world

My Slackware Linux development box is on a VPS. Although Linode is generous to give 8 cores and 2TB outbound monthly limit to traffic, I would rather choose to block the rest of the world to secure my box. One … Continue reading

Posted in Linux, Slackware | Tagged , , , , | Leave a comment

Disable auto-indent temporarily when pasting text into vim

So who loves vim? Not a fan myself but vim is a good fit for quick edit or config edit. Depending on your configuration, vim may be configured for smart indent where it can indent automatically after pressing enter key … Continue reading

Posted in Linux | Tagged , , | Leave a comment

Quick tip – set permissions recursively for files or directory

Somebody whacks your file permissions by issuing sudo chmod 0777 -R * and all your directories and files are colored green (if you know what I mean). That is a bad thing for file permissions especially for files for your … Continue reading

Posted in Linux | Tagged , , | 1 Comment

Slackware Linux – DHCP slows down boot time

Being a wifi only user at home, it bugs me to see DHCP lookup slowing down my laptop’s boot time. I don’t use LAN (by decision) and it doesn’t make sense to have that DHCP stuff on boot time. I … Continue reading

Posted in Linux, Slackware | Tagged , , , , | Leave a comment

Checking your logs for your VPS security

I’ve found some posts on the internet about how to check your logs with regards to login attempts or to simply put, checking logs so that you would know if someone is trying to access your Linux machine. Below is … Continue reading

Posted in Linux | Tagged , | Leave a comment