Tuesday, November 28, 2023

To setup default kernel in Linux(Fedora)

To setup default kernel in Linux(Fedora):

$ sudo grubby --info=ALL | grep -E "^kernel|^index"
index=0
kernel="/boot/vmlinuz-6.5.5-200.fc38.x86_64"
index=1
kernel="/boot/vmlinuz-6.2.15-100.fc36.x86_64"
index=2
kernel="/boot/vmlinuz-5.17.12-100.fc34.x86_64"
index=3
kernel="/boot/vmlinuz-0-rescue-eeca1c676989405b94bedc847e363048"
index=4
kernel="/boot/memtest86+x64.bin"


$ sudo grubby --set-default-index=2
The default is /boot/loader/entries/eeca1c676989405b94bedc847e363048-5.17.12-100.fc34.x86_64.conf with index 2 and kernel /boot/vmlinuz-5.17.12-100.fc34.x86_64

$ sudo grubby --default-title
Fedora (5.17.12-100.fc34.x86_64) 34 (Workstation Edition)
 

 

 

Monday, November 6, 2023

Software version and end-of-life info.

Software version information

"End-of-life (EOL) and support information is often hard to track, or very badly presented. endoflife.date documents EOL dates and support lifecycles for various products."


https://endoflife.date/


For eg, kubernetes related info. here :

https://endoflife.date/kubernetes

 

Thursday, September 21, 2023

Getting 2FA codes in desktop (and avoid your mobile)

 

Oftentimes I need to pickup my mobile to get the 2FA codes for different accounts.

There should be a simple solution to get 2FA in your desktop.
It is authenticator.cc  & it is open source :) :)

--

Open your mobile and open google authenticator app.  (You may have different app).
Click on export and select the accounts you want to export.
On clicking next, it shows a QR code. 

Screenshot the QR code and send it to yourself (like email/Whatsapp).
--

Now it is the time to get 2FA authenticator codes in your desktop browser.
Visit authenticator.cc and install the addon (in your browser like chrome, firefox, edge)


Click on the addon installed and then click on scan. It will ask for access to all the websites.
For time being give this permission. Now, scan the QR code obtained from above.

That's it, you'll have all QR codes availble in your desktop.

No need to grab the mobile to get 2FA codes.


Note: Remove the permission given (to access all data) using "manage addon".

--

 

 

Saturday, August 26, 2023

Command to find which rpm installed the config/binary file

 

--

yum whatprovides /usr/bin/virsh

 =>outputs which package provides the binary virsh.

-- 

if you don’t know the path , use : 

yum whatprovides */virsh

 --

Monday, August 21, 2023

git log with file details

 

--

For full path names of changed files:

git log --author=<user_mail_id>   --name-only

--

For full path names and status of changed files:

git log --author=<user_mail_id>   --name-status

-- 

For abbreviated pathnames and a diffstat of changed files:

git log --author=<user_mail_id> --stat

--

source:
https://stackoverflow.com/questions/1230084/how-to-have-git-log-show-filenames-like-svn-log-v



Tuesday, May 2, 2023

Update kernel arguments in grub boot loader


Check current kernel command line arguments: 

#grubby --info=ALL | less



Update the kernel command line arguments here: (GRUB_CMDLINE_LINUX)
# vim /etc/default/grub 


Propagate the changes:

#grub2-mkconfig -o /boot/grub2/grub.cfg 


Now, verify the changes:

#grubby --info=ALL |less

Wednesday, March 29, 2023

Podman pull a specific architecture image


// podman pull a image overriding host architecture

podman pull --override-arch=arm64   quay.io/openshift-release-dev/ocp-release:4.X.Y 

// Here the image needs to be manifest listed


get pods running in specific node



// get all node_names

oc get nodes 

// Let's say the node we are interested in is: my_specific_node_name_here

 

// Get pods running in the specific node 

oc get pod --field-selector=spec.nodeName=<my_specific_node_name_here>  --all-namespaces



// Get pods running in the specific node with specific state

oc get pod --field-selector=spec.nodeName=<my_specific_node_name_here>  --all-namespaces

| grep ContainerCreating



Thursday, March 23, 2023

Steps to delete a worker node in Openshift/Kubernetes

 
// get all the nodes to select your  node
oc get nodes

Here, we selected the node ocp4.myworkernode.here 


// cordon the node - no more scheduling to this node
oc adm cordon ocp4.myworkernode.here 
 

// drain the node - remove all pods/resources from the node
oc adm drain ocp4.myworkernode.here  --force --delete-emptydir-data --ignore-daemonsets
 
 
// Now, final step delete the node
oc delete node ocp4.myworkernode.here 
 
 
PS: Use 'kubectl' instead of oc in case of Kubernetes  

PV PVC deletion steps in OpenShift/Kubernetes

 

PV,PVC deletion steps:

First PVC followed by PV.



kubectl
patch pvc <pvc_name> -p '{"metadata":{"finalizers":null}}' kubectl delete pvc <pvc_name> --grace-period=0 --force kubectl patch pv <pv_name> -p '{"metadata":{"finalizers":null}}' kubectl delete pv <pv_name> --grace-period=0 --force  
 
PVC = Persistent volume claim (used by application). 
 
PV = Persistent Volume.(underlying volume)
 
 

Saturday, March 4, 2023

Google's language settings


Important: Never click on the links directly, always copy and paste. 


Language settings in google (or google maps) needs to be set here:

https://www.google.com/preferences

and here as well for chrome : chrome://settings/languages 

Note:
Somehow the language keeps changing for me google maps.
With updating language in the above two locations, it is fine. 


Friday, February 3, 2023

Updating aws config/credentials


-- 

// Here, aws comes from installing awscli.

# aws configure --profile=<your_profile_name>


This will update the files at ~/.aws/config   and ~/.aws/credentials 

You can inspect the contents of the above files to verify.
--

You can simply run below to set credentials

# export AWS_PROFILE=<your_profile_name>

--

Verify above configuration using 

# aws iam get-user

--