Posts

🐙 GitHub - SSH Key Generation

🐙 GitHub - SSH Key Generation 🐙 GitHub - SSH Key Generation Password authentication was removed from GitHub on August 13, 2021. Instead of that users now need to use PAT(Personal Access Token) instead. SSH (Secure Shell Protocol) . These tokens are used instead of passwords. For a new user using SSH tokens may be overwhelming, GitHub has a detailed blog: Generating a new SSH key and adding it to the ssh-agent . 🔐 How to generate the SSH token? What is SSH? The Secure Shell Protocol (SSH) is a cryptographic network protocol for operating network services securely over an unsecured network. Its most notable applications are remote login and command-line execution. Before generating the token the following packages needs to be installed on the system. sudo apt install ssh sudo apt install openssh-client sudo apt install openssh-server After installing these packages open the terminal and execute the following command. ssh-keygen -t ed2...

⚙️ Introduction to Cron

⚙️ Introduction to Cron ⚙️ Introduction to Cron What is Cron? Cron is a command line program/utility that is used to schedule jobs. Along with this Cron is also a job scheduler/task scheduler. It helps to automate the process of executing tasks repeatedly. The jobs are the tasks which are other programs or shell commands. For example, if a user wants to automate the process of updating his/her laptop with apt update && apt upgrade , they can do it via cron. Cron is very flexible the tasks could be scheduled in terms of minutes, hours, days, weeks, months and years . For example, update the laptop every day on 12:00. Cron is most suitable for scheduling repetitive tasks. Cron’s name originates from Chronos , the Greek word for time. 🤔 How to use it? Cron works via a configuration file called as Crontab (Cron Table). This configuration file specifies the shell commands that needs to be scheduled. Each line of a Crontab file rep...

🐧 Implementation of clear command

🐧 Implementation of clear command 🐧 Implementation of clear command Clear command is one of the most used command. The description of Clear command from the man page , clear clears your terminal's screen and its scrollback buffer, if any. clear retrieves the terminal type from the environment variable TERM, then consults the terminfo terminal capability database entry for that type to determine how to perform these actions. This command can be implemented in two ways! Using newlines escape sequence! This method uses newline escape sequence to clear the screen. This behavior is similar to CTRL + L keybinding. But how many newline characters? The answer depends on the terminal window size. If the total rows are 20 , then 20 + 20 newline characters. The terminal size can be obtained easily using libraries such as ncurses. But here let’s use winsize structure from unistd.h as explained in this stackoverflow page. #include <st...