Skip to main content

Posts

Showing posts from June, 2020

AWK one liners [part three]

contd. sample files used for this tutorial. 1. Filteration of Row data awk   ‘$3 == $4 {print $1 “     “ $3}’ abc.txt awk -F “,” ‘$3 == $4 {print $1 “     “ $3}’ abc.csv Here before printing the required rows we can filter it out using   Some conditions. 2. Filteration of Row data with logical OR  awk -F "," '$3 == 10000 || $4 == 10000 {print $1 "     " $2}' abc2.csv 3.  Filteration of Row data with logical AND awk -F "," '$3 == 10000 && $4 == 10000 {print $1 "    " $2}' abc2.csv

AWK one liners [part two]

contd.. Here is a sample csv file 1. Print columns from a csv file  awk -F "," '{print $1}' abc.csv awk -F "," '{print $1 "    " $3}' abc.csv Where -F defines the seperator. There is an alternate method to use the field separator Here FS is used to define the filed separator which is “,” in  this case it could be a whitespace , a tab etc. 2. Display Content of the file without displaying header awk 'NR!=1 {print $1 "     " $2}' abc.txt awk 'NR>2 {print $1 "     " $2}' abc.txt Where NR indicates the row number 3. Saving AWK output to a separate file

Ubuntu upgrade from 18.04 lts to 20.04 lts

The latest version of Ubuntu is 20.04.lts and is named as “Focal Fossa”.  To start with the upgrade the first and foremost thing is to backup  the server . The rest procedure is as follows: The current os version can be recorded from /etc/os-release file. Once done with backup we need to update all packages of ubuntu 18.04  to latest by running  the command sudo apt update After successful update just upgrade all the installed packages to latest using  the command sudo apt upgrade Now remove all unused old kernels  as they wont be used any further removing them might help us clear some space on the disk. sudo apt --purge autoremove Install update-manager-core package if not already installed. Now upgrade the system to latest lts. sudo do-release-upgrade If you come across an output like this : Checking for a new Ubuntu release There is no development version of an LTS available. To upgrade to the latest non-LTS development release   set Prompt=normal...

AWK one liners [part one]

AWK was initially developed in 1977 by Alfred Aho , Peter J Wienberger  and Brian Kernighan. And hence the name(AWK) derived from  their respective initials. AWK was designed basically for text processing and used mostly for  extraction  a nd manipulation of data. For more info  :  visit here Lets start with the examples. 1. Print Specific Column from a file sample file created awk '{print $1 "   " $3}' abc.txt awk '{print $1 "   " $3}' abc.txt 2. Print all data from a table awk '{print $0}' abc.txt

Firmware Upgrade Procedure on Oracle M7 server (for version below 9.5.2.g)

The firmware upgrade can be performed via Oracle ILOM CLI or  web interface.While the activity is in process we should ideally    have a serial connection to   both the SP’s. This can be performed   even remotely , the only thing is that you   will lose connectivity for   a while when the SP’s go for a reboot. The procedure to upgrade firmware from CLI is as follows: 1. We check the SP status and the current Firmware version. ->show /SP/redundancy status /SP/redundancy Properties: status = Active ->show /System/firmware /System/Firmware Targets: Other_Firmware Properties: system_fw_version = Sun System Firmware 9.x.x.a 2015/03/11 14:26   2. Now we will stop the system and wait till the power_off property   sets to off. -> stop /System Are you sure you want to stop all of the configured hosts on the system (y/n)? y Stopping /System stop: /HOST0: Stopping /HOST1: Stopping ... -> show /System power_state Properties: power_s...