Shell Script

How I manage my environment variables with tokens?

Submitted by ravisagar on Thu, 01/05/2023 - 17:23

I use a host specific file to store my tokens in environment variables which I manage using .xinitrc file. It is simple setup and works well.

#archlinux #environmentvariables

Run commands when you undock your Laptop

Submitted by ravisagar on Wed, 10/19/2022 - 17:09

I run a shell script every minute to check whether my laptop is docked or not and then run some commands. It works really nicely.

#shell #dock

Shell script to check domain expiry

Submitted by ravisagar on Tue, 07/12/2022 - 06:32

Do you manage lot of domains and want to ensure that you renew them well before time? Well why not write a simply shell script?

#shell #domainexpiry

Shell script to read file content line by line

Submitted by ravisagar on Wed, 05/25/2022 - 16:39

You can write a very simple short script to read contents from a text file line by line and do wonderful things. I use this quite a lot for bulk updates and save lot of time

#shell #readfile #line

Shell script to get file name and extension

Submitted by ravisagar on Wed, 04/27/2022 - 19:00

When writing shell scripts you may want to fetch the file name and file extension separately without using cut utility. Let us learn how to do that.

#shell #filename #fileextension

Generate timestamps in your shell scripts

Submitted by ravisagar on Sat, 03/19/2022 - 06:53

Let me show you how I save lot of my time when creating new files without specifying the file name, instead I use the timestamp.

#shell #date

Shell script to detect laptop dock status

Submitted by ravisagar on Tue, 12/14/2021 - 17:20

I found a simple way to detect whether my ThinkPad is on the ultrabase dock or not so that I can automatically turn on/off an external monitor or set keyboard layout automatically.

#shell #laptop #dock #ultrabase

Shell script to copy mpd playlist songs

Submitted by ravisagar on Thu, 12/09/2021 - 18:33

I use a very simple one line shell script to copy my songs from an mpd playlist to a usb drive or mobile phone. Take few seconds and it is a great way to sync your songs across devices using your own script.

#shell #mpd #copysongs #readline #whileloop

Subscribe

* indicates required

Please confirm that you would like to from Sparxsys:

You can unsubscribe at any time by clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp's privacy practices.

Want to contact me?