Friday, January 17, 2025

Access Windows drive in Linux(fedora)

Access Windows drive in Linux(fedora):

 

# install package necessary for ntfs

dnf install ntfs-3g

 

# create mount point

mkdir -p /mnt/windows/

 

# get the device name

sudo lsblk 

 

# mount drive

mount -t ntfs-3g /dev/<device>  /mnt/windows 


#  To make it permanent across reboots

tail -1 /proc/mounts >> /etc/fstab 

 

Thursday, January 9, 2025

Restart shell without exiting

 


--

Restart shell without exiting :

exec $SHELL

--
Now comes some explanation thanks to chatGPT:

The command exec "$SHELL" in Linux is used to replace the current shell with a new instance of the shell.

Here's a breakdown of the components:

  1. exec: The exec command in Linux is used to replace the current running process with a new process. When exec is called, the current process is replaced by the new process, and the current shell (or program) is no longer running. This means that after running the command, the original shell or command will not be in the process list anymore.

  2. "$SHELL": This refers to the value stored in the SHELL environment variable. The SHELL variable typically holds the path to the user's default shell, such as /bin/bash, /bin/zsh, or /usr/bin/fish, depending on your system configuration.

    • Example: If your default shell is bash, $SHELL would evaluate to /bin/bash.

So, when you run exec "$SHELL", you're telling the system to replace the current shell process with a new instance of the same shell (as defined by the $SHELL variable).

Use cases:

  • Restarting the shell: Sometimes, you may want to restart the shell to apply changes to environment variables or configuration files (like .bashrc or .zshrc). Running exec "$SHELL" can be a quick way to do this without logging out and back in.

  • Resetting the environment: It can be useful for resetting the shell's environment if you've modified environment variables or paths temporarily and want to start fresh.

Example:

If you are using bash as your default shell, running:

exec "$SHELL"

Would essentially restart the bash shell in the current terminal session, and any changes to the environment or shell configuration would take effect.

Friday, December 27, 2024

AI use cases w.r.t. Industries


AI use cases w.r.t. Industries:

Thanks to Google Cloud.

https://cloud.google.com/transform/101-real-world-generative-ai-use-cases-from-industry-leaders

 

Thursday, December 12, 2024

AY vs FY in finance world

 

#finance basics

This is written on December 31,2024. Use in that context.
Thanks to  chatGPT.

The terms Assessment Year (AY) and Financial Year (FY) are often confused, but they refer to two different periods in the context of income tax in India.

1. Financial Year (FY):

  • Definition: The Financial Year is the period during which a person or organization earns income.

  • Duration: It runs from April 1 to March 31 of the next year.

  • Purpose: It is the year in which the income is earned or received.

    For example:

    • If you earn income between April 1, 2023, and March 31, 2024, the Financial Year is 2023-24.

2. Assessment Year (AY):

  • Definition: The Assessment Year is the period during which the income earned in the Financial Year is assessed by the Income Tax Department.

  • Duration: It starts immediately after the Financial Year ends. So, it runs from April 1 to March 31 of the next year.

  • Purpose: It is the year in which the tax on the income earned during the Financial Year is calculated and paid.

    For example:

    • If the income was earned during the Financial Year 2023-24, the tax will be assessed and paid in the Assessment Year 2024-25.

Key Difference:

  • Financial Year (FY) refers to the year in which the income is earned.
  • Assessment Year (AY) refers to the year in which the income is assessed and taxed.

Example to Clarify:

  • Financial Year (FY): April 1, 2023, to March 31, 2024.
  • Assessment Year (AY): April 1, 2024, to March 31, 2025.

In simple terms, the FY is the year when you earn income, and the AY is the year when you pay taxes on that income. 


Monday, December 9, 2024

Linux Nvidia driver installation - fix second monitor detection

Nvidia display issue.

I was facing difficulty in detecting second monitor in my linux machine. 

I had tried few online solutions but couldn't get it done.

Finally the solution which worked:

 

1.

Detect the specific VGA controller in your machine.

# lspci | grep VGA


2. Now, go to https://www.nvidia.com/en-us/drivers/ and manually search the driver inputting the specific version you obtained in step 1.

3.  For example, in my case it was this file: NVIDIA-Linux-x86_64-550.135.run

4.  Add executable permission
chmod +x NVIDIA-Linux-x86_64-550.135.run

5. Understand what it is:
./NVIDIA-Linux-x86_64-550.135.run --help 

6. 
To build and install the drivers , run the script. 
( This is quite interesting file I come across, it is both a script as well as binary..need to explore more on this later )

./NVIDIA-Linux-x86_64-550.135.run

7. Boot after installation, you should be able to detect the second monitor.