Linux/Unix:Server configuration file syntax Checking commands

I have planned to write this post some long time ago, now the time has come to do it. Basically configuring servers in Linux/*nix include editing of configuration files. Once editing the files if there is any syntax error these service will not start and they will show some wearied errors or just dont show(…)

Linux/Unix: Run a command or script at bootup

This is a small post on how to run some commands or scripts at the time of booting Need for running commands/scripts at boot time Some times we require to load some kernel modules  or run a command to accomplish a task. If your command/script have to run continuously then use init start/stop scripts instead(…)

Linux: Load kernel modules at boot-up

Linux kernel is a wonderful piece of software which will act a master to all softwares installed in an OS. In this post we will see how to load servents(aka modules) in to kernel. Though Linux architecture taken inspiration from Unix, there are some differences between their kernel architecure. One major difference is Linux kernel is a(…)

Linux/Unix:How to delete particular SSH keys

One of our team member used to delete entire know_hosts file content when he see below error message. This is because either host changed its keys or some how the entry is corrupted. root@linuxnix:/home/locserver# ssh [email protected] @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @       WARNING: POSSIBLE DNS SPOOFING DETECTED!          @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ The ECDSA host(…)

Ubuntu Linux:How to do unattended OS release upgrade?

Here in our office we have 200+ servers which are located in different weird locations like deserts, mountains, cities which are serving as receivers for our data. Our server are bit old which are running 10.04 Ubuntu(Lucid Lynx). As this version of OS is no more supported by Ubuntu we want to move from this(…)

Linux/Unix:List size of sub and hidden directories

Some times we require to see size of a directory or its sub directories or hidden directories so that we can come to know how much size they are occupying on our disk. In this post we will see how to use du to get the sizes Example1: Find out the size of a folder.(…)

How to rotate logs manually in Linux?

In Linux every activity is monitored and logged in to their respective logs in /var/log folder. The depth of log information is dependent on the log configuration we did it in /etc/logrotate.d and we have to rotate them all the time to control how much space they use. When ever we install packages, the package(…)

Basic Nginx troubleshooting in Linux/Unix

This is a small post on how to start troubleshooting Nginx server. If you are facing an issue with nginx or any server/service the first thing to conform is if our configurations are correct or not. Nginx have two commands to show if there is any issue with your configuration or not. Checking your configs(…)

Linux:Copy, change permissions and ownership of a file in a command

Today I came across a requirement to copy couple of files and change permissions to execute those files when writing some ansible playbooks. We can do this by using cp, chmod, chown command as shown below. Ownership is changed from root user to normal user surendra. ls -l output: -rw-r–r– 1 root root 0(…)

How to force logout a user from Linux/Unix servers

Today I come across a requirement where you have to force a user to logout from a terminal. When I contacted the user and he said he did not logged in. But the thing is I can see the login session from w, last commands. I did this checking before asking him. Then how can(…)

Linux/Unix: How to update timezone in a system

How to update time zone in Linux? Some times it is required to update our timezone when we move our machines(VMs) from one location to other. Recently I came across a situation where I want to move my machine time zone from IST to Sydney time zone. In this post we will see on how(…)