Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

BlankSystemDaemon posted:

If I'm working on mdoc(7) or AsciiDoc for FreeBSD, I use nano for syntax highlighting and columnation.
It's project policy that all files in src (which includes manual pages) has to fit in 80 characters, and commit message headers have to fit in 70 - to allow for reading source code and commits on the console (so you can rootcause an issue without a GUI).

"must be readable without a gui" doesn't imply "must be readable in an 80x25 console"

are you guys regularly using 80-column screens?

Adbot
ADBOT LOVES YOU

Antigravitas
Dec 8, 2019

Die Rettung fuer die Landwirte:
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

BlankSystemDaemon
Mar 13, 2009




NihilCredo posted:

"must be readable without a gui" doesn't imply "must be readable in an 80x25 console"

are you guys regularly using 80-column screens?
My ttyv0 is at 194x60 on a 2560*1440 monitor.

Point is, if you have to rootcause using a 80x25 console over a serial link, you can.

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

BlankSystemDaemon posted:

My ttyv0 is at 194x60 on a 2560*1440 monitor.

Point is, if you have to rootcause using a 80x25 console over a serial link, you can.

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

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN
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)

FlapYoJacks
Feb 12, 2009

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.

Kazinsal
Dec 13, 2011

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

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

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.

matti
Mar 31, 2019

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

Antigravitas
Dec 8, 2019

Die Rettung fuer die Landwirte:

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.

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN
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

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN
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

FlapYoJacks
Feb 12, 2009

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. :v:

FlapYoJacks
Feb 12, 2009

Beeftweeter posted:

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

All of my scripts pass shellcheck -oall
Also, CI/CD fails if shellcheck throws any warnings or errors. :smug:

BlankSystemDaemon
Mar 13, 2009




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

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
My server runs headless with IPMI providing Serial-over-LAN that I access by SSHing to the BMC, and I do that pretty regularly.

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 :justpost:ing.

spankmeister
Jun 15, 2008






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
Mar 31, 2019

hope you get well blanksystemdeamon

BlankSystemDaemon
Mar 13, 2009




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
Sorry, my bad, I apparently also forgot to mention that I'm in remission and have been for over a year.
There's just a long tail of side effects, but it's better than not being here.

Still, I appreciate you both saying so.

spankmeister
Jun 15, 2008






happy to hear that! no need to apologize at all

spankmeister
Jun 15, 2008






I'm dedicating my second dram of whisky to "gently caress cancer"

matti
Mar 31, 2019

well wishes rescinded then

but no i'm glad to hear that

BlankSystemDaemon
Mar 13, 2009




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"
That's a toast I'll drink to; I was actually thinking about having a finger of Bushmmills.
What're you having?

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN
well i'm not much of a drinker but i'll vape a bowl to that

BobHoward
Feb 13, 2012

The only thing white people deserve is a bullet to their empty skull

FlapYoJacks posted:

All of my scripts pass shellcheck -oall
Also, CI/CD fails if shellcheck throws any warnings or errors. :smug:

you're writing shell scripts serious enough to version control, ci/cd, and lint

deep shame

fresh_cheese
Jul 2, 2014

MY KPI IS HOW MANY VP NUTS I SUCK IN A FISCAL YEAR AND MY LAST THREE OFFICE CHAIRS COMMITTED SUICIDE

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

fresh_cheese
Jul 2, 2014

MY KPI IS HOW MANY VP NUTS I SUCK IN A FISCAL YEAR AND MY LAST THREE OFFICE CHAIRS COMMITTED SUICIDE
raising a couple fingers of Bruichladdaich Port Charlotte 10 to “gently caress cancer forever, amen”

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN

BobHoward posted:

you're writing shell scripts serious enough to version control, ci/cd, and lint

deep shame

yeah lol

the most version control i do is making a backup of a currently working copy

sometimes

mystes
May 31, 2006

Beeftweeter posted:

yeah lol

the most version control i do is making a backup of a currently working copy

sometimes
jesus christ use git already

you can just use it in a local directory

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN

mystes posted:

jesus christ use git already

you can just use it in a local directory

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

fresh_cheese
Jul 2, 2014

MY KPI IS HOW MANY VP NUTS I SUCK IN A FISCAL YEAR AND MY LAST THREE OFFICE CHAIRS COMMITTED SUICIDE
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.

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN
yeah well if i forget how i did something in a plaintext script i usually just open the file and look at it

BobHoward
Feb 13, 2012

The only thing white people deserve is a bullet to their empty skull
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

mycophobia
May 7, 2008
bash scripting is pain. who came up with this syntax

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN
what do you mean, ${0##*/} is a perfectly cromulent substitution

fresh_cheese
Jul 2, 2014

MY KPI IS HOW MANY VP NUTS I SUCK IN A FISCAL YEAR AND MY LAST THREE OFFICE CHAIRS COMMITTED SUICIDE
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!

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN
arrays work fine in bash

fresh_cheese
Jul 2, 2014

MY KPI IS HOW MANY VP NUTS I SUCK IN A FISCAL YEAR AND MY LAST THREE OFFICE CHAIRS COMMITTED SUICIDE
yea but its gross

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN
that reminds me

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

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

Perplx
Jun 26, 2004


Best viewed on Orgasma Plasma
Lipstick Apathy

BobHoward posted:

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

the only exception is if you need a single script to work on every posix os made in the last 40 years

mycophobia
May 7, 2008
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

Adbot
ADBOT LOVES YOU

outhole surfer
Mar 18, 2003

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

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply