|
BlankSystemDaemon posted:If I'm working on mdoc(7) or AsciiDoc for FreeBSD, I use nano for syntax highlighting and columnation. "must be readable without a gui" doesn't imply "must be readable in an 80x25 console" are you guys regularly using 80-column screens?
|
# ? Feb 22, 2024 17:33 |
|
|
# ? Jun 9, 2024 09:49 |
|
yeah, basically instead of for disk in $(find /dev/disk/by-id -not -name '*-part*'); do smartctl -a $disk >$(basename $disk); done I forgot the basename and whoops
|
# ? Feb 22, 2024 17:37 |
NihilCredo posted:"must be readable without a gui" doesn't imply "must be readable in an 80x25 console" Point is, if you have to rootcause using a 80x25 console over a serial link, you can.
|
|
# ? Feb 22, 2024 17:39 |
|
BlankSystemDaemon posted:My ttyv0 is at 194x60 on a 2560*1440 monitor. yes, that was my question. how many times have you had to git bisect (or equivalent) from a serial console within the last five years? I'm curious about the industry you work in if the answer is more than zero e: I've worked in very low-tech industries myself and connected my thinkpad to an usb-serial cable to inspect eg. an industrial scale's raw output. it's the "reading commit messages" part that makes me wonder
|
# ? Feb 22, 2024 17:57 |
|
basically the only time i'm using a serial console is if i seriously hosed something up (most likely, but still probably about once a decade) or trying to debug something very low level (extremely rare, almost never, last time was probably 2008)
|
# ? Feb 22, 2024 18:49 |
|
Antigravitas posted:yeah, basically instead of for disk in $(find /dev/disk/by-id -not -name '*-part*'); do smartctl -a $disk >$(basename $disk); done I forgot the basename and whoops not running your shell scripts through shellcheck is a rookie mistake. shameful.
|
# ? Feb 22, 2024 18:50 |
|
NihilCredo posted:yes, that was my question. how many times have you had to git bisect (or equivalent) from a serial console within the last five years? I'm curious about the industry you work in if the answer is more than zero foss culture has this 1960s brain damage about how 72/80 columns ought to be enough for anybody. that's all there is to it.
|
# ? Feb 22, 2024 18:54 |
|
i like 80 column terminals cos i can fit more of them on the screen at once but for coding i've moved onto 100 cols, languages fancier than C tend to be more verbose
|
# ? Feb 22, 2024 19:02 |
|
FlapYoJacks posted:not running your shell scripts through shellcheck is a rookie mistake. shameful. Shellcheck doesn't guard against logic errors, and I've never seen anyone run shellcheck against shell one-liners.
|
# ? Feb 22, 2024 19:33 |
|
i've never seen anyone run spellcheck against shell scripts, period lol i have a feeling it wouldn't like "case/esac" etc. very much
|
# ? Feb 22, 2024 19:40 |
|
although i do mess up one-liners way more often than formatted scripts, so i usually do that unless it's something really really simple. i still preface rm with echo first usually though i also like using functions in shell scripts to make it easier for me to debug e.g. typos or unterminated statements etc. but apparently this makes me a crazy person according to cjs
|
# ? Feb 22, 2024 19:42 |
|
Antigravitas posted:Shellcheck doesn't guard against logic errors, and I've never seen anyone run shellcheck against shell one-liners. It guards against several logic errors and lol at putting a for loop as a one line. Also, shellcheck would have spit out a SC2044 warning at you.
|
# ? Feb 22, 2024 19:47 |
|
Beeftweeter posted:i've never seen anyone run spellcheck against shell scripts, period lol All of my scripts pass shellcheck -oall Also, CI/CD fails if shellcheck throws any warnings or errors.
|
# ? Feb 22, 2024 19:48 |
NihilCredo posted:yes, that was my question. how many times have you had to git bisect (or equivalent) from a serial console within the last five years? I'm curious about the industry you work in if the answer is more than zero I'm no longer in an industry because of cancer therapies causing chronic extreme exhaustion, and I'm pretty sure any deployment I had control over would be using SoL the same way to deploy via automation tools. For installs: iPXE boot to a ISO+ZMFS FreeBSD image (ie. an ISO with a LZ77-compressed UFS filesystem with / using tmpfs), create partition and zpool, ZFS receive golden image, zfs receive snapshot upgrade, set the flag to the current update. For updates: ZFS receive newly generated ZFS boot environment, set bootonce flag and let the system figure out if it can boot (if not, the system will reboot back into the working environment, but hopefully that won't happen since it'll have been tested first). Cancer therapies also hosed with my memory, for the last five minutes I've been trying to remember the name of the thing that makes the system reboot automatically if there's no activity - but I'm utterly blanking on it, so I'm ing.
|
|
# ? Feb 22, 2024 21:33 |
|
cancer loving sucks. lost my dad to it. I poured myself a scotch before i read your post, but now I will cheers to you full recovery
|
# ? Feb 22, 2024 21:40 |
|
hope you get well blanksystemdeamon
|
# ? Feb 22, 2024 21:42 |
spankmeister posted:cancer loving sucks. lost my dad to it. I poured myself a scotch before i read your post, but now I will cheers to you full recovery matti posted:hope you get well blanksystemdeamon There's just a long tail of side effects, but it's better than not being here. Still, I appreciate you both saying so.
|
|
# ? Feb 22, 2024 21:45 |
|
happy to hear that! no need to apologize at all
|
# ? Feb 22, 2024 21:51 |
|
I'm dedicating my second dram of whisky to "gently caress cancer"
|
# ? Feb 22, 2024 21:52 |
|
well wishes rescinded then but no i'm glad to hear that
|
# ? Feb 22, 2024 22:14 |
Eric Joyner helpfully reminded me that I was thinking of watchdogd, because I couldn't for the life of me remember it. There's also an IPMI watchdog that's got double the length, so the system will be restarted, if it doesn't come up properly. spankmeister posted:I'm dedicating my second dram of whisky to "gently caress cancer" What're you having?
|
|
# ? Feb 22, 2024 23:34 |
|
well i'm not much of a drinker but i'll vape a bowl to that
|
# ? Feb 22, 2024 23:37 |
|
FlapYoJacks posted:All of my scripts pass shellcheck -oall you're writing shell scripts serious enough to version control, ci/cd, and lint deep shame
|
# ? Feb 23, 2024 01:49 |
|
Cybernetic Vermin posted:it is interesting to learn that i am better at computers than people who know ed, seeing how i've never hosed one up bad enough to need it. hey its my job to gently caress it up, okay?!? needing to learn how to use ed on the fly meant i did a good job n stuff
|
# ? Feb 23, 2024 02:12 |
|
raising a couple fingers of Bruichladdaich Port Charlotte 10 to “gently caress cancer forever, amen”
|
# ? Feb 23, 2024 02:20 |
|
BobHoward posted:you're writing shell scripts serious enough to version control, ci/cd, and lint yeah lol the most version control i do is making a backup of a currently working copy sometimes
|
# ? Feb 23, 2024 02:31 |
|
Beeftweeter posted:yeah lol you can just use it in a local directory
|
# ? Feb 23, 2024 02:33 |
|
mystes posted:jesus christ use git already why? knock on wood and all, but it's never been a problem. i sometimes write some pretty complicated scripts, but nothing that i wouldn't be able to recreate pretty easily e: not critical to anything, either Beeftweeter fucked around with this message at 03:10 on Feb 23, 2024 |
# ? Feb 23, 2024 03:03 |
|
yea nah if i forget how i did a thing in 2018 then i never knew how to do it at all, really. nothing of value was lost.
|
# ? Feb 23, 2024 03:28 |
|
yeah well if i forget how i did something in a plaintext script i usually just open the file and look at it
|
# ? Feb 23, 2024 03:30 |
|
basically, any program more complex than a throwaway shouldn't be written in shell script my opinion might be different if shell scripting languages were any good, but,,,, they arent
|
# ? Feb 23, 2024 03:36 |
|
bash scripting is pain. who came up with this syntax
|
# ? Feb 23, 2024 03:40 |
|
what do you mean, ${0##*/} is a perfectly cromulent substitution
|
# ? Feb 23, 2024 03:42 |
|
my shell/real language determinant is whether you need a data structure more complex than either a string or an integer you need an array of strings, or a ring buffer? to python3 with you!
|
# ? Feb 23, 2024 03:49 |
|
arrays work fine in bash
|
# ? Feb 23, 2024 03:50 |
|
yea but its gross
|
# ? Feb 23, 2024 03:54 |
|
that reminds meAntigravitas posted:yeah, basically instead of for disk in $(find /dev/disk/by-id -not -name '*-part*'); do smartctl -a $disk >$(basename $disk); done I forgot the basename and whoops you could have just done for disk in $(ls /dev/disk/by-id); do disk=${disk%-part*}; smartctl -a /dev/disk/by-id/${disk##*/} >$disk; done (i guess?) e: yeah i actually tried it now, i had the variables reversed Beeftweeter fucked around with this message at 04:13 on Feb 23, 2024 |
# ? Feb 23, 2024 04:01 |
|
BobHoward posted:basically, any program more complex than a throwaway shouldn't be written in shell script the only exception is if you need a single script to work on every posix os made in the last 40 years
|
# ? Feb 23, 2024 04:10 |
|
i really need to just use python for all scripting. i resort to shell scripts when i'm like "ehh i dont want to import stuff and write listdir(whatever) or run([something])" but then i end up having to write an if statement and i get to feel what true insanity is for a while
|
# ? Feb 23, 2024 04:11 |
|
|
# ? Jun 9, 2024 09:49 |
|
my shell scripts always start off as one liners, composed over a few executions for cluster in $(cat clusters); do echo $cluster:; for release in $(helm --kube-context $cluster list | grep somestring | awk '{ print $1 }'); do echo " $release:"; helm --kube-context $cluster get values $release | grep -e 'someotherstring\|onemorearbitrarystring'; done; done was one today
|
# ? Feb 23, 2024 04:13 |