Question: How to remove all the unnecessary user entries in /etc/shadow file. 1. Create a backup copy of /etc/shadow file. # cp -p /etc/shadow /etc/shadow.backup 2. Ensure the user is not existing anymore in /etc/password file. # cat /etc/passwd | grep [userid] 3. Edit the /etc/shadow file, look for the line and remove the unnecessary […]
Archives for December 2021
Kubernetes Command Line Reference (Cheatsheet)
Creating Objects Create resource: $ kubectl apply -f ./<file_name>.yaml Create from multiple files: $ kubectl apply -f ./<file_name_1>.yaml -f ./<file_name_2>.yaml Create all files in directory: $ kubectl apply -f ./<directory_name> Create from url: $ kubectl apply -f https://<url> Create pod: $ kubectl run <pod_name> –image <image_name> Create pod, then expose it as service: $ kubectl […]
How to write Bubble sort in Bash
Bubble sort is a simple algorithm that basically bubbles up the elements of the array. This means that it traverses the array multiple times and swaps the adjacent elements if they are in the wrong order, as in the following diagram: Bubble sort Bash Script Here is a simple bash script for bubble sort algorithm. […]
Strings and Variables in Python
Strings A string is simply a series of characters. Anything inside quotes is considered a string in Python,and you can use single or double quotes around your strings like this: This is a string.” ‘This is also a string.’ Changing Case in a String with Methods One of the simplest tasks you can do with […]
How to sort ListBox items programmatically in asp.net
The ListBox server control is very similar to the DropDownList, but differs in its display. You can have more than one item at a time shown to the user. The ListBox also enables users to select more than one item at time. For example, if you have a site that delivers news to its users […]
ASP.NET Image Control Example
The Image control supports the following properties (this is not a complete list): AlternateText — Enables you to provide alternate text for the image (required for accessibility). DescriptionUrl — Enables you to provide a link to a page that contains a detailed description of the image (required to make a complex image accessible). GenerateEmptyAlternateText — […]
How to use NumericUpDownExtender in asp.net ajax
NumericUpDownExtender in asp.net ajax The NumericUpDownExtender control allows you to put some up/down indicators next to a TextBox control that enable the end-user to control a selection more easily. A simple example of this is illustrated: <%@ Page Language=”C#” %> <%@ Register Assembly=”AjaxControlToolkit” Namespace=”AjaxControlToolkit” TagPrefix=”cc1″ %> <html xmlns=”http://www.w3.org/1999/xhtml”> <head runat=”server”> <title>NumericUpDownExtender Control</title> </head> <body> <form […]