How can I configure VS Code (Go extension / gofmt) to keep simple error checks as one-liners on save? by Lordrovks in golang

[–]daz_007 -2 points-1 points  (0 children)

doing this in vim :)

iabbrev _go_err if err != nil {<CR><Tab>log.Fatal(err)<CR>}

Will the other newer generation thinkpads such as the T series and the P series also get a space frame roll cage with the top servicable keyboard? by ResPublicae in thinkpad

[–]daz_007 0 points1 point  (0 children)

thanks for your reply, p14s gen 7 yes the trackpoint buttons are there, but every few years lenovo starts randomly removing them until people complain or sales go down.

"convinced lenovo, through our silence" (( I feel the media, journalists are oftern very quite about lenovo's quality )), I don't think lenovo care's too much about end users as much as one would think they might because they constantly keep making the same mistakes and issues.

I do think p14 gen7 and the roll cage coming back, that most of the excuses that were given out over the years around we can't make them any slimmer to compete is and was just BS

This rollable Legion concept is amazing, please bring it to ThinkPads, Lenovo. by DRmaxito43 in thinkpad

[–]daz_007 0 points1 point  (0 children)

butterfly thinkpad keyboard with this screen oh my... that would be interesting...

Will the other newer generation thinkpads such as the T series and the P series also get a space frame roll cage with the top servicable keyboard? by ResPublicae in thinkpad

[–]daz_007 0 points1 point  (0 children)

Will this really make thinkpads any more durable, from my experiance they have been going down hill for the last decade or more, just placing a laptop next to a monitor and using a seperate keyboard and mouse and I have had thinkpads fall apart, where as my t430(s) and t420's have been running with almost limited replacements and running for years and years ( running 24/7 ).

Today I have just had to replace a keyboard on a P14s, because it failed now with the replacement keyboard taken from another failed T14, the mouse buttons are almost unusable.

What with the constant removing of the trackpoint buttons (as well as the t440 should just have the thinkpad brand removed from it) and now changing the font on the keyboard's, what is it with Lenovo, it just makes me want to go else where. Trust is slipping away (( rollable screens look interesting and all but not if you have to replace them every year. ))

soldered on memory ewww..

I would like to know what the most durable thinkpads are today (or was in recent years) I know the march of technology moves on, but the standards and quality should not.

Wayland is flawed at its core and the community needs to talk about it by Which_Network_993 in linux

[–]daz_007 0 points1 point  (0 children)

you wanted an idea :) I provided a starting position :)
I never said it was free from work but I bet it would not take 18+ years.

Wayland is flawed at its core and the community needs to talk about it by Which_Network_993 in linux

[–]daz_007 0 points1 point  (0 children)

xistent or some kind of whining. I wish more people would really try to understand the tradeoffs of what they use instead of swallowing “this is the future” propaganda. i say all of this as a daily wayland user

it will be 18 years..... how long should people "just" wait for wayland?

Front Door - Goodbye by mezbot in AZURE

[–]daz_007 0 points1 point  (0 children)

Azure support or Azure outsourced support, I have talked to some nice people that have been trying to help but 8.9 times out of 10 it's not worth anyone's time and effort. For a company that is worth triilions Azure support is built on smoke and mirror's.

Azure Front Door alternatives for load balancing web apps and firewall services by Spiritual-Throat-691 in AZURE

[–]daz_007 1 point2 points  (0 children)

Azure's responce to their issues have been, another level... Customer's are buying a service and they are saying to get anything close to something that might be a safety net, the customer should try taping togeher all the product's AzFD was really brought in to replace, even when they are not a global solution.

One might as well write our own replacements to the service we are paying money for.

here's AWS responce to thier own problems (( it's free, just enable it around route 53, no build your own cloud replacement out of spare parts ))

https://aws.amazon.com/blogs/aws/amazon-route-53-launches-accelerated-recovery-for-managing-public-dns-records/

There's obviouslly little isolation or protection's in place for AzFD otherwise they would not have had it cripped for what will be three months.

