create

How to add additional swap Memory

First, we need to know what is swap memory? Generally, this is a temporary memory storage for an OS to utilize while the OS is trying to get more busy process managing another separate threads from another running applications.Assuming you already have an existing swap partition, which is usual by default installation, and we would [...]

How to remount partition as read only

Here’s a tip on remounting partitions. Usually /boot is mounted as read-write linux filesystem by default installation. If you also feel that your /boot should not be changed, modified or upgraded, you can just remount them as read only partition without booting your linux system.As root: Go to /boot partition # cd /boot Create a [...]

50 quick linux command tips part 3

1. How to know which ports are listening from your IP address? # nmap -sT -O your-ip-address 2. How to grep an exact match? # grep -w textfile.txt 3. How to reverse grep matches? # grep -v textfile.txt # 4. How to know which service name is what port? Assuming port 443 # cat testfile.txt [...]

50 quick linux command tips part 2

As root 1. How to have a stop watch scenario from command line terminal? # time cat Press Ctrl+C 2. How to measure the time of executing any executable command? # time firefox wait 5 seconds and close the application 3. How to CD to a user’s home directory? # cd ~userhome 4. How to [...]

50 quick linux command tips

1. How to you change file ownership and chown files recursively? # chown user:user folder -R 2. How to view queued mail in sendmail or postfix? # mailq 3. How to show which alternative binary program does your machine executes first? # alternatives –display program-name 4. How to create public/private rsa key pair? # ssh-keygen [...]

How to schedule and run script on specified time and date – Crontab

Linux systems are capable of running scheduled jobs. Server administrative task are done on regular basis even while sysads are away or during sleeping hours. This keeps a fully working production server do unattended jobs on periodical basis. cron is a linux utility that schedules and automates jobs. This blog entry covers how to do [...]

How to do ssh log parsing and monitoring

Server SSH log files provides us information from simple system to critical system security message. Here are quick ways of doing it via CLI terminal. These examples could serve also as starting point to parse more search key strings not only from any ssh log files, but also to other daemon service log file such [...]

How to create a timer using linux CLI commands?

Here are few ways to achieve the timer or stopwatch concept from command line terminal. As follow 1. This command shows real time values from your screen that is being updated every microsecond. # watch -n 0 date 2. Issuing this command does not provide live screenview of current elapsed time or timer stats. Only [...]

How to block consecutive IP address using scripts

There are times that a server does not need to listen and process any TCP/UDP request for a long list of consecutive local IP addresses. This blog entry provides a starting point of creating server scripts to block a long list of consecutive IP address from the server for permanent blocking. To start, launch your [...]

How to use /dev/null in linux

We all know that /dev/null acts like a black hole in the universe. Anything you throw at it would be totally gone forever. Any attempts to read or write from it result to nothing. This means any data written to this /dev/null is just discarded and gone. This also mean that any data reads from [...]

How to delete spam email and folder regularly – Linux

Fighting spam email is a worldwide daily combat challenge. Email spam fight is just another daily server wide monitoring function of any sysad administering those email servers. Global spam email attacks and happens everyday regardless of country, server setup, domains, geolocation and public IP address you might have. Take a look of the top country [...]

How to Sync date and time via NTP server

Syncronizing your current date and time is as important as making database backups. Without proper accurate stamped date and time, any backup file with any stamped date on it would be meaningless. Without correct time and date, those scripts that depend on date and time schedule would be executed inaccurately and would give you result [...]

How to monitor large mailbox users

Monitoring mailbox users can be done in many serveral ways via web interface or via terminal or via bash scripts. With the usual mbox type emails, incoming new email messages are automatically redirected to each users’ own spool file. This spool mail is by default located and stored in /var/spool/mail. From there, the spool file [...]

How to take Linux backups powered by Tar

This document entry however covers a foundation approach and mostly used tar arguments on backing up data using the linux command tar. ============================================= Data backup samples using Tar Linux command ============================================= A very simple usage of tar # tar cvf backup.tar * Legend: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -c create a new tar file -v verbose mode -f select [...]

How to take Linux backups powered by Rsync

RSync backups data and does it very clean and well. Rsync only transfers those data that have been modified and changed so that the destination host has an exact replica from the source host. Rysnc is a command line backup tool that handles data transfers in an effective and secure manner like any other known [...]