If you want a sample kubernetes environment where you want to try out some kubectl commands, go here:
https://killercoda.com/playgrounds/scenario/cka
It has some limitations but good for a playground :)
If you want a sample kubernetes environment where you want to try out some kubectl commands, go here:
https://killercoda.com/playgrounds/scenario/cka
It has some limitations but good for a playground :)
How to remember cronjob:
📝 Mnemonic: "Mini-Hourly-Daily-Monthly-Weekly"
Think of it as:
👉 "Minute - Hour - Day - Month - Week"
🟢 5 stars (* * * * *
) means "every minute"
🟢 */X
means "every X unit" (e.g., */5
= every 5 minutes)
🟢 0 0 * * *
→ At midnight every day
🟢 0 12 * * 1-5
→ At 12 PM, Monday to Friday
🟢 30 14 1 * *
→ At 2:30 PM on the 1st of every month
// 30 14 1 * * =>
minutes 30, hour 14, day 1 only, every month, irrespective of day.
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
--
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:
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.
"$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.
$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).
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.
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.