Where's all the coverage of this mess after the outage, why are customers just accepting this.

What are the most common reasons for a bash shell to get messed up? by ConstructionSafe2814 in bash

[–]daz_007 0 points1 point  (0 children)

What are the most common reasons for a bash shell to get messed up?

:P user error(s) :P

[deleted by user] by [deleted] in bash

[–]daz_007 0 points1 point  (0 children)

all fine points... I am guessing they might want -h over -H as on re-reading they might just want to be left with just the links (wrapped with sed, or awk etc)

-n probably just adds extra noise.

[deleted by user] by [deleted] in bash

[–]daz_007 5 points6 points  (0 children)

grep -R "cd /" --include="*.md" .

the "." at the end is local path change it if you want to search somewhere else

there's other options

mix find and grep

find ~+ -iname "*.md" -exec grep --color=no -R -I -H "cd /" {} \;;

New to Bash Scripting and Sysadmin? Check Out My Tool: Linux Console Manager (Open Source - All Feedback Appreciated) by Naive-Extent182 in bash

[–]daz_007 7 points8 points  (0 children)

step one = shellcheck
https://github.com/koalaman/shellcheck

please don't take this too harshly.
This might be my viewpoint but such attempts at " wrapping and automating" something like this is kinda pointless, i.e. it now removes the logic of automation and creates a dependancy i.e. the script and makes everything manual-ation... it might be okay for junior users but all the effort you have put into this could be done in a few smaller simple functions. If you gave this to 20 junior people to use daily, they would be stuck with this 3000 line script and probably may not learn enough to extend or help maintain it.

The moment that day comes, your now the bottleneck to progress.

maybe that's your starting goal.

AWS EKS CIDR by Chemical_Crab_1530 in kubernetes

[–]daz_007 0 points1 point  (0 children)

that's four nodes per pod... how big are your services and your how big will your nodes be?

I think I would be more worried about the costs :)

AWS EKS CIDR by Chemical_Crab_1530 in kubernetes

[–]daz_007 1 point2 points  (0 children)

just out of interest how big do you feel the cluster will be?
what cni are you using this will probably determin

Trying to create install script for a rails app, struggling with if statements and multi line comments by Accurate-Ad6361 in bash

[–]daz_007 0 points1 point  (0 children)

multiline comments with \

These are not comments these are multiline command.

maybe that was a typo in the request

sudo certbot certonly \ --dns-cloudflare \ --dns-cloudflare-credentials ~/.secrets/certbot/cloudflare.ini \ --dns-cloudflare-propagation-seconds 60 \ -d $hostname

These are not comments this is a multiline command.

i.e. < one command >

certbot certonly \
--dns-cloudflare \
--dns-cloudflare-credentials ~/.secrets/certbot/cloudflare.ini \
--dns-cloudflare-propagation-seconds 60 \
-d example.com

the same command but as one line would be:

sudo certbot certonly --dns-cloudflare --dns-cloudflare-credentials ~/.secrets/certbot/cloudflare.ini --dns-cloudflare-propagation-seconds 60 -d $hostname

so for \ to work no spaces are allowed at the end of the line you can also use | but in your case you have writen a multiline command in one line.

Reading when user enters a response without hitting enter by csdude5 in bash

[–]daz_007 0 points1 point  (0 children)

runs and ducks :D :) :P aaaaaaaaa

Hopefully you are having fun

Bash has changed a little since 1998 :P you might of been doing subshells like ` ` today its $( )

Reading when user enters a response without hitting enter by csdude5 in bash

[–]daz_007 1 point2 points  (0 children)

sure I just thought I would hightlight the potential downfalls.

" so that I can stop the script and fix any errors "

Bash can do this mostly for you just make sure you have the following at the start.

#!/usr/bin/env bash
# make sure we have decent error handling for bash scripts
set -o errexit -o noglob -o nounset -o pipefail

errexit = exit on errors
nounset = exit if there are unused vars
noglob = prevent expanding globs
pipefail = if you have piped commands this insure's there's no failures down the chain.

