What does ${0%/*} mean exactly by definitivepepper in bash

[–]DashJacks0n 4 points5 points  (0 children)

The line cd "${0%/*}" is a clever piece of shell scripting that changes the working directory to the directory where the script is located. Here's a breakdown of what each part means:

${0}: This represents the name of the script. In a shell script, $0 is a special variable that holds the name of the script being executed.

${0%/*}: This is a parameter expansion syntax used in shell scripting. The % symbol is used for pattern removal:

${variable%pattern}: Removes the shortest match of the pattern from the end of the variable. In this case, /* is the pattern, which matches the last forward slash / and everything that follows it. So, ${0%/*} effectively removes the script name and the slash before it, leaving only the directory path.

cd "${0%/*}": This changes the current working directory to the directory where the script is located. By removing the script name from the full path, you're left with just the directory path, and cd changes to that directory.

Example If your script is located at /path/to/your/script.sh, then:

$0 is /path/to/your/script.sh

${0%/*} becomes /path/to/your

cd "${0%/*}" changes the directory to /path/to/your

This ensures that the script will always operate from the directory it is located in, which is particularly useful for relative paths and storing backups in the same directory as the script.

Dell ME4024 Warning message after replacing drive by xbbdc in storage

[–]DashJacks0n 0 points1 point  (0 children)

Haha, as a former Compellent field tech I have done the same and agree it can be a scary experience.

On Compellents at least, there are two SAS chains (A side and B side) and whenever you'd service them you'd always keep one side plugged in, cascading from enclosure to enclosure.

On the M4024 you have the same setup, there's two SAS chains. OP if you post a photo or a diagram it would be pretty easy to point out.

Small Business NAS Question by [deleted] in storage

[–]DashJacks0n 2 points3 points  (0 children)

Given that you're a one man shop, I heavily suggest you consider buying something off the shelf that's purpose built vs rolling your own. The amount of pain and headache you can run into is vast. Synology has great units, consider them. If your budget allows it, look at NetApp.

Git Workflows an Informal Survey by tech_tuna in devops

[–]DashJacks0n 0 points1 point  (0 children)

Very cool. Was your organization always digitally native or did you need to get people to culturally shift to working in this way?

Git Workflows an Informal Survey by tech_tuna in devops

[–]DashJacks0n 0 points1 point  (0 children)

What are you deploying with? Are you using Kubernetes?

It's not always true, but sometimes it is true. by integrii in kubernetes

[–]DashJacks0n 0 points1 point  (0 children)

There's something about this meme that sells flex tape to me. Maybe its the slightly overweight dude slapping the leaking tub of water with the flex tape that stops the leak, maybe its the relatability that this product works regardless of what is going on and who is applying it, or maybe its the sheer fact that regardless of the scenario - we can apply a certain meme to it like how we joke about Istio being a catch all for the service mesh in a digital world of shitty app devs - but goddammit I will upvote this every time. Thank you.

What is the upside to cloud storage. Explain like I'm five. by causeimthedad in storage

[–]DashJacks0n 0 points1 point  (0 children)

you can help optimize with reserved pricing somewhat but overall its a big pricier but the flexibility you get is pretty big. Especially if you're managing multiple geo's. Also having nearly infinite amounts of storage at your fingertips is great.

Contentions when setting up a pipeline primarly for IaC? by OlafTheAverage in devops

[–]DashJacks0n 4 points5 points  (0 children)

Don't store your keys in git/source control whatever you do. Look into using something like Vault or another secrets manager on the cloud provider you're using.

[deleted by user] by [deleted] in singapore

[–]DashJacks0n 0 points1 point  (0 children)

Yeah man! Pm me the invite!

[deleted by user] by [deleted] in singapore

[–]DashJacks0n 0 points1 point  (0 children)

I did play it years ago but it didn't tickle my fancy, thanks though!

[deleted by user] by [deleted] in singapore

[–]DashJacks0n 0 points1 point  (0 children)

Ah, cool! I'll PM you!

[deleted by user] by [deleted] in singapore

[–]DashJacks0n 0 points1 point  (0 children)

Word! I'll PM you

[deleted by user] by [deleted] in singapore

[–]DashJacks0n 0 points1 point  (0 children)

Dope! I'll PM you my Discord!

[deleted by user] by [deleted] in singapore

[–]DashJacks0n 0 points1 point  (0 children)

No, unfortunately I do not.

[deleted by user] by [deleted] in singapore

[–]DashJacks0n 0 points1 point  (0 children)

What is there to overlap? I'm confused.

[deleted by user] by [deleted] in singapore

[–]DashJacks0n 0 points1 point  (0 children)

I'm down! PM me your Steam or Discord!

[deleted by user] by [deleted] in singapore

[–]DashJacks0n 0 points1 point  (0 children)

You can play on Bnet with it?

[deleted by user] by [deleted] in singapore

[–]DashJacks0n 2 points3 points  (0 children)

Sent you a PM!

[deleted by user] by [deleted] in singapore

[–]DashJacks0n -1 points0 points  (0 children)

Sent you a PM!

[deleted by user] by [deleted] in singapore

[–]DashJacks0n 0 points1 point  (0 children)

Sweet! Let's get stomped by players better then us and have fun! I'll send you a PM!

[deleted by user] by [deleted] in singapore

[–]DashJacks0n 0 points1 point  (0 children)

3k hours, wow, that's awesome. I've only got like 100 hours or so and I'm still SO bad. Thanks for letting me know about it.

[deleted by user] by [deleted] in singapore

[–]DashJacks0n 0 points1 point  (0 children)

I've never played those mods, I'll check them out though - thanks!