Debian/Ubuntu Tips and Tricks

Debuntu

Debian/Ubuntu Tips and Tricks

Archive for the 'Administration' Category

How Tos on administration. How to make your system run smoothly, tips and tricks on getting over common troubles.

How-To: Prevent SPAM with Apache’s mod security

Posted by chantra on 6th November 2014

WordPress is a great piece of software to run a blog, it is flexible, has tons of plugins are developed for it and updates are really easy to do. To fight spam comments, there is already the Akismet plugin that does a really good job.
While Akismet catches the spam comments and put them in a separate location, making it easy to delete them, as the number of spam grows, WordPress can take long to empty the purge the flush comments and the best option becomes to use a manual SQL query to flush them.
In this article, we will see how we can use RBL to prevent spammer from posting to WordPress's comment page and at the same time, lift a bit of load from the server.
While the rules work for WordPress, with a bit of modifications, it will be easy to get this setup working for any kind of blog/website.

Read the rest of this entry »

Tags: , ,
Posted in Administration, HowTo, HTTP, Networking, System | 1 Comment »

How-To: Fight SPAM with Postfix RBL

Posted by chantra on 26th September 2013

Spam, spam everywhere! If you are hosting your own mail server, fighting spam can become tricky. Antispam solutions do catch a fair amount of them, but still many spam email can still make their way through.

RBL (Real-time Blackhole) is a database of known spammy IPs which is accessible over DNS. Depending on the response received from the DNS server, the IP is classified as spammy or not.

This tutorial will show you how to set up RBL with postfix.

Read the rest of this entry »

Tags: , , ,
Posted in Administration, HowTo, Networking, System | 1 Comment »

How-To: Automatically logout idle bash session

Posted by chantra on 15th July 2013

It can be useful to have a bash session automatically closing after some time. One of the obvious reason you might want this to happen is to make sure that no console is left with root access unwillingly.

Bash comes ready for this and can be configured to automatically terminate after waiting for activity for a given time.

Read the rest of this entry »

Tags: , ,
Posted in Administration, General, HowTo, System | No Comments »

How-To: WiFi roaming with wpa-supplicant

Posted by chantra on 18th June 2013

wpa_supplicant can be used as a roaming daemon so you can get your system to automatically connect to different network as you are going from one location to another.

This come in pretty handy on headless machines where you rely on network connection to be up in order to be able to access the machine.

Read the rest of this entry »

Tags: ,
Posted in Administration, HowTo, Networking | No Comments »

How-To: Make a file Immutable/Write protected

Posted by chantra on 10th June 2013

There might be time when you want to make sure that a file will be protected from accidental/automated change/deletion. While one can protect a file/directory in some ways by removing write permissions using standard file permission on Unix already can save you from some situations, there is more that can be done on Linux.

Read the rest of this entry »

Tags: ,
Posted in Administration, HowTo, System | 2 Comments »

How-To: tail multiple files with multitail

Posted by chantra on 29th April 2013

Many times you will end up tailing multiple files simultaneously. There is a sweet linux utility called multitail that will let you tail multiple files at the same time within the same shell.

And not only will you be able to tail multiple files! You will also be able to run multiple commands and tail their outputs!

Read the rest of this entry »

Tags: , ,
Posted in Administration, HowTo, System | No Comments »

How-To: Reboot on OOM

Posted by chantra on 17th April 2013

Ever had your linux box getting Out of Memory (OOM)? Cleaning up after the OOM killer kicked in to find out that even though OOM killer did a decent job at trying to kill the bad processes, your system ends up in an unknown state and you might be better of rebooting the host to make sure it comes back up in a state that you know is safe.

Read the rest of this entry »

Tags: , , , ,
Posted in Administration, HowTo, System | 1 Comment »

How-To: find which program consumes your bandwidth with nethogs

Posted by chantra on 29th March 2013

Let's continue the network monitoring serie with yet another use case.... the "What program is using my bandwidth?" problem while not imposible to solve, still remains a pain. What if there were some kind of top for network?

NetHogs is a nifty tool that will do that for you and will help you finding what is hogging your connection.

Read the rest of this entry »

Tags: , , ,
Posted in Administration, HowTo, Networking | No Comments »

How-To: monitor network bandwidth usage with vnstat

Posted by chantra on 11th March 2013

There is many tools out there that help in monitoring network usage, collect statistics and generate graphs so we can view what happened at a given date/time. Anyhow, finding the bandwidth usage over an hour/day/week/month can be really tricky.

vnstat is a suite of daemon and client programs that monitor network bandwidth usage.

Read the rest of this entry »

Tags: , , ,
Posted in Administration, HowTo, Networking | No Comments »

How-To: Bash Parameter Expansion and String Manipulation

Posted by chantra on 19th February 2013

Last time we saw how bash can help us in handling default values out of the box using parameter expansion. This time we will see how basic string operations (nonetheless common and useful) can also be achieved using bash.

There is many ways to do string manipulation with bash, like finding a filename extension using expr, separating the directory part from a filename using dirname and basename.... or even more sophisticated ones based on regex, sed....

Why using a sledgehammer to crack a nut when you could use bash builtin functionalities!

Read the rest of this entry »

Tags: , , ,
Posted in Administration, HowTo, Softwares, System | No Comments »