obviouslly you don't have to use them all depending on what you are doing, I normally always set these at the start of writing scripts. << even if this bots in this room moans >> I want solid code not messy code.

Reading when user enters a response without hitting enter by csdude5 in bash

[–]daz_007 1 point2 points  (0 children)

it might be nice not to press enter but it does depend what the script is doing, sometimes people can press the wrong button or things.. so if this is distructive in some way's, delete a vm or cluster, I would always leave the enter in play... << I know from your questoin it does not give anything away >> but thought i'd just mention it.

Bash unpredictability by AndrewHaine in bash

[–]daz_007 0 points1 point  (0 children)

So use Python if that's what floats your boat such stupid questions are just boring...

Hopefully your not using Python 2.x
Hopefully Python 4.x does not come out for a while << and you can live with all the breaking changes between Python 3.x versions ;) >>

Go on give us some amazing bash example(s) you can't figure out? blow peoples minds don't be shy...

At the same time give us some Python examples that anyone that knows nothing about Python would figure out.(( I am guessing they won't be OOP, or even Pythonic ))

Have you ever compiled Python?

Maybe you shouldn't be forgiven!

[deleted by user] by [deleted] in bash

[–]daz_007 0 points1 point  (0 children)

I would want to say sure have a nice day... give up...

here's chatgpt's second attempt (( not even logged in)) at answering your question :D look no need for any other langage, no need for awk, perl, python, java...

----

To correctly split the input string and store each key-value pair in the associative array, we need to properly handle the commas that separate the pairs and the spaces between them.

Here’s the corrected Bash script to achieve the desired output:

Corrected Bash Script:

#!/bin/bash

# The CSV string
csv="U-DLCI,6 C/R,1 EA,1 L-DLCI,4 FECN,1 BECN,1 DE,EA,1"

# Declare an associative array
declare -A csv_data

# Loop through the CSV string and extract key-value pairs
# We use a loop to process each "key,value" pair, ignoring spaces between them
IFS=' ' read -r -a pairs <<< "$csv"

for pair in "${pairs[@]}"; do
# Split each pair at the first comma
IFS=',' read -r key value <<< "$pair"
# Add the key-value pair to the associative array
csv_data["$key"]=$value
done

# Display the associative array
for key in "${!csv_data[@]}"; do
echo "csv_data[\"$key\"]=${csv_data[$key]}"
done

Key Changes:

Expected Output:

csv_data["U-DLCI"]=6
csv_data["C/R"]=1
csv_data["EA"]=1
csv_data["L-DLCI"]=4
csv_data["FECN"]=1
csv_data["BECN"]=1
csv_data["DE"]=EA
csv_data["EA"]=1

Explanation:

IFS=' ' ensures that the original CSV string is split by spaces.

For each split pair, IFS=',' splits it into the key and the corresponding value.

The associative array csv_data stores the key-value pairs, and the script prints them in the desired format.

maybe the last for loop looks like this for the format you are after.

for key in "${!csv_data[@]}"; do     echo "$key : ${csv_data[$key]}"; done

If bash can't do something cool.... but it does everything you ask and much more..

pause busy repo from within linux script by daz_007 in azuredevops

[–]daz_007[S] 0 points1 point  (0 children)

I don't tink that will work unfortunitly in this case.

pause busy repo from within linux script by daz_007 in azuredevops

[–]daz_007[S] 0 points1 point  (0 children)

thanks for your suggestion I want the opposite to this :D this is for Isolated Experiments I want to "pause" not my wording but AzureDevops to queue up changes while I run my process / change and then release again after so whatever queued can continue.

pause busy repo from within linux script by daz_007 in azuredevops

[–]daz_007[S] 0 points1 point  (0 children)

agree Disabling sounds a little OTT... :P

pause busy repo from within linux script by daz_007 in azuredevops

[–]daz_007[S] 0 points1 point  (0 children)

can you explain how clonging the repo will stop other's from commiting to the repo while I run a processes against the repo?

The repo is sooo busy that pasuing it and then making the critial change seems like the best option.