Author: Sahil Suri

How to update timezone on an Ubuntu Linux?

  Introduction: In this article, we’ll explain how you can set the time zone on an Ubuntu system running 16.04 version of the operating system. Generally, we set the time zone for the computer during installation but it can be changed after the operating system has been installed. We may use a GUI tool to modify the time zone but in this article, we’ll be using command line utilities to accomplish this task. Check current time zone in Linux Step 1: We’ll use the date command with the %z and %Z options to print only the time zone information. root@linuxnix:~# date '+%z %Z' -0700 PDT %z displays the time in numeric notation and %Z displays time zone in alphabetic notation. Another way to check your time zone is to read the /etc/timezone file as shown here. root@linuxnix:~# cat /etc/timezone America/Los_Angeles So, it appears that our system is set to America/Los_Angeles timezone but since I’m in India, we’ll need to change this. How to change timezone in Linux using tzselect/tzdata Step 2: Historically one would use the tzconfig command to change the time zone but that has been deprecated now. root@linuxnix:~# tzconfig WARNING: the tzconfig command is deprecated, please use: dpkg-reconfigure tzdata root@linuxnix:~# Different Linux distributions have come up with different utilities to modify simplify the task of modifying the time zone. In Ubuntu, we could use dpkg-reconfigure tzdata to update...

Read More

Linux netcat(nc) command examples – part2

  In our previous article, we introduced the netcat utility along with a few examples of its use as a port scanner. In this article, we’ll focus on how we can use netcat to send messages between computers and transfer files. Example 4: Sending messages between systems. For this, we will use netcat as in server mode on one computer and in client mode on the other computer. On our Ubuntu system(hostname: server and IP address is 192.168.87.146), we will tell netcat to listen for incoming traffic on a particular port. Netcat will operate in server mode on this system. In the below sample I’ve turned on netcat to listen for incoming traffic on port 7777 on my ubuntu system. [root@server ~]# nc -l 7777 From our centos system(hostname: client), we will initiate a connection to the centos system on port 7777. Netcat will operate in client mode here. [root@client ~]# nc 192.168.87.146 7777 So, now all you have to do is type something on either computer and it will appear on the other computer just as is. On ubuntu: root@server:~# nc -l -p 7777 hello there how are you On centos: [root@client ~]# nc 192.168.87.146 7777 hello there how are you Press ctrl+c on the Server system to instruct netcat to close the connection. A word of caution: Unfortunately the netcat version that comes available with centos will...

Read More

Linux netcat(nc) command examples – part1

  The Linux netcat(nc) command is often referred to as the Swiss army knife of networking tools, and a skilled system administrator could come up with some interesting uses for this sophisticated and versatile tool. It essentially establishes a connection between two computers and allows data to be written across the TCP and UDP transport layer protocols, and the network layer protocol IP. Netcat could even be thought of like the ‘cat’ command in Linux but for network-based communication between servers. Netcat operates in 2 modes Server mode Client mode Server mode: In the server, mode netcat listens to incoming connections depending on various parameters that may have been passed to the utility.The below syntax indicates how you would typically use netcat in the server mode: nc -l -p port [options] [hostname] [port] Client mode: In the client, mode netcat initiates a TCP/UDP connection to the same or different machine.The below syntax depicts how you would typically use netcat in the client mode: nc [-options] hostname port[s] [ports] We will be covering both methods in depth in our examples. Typical uses of the Linux netcat tool Chat server Port scanner File transfer Information fetching Chat server: We can use netcat to transfer simple text messages between two system forming a rather minimal and straightforward instant messaging interface. Port scanner: Netcat can be used to scan open ports on one or more systems. Its...

Read More

Over 16,000 readers, Get fresh content from “The Linux juggernaut”

Email Subscribe

ABOUT ME..!

My photo
My name is Surendra Kumar Anne. I hail from Vijayawada which is cultural capital of south Indian state of Andhra Pradesh. I am a Linux evangelist who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. At present I work at Bank of America as Sr. Analyst Systems and Administration. You can contact me at surendra (@) linuxnix dot com.