| Post Reply | RetroFed Forum Forum Index » Show & Tell |
| Author | Message | ||
|---|---|---|---|
|
confusedpuppy
lemmy.dbzer0.com
confusedpuppy@lemmy.dbzer0.com Joined: 2023-12-12 |
Last year while I was learning to self-host some services on a Raspberry Pi I came across Alpine Linux. The very minimal environment of Alpine Linux was something that really interested me. Somewhere along the way I started writing scripts. Since Bash wasn't my default shell and I was missing a lot of other programs that would normally be pre-installed under other distributions, I unintentionally started writing POSIX portable scripts. I continued writing with POSIX in mind because I not only found it interesting but it was also giving me a better understanding of how Linux works under the hood. I was always curious about how windows worked when I was using it but it always seemed so much more complex and intimidating. This specific script I wrote was meant to make mounting and unmounting a LUKS encrypted device from the command line easier and a bit safer. Eventually I extended the functionality to automatically decrypt, mount, execute a command, unmount and reencrypt the device in one single command. My reasoning for this is because I use external encrypted USB drives to backup my computer, phone and two RPi devices. I wanted to still enter my passphrase but I didn't want to forget to reencrypt my device after updating the backup. Some of the things I learned while writing this script in particular was working with With With I spent a couple months of my free time working on this script but it's at the point where I am comfortable and very happy with how it turned out. It's a single file, POSIX portable and only requires I'll apologize for the commenting in advance, I find the shouty comments help me understand what's happening with the script better than trying to remember what each command or variable does. It's also might seem silly in some places but it's consistent which is also important to me. |
||
| 1 Original | |||
| Post Reply |
Back to top |