Programming

TC is like 210 or something. I’m up for promotion which will bump that 10-20% probably if it goes through but it won’t take effect until October.

I’ve definitely got the bandwidth to take on another mid or senior level job and be effective in both. I’m sure it will add some stress but even a 6 month or 1 year stint means significantly paying down mortgage.

Bit embarrassed I can’t figure this out, but I’ve got a genuine fucking technical mystery I can’t solve, maybe someone can point me in the right direction.

for a week I’ve been experiencing what seems to be intermittent packet loss that lasts anywhere from 10-45 seconds every few minutes. sometimes it stops for a day or several hours. I trust you trust me that I’ve verified it’s my network and not all of my machines.

so, I recently upgraded to spectrum’s gigabit download offering. I was still using 2018 equipment, so figured it may have been that and picked up my new shit. was ok for a few days, still intermittent but not as bad as before. notably, connecting to a vpn seemed to improve it, but that could have just been luck. I do not like the implications of what that means if it actually improved the symptoms, because I have nfi but all of what I can come up with are weird and worrisome.

now, tonight, another issue - I have internet connection, but some sites work and others are timing out. It’s my network, because my phone has the same problem. tried different browsers other than chrome too. like, i can ping 8.8.8.8 and google.com and facebook, but unstuckpolitics.com and my personal sandbox project unstuckforums.com don’t, shit like that. twitch.tv either.

this seems like dns? any ideas? i’m so lost

It’s hard to imagine that having two easy jobs is actually going to be less stressful than having one challenging job. It’s going to be more hours, plus having to juggle two jobs’ worth of meetings. Plus the possibility of getting found out somehow and getting fired from both jobs. Seems borderline insane to consider doing this without even trying to find a single, higher paying job.

Juggling meetings could be a challenge.

I like my current company, I just want more money. So finding something paying substantially more has the downside of leaving something I like and would require grinding leetcode more than finding something similar to or smaller than my current gig.

someone sent me this

this made me laugh and is so good:

  1. Serverless isn’t.

seems like someone who either doesn’t work in ops full time, or is a bit junior wrote it, but maybe I’m wrong, these ones I took issue with:

  1. It’s ok to use shell for complex stuff; it often times is easier, faster, and still less of a mess than juggling libraries and dependencies.

gonna have to just go with lol no on this one. Juggling libraries and dependencies usually only happens one time. if that’s your only reason for using shell, you’re probably terrible

  1. Ok, we all at times keep adding $, {, }, and @ in random places trying to make things work, but still.

i definitely don’t do this because it’s a huge source for some very insidious scripting bugs that are almost impossible to find and debug

  1. Blocking TCP port 53 traffic leads to very strange failures. Don’t.

this one befuddled me. I know port 53 is typically DNS stuff, that’s about all I know about it, but I can’t think of a reason why anything I work on would need it open, and other than on domain controllers I never leave this one open.

    1. Somewhere in your infrastructure a service you didn’t know uses DNS for endpoint discovery in a very surprising way.

or your entire infrastructure. see this so often

  1. Do. Not. Monkey. Around. With. /etc/hosts.

lol, fucking what? the only reason this ever matters is if you don’t know what etc hosts actually does, or you make a change in there and then forget you did 3 months later and get confused by it, which is usually resolved by checking if you did something in /etc/hosts you forgot about. I do this so much, I wouldn’t call it a daily thing, but it’s one of the first things I do when testing a new endpoint that I haven’t registered DNS for yet.

  1. Nobody knows how git works; everybody simply rm -fr && git checkout’s periodically.

not so much an issue I take with this wrt it being true or not, it just astonishes me how common this is, git isn’t complicated or hard to learn.

    1. There are very few network restrictions creative and determined use of ssh(1) port forwarding can’t overcome.

definitely not true

  1. strace(1)/ktrace(1) doesn’t lie.

unless of course you alias’d them to something else

  1. Debugging any sufficiently complex open source product is indistinguishable from reverse engineering a black box.|

gotta throw another hard agree here, especially when the model these days seems to be to create an OSS product that will satisfy 95% of production use cases, but make the documentation so fucking awful that you end up buying the enterprise license just for their support package.

  1. Good software development practices do not always translate well to ops and friends.

this probably needs clarification but I strongly disagree and don’t know how they even came up with this.

  1. Prod" is just another name for “staging”.

yikes. not anywhere I wanna work.

  1. Your source of truth lies.

if it did, no way I could maintain continuous employment, I forget what I had for breakfast an hour later

  1. grep(1) > Splunk (there, I said it)

tell me how you’ve never maintained a production log pipeline without telling me you’ve never maintained a production log pipeline

ok I’m thinking about making game #2 and am looking into architecture decisions. Note I’m not much of a back end guy which is why I’m not sure about this stuff and also I want to get better at it.

Game #1 recap: $40/mo digitalocean VPS. Could probably get away with cheaper. All of the things run on it.

  • node/express back end, holds game state and all “ephemeral” info in memory, wiped on reset/crashes (lol).
  • redis server holds sessions thats it
  • mongo holds saved games, bunch of other info (moderation actions), replays, etc.
  • works fine up to about 250 people using it at once

#2 idea:

  • all “cloud” no fucking around with linux and shells
  • run the node/express on 1 server, can spin up more if necessary obviously
  • any in game action would cause a read/write to a central redis hosted somewhere else (should be fast enough with websockets right?)
  • same with mongo, hosted elsewhere
  • I looked at nextjs and similar and I don’t see why I’d bother especially since I don’t need/want serverside rendering of react

Line check this will all work right? I mean the latency to redis specifically won’t be noticeable I would think? Where should I host these 3 “servers”?

1 Like

no digital ocean . please. please

Are you looking for managed / as-a-service instances of Mongo/Redis/etc? Assuming that’s what you mean but just want to be sure.

finally something I can answer because I consider this a weird specialty of mine.

first thing to consider is whether printf is shell agnostic. I don’t think it is, could be, but I don’t know. The reason this is worth thinking about it because scripts tend to live far longer lifetimes than we expect and hop into different environments and cause really horrific bugs due to this exact issue.

I’m struggling to understand exactly what you’re trying to do though. Like you want a list, and you want to run a command on each element of the list?

I’d do that like this:

args="a b c d"
for arg in ${args}
do
  somecommand ${arg}
done

if you want to use a command as output you use backticks or $()

you can do everything in one line, including the snippet I posted, it’s just hideous. if you’re asking for an elegant pythonic solution for what youre dealing with I’m pretty sure the answer is no. whenever I need to manipulate strings I usually retreat to python. sometimes I’ve actually seen python scripts called in bash scripts to do stuff like this. lol. absurdity.

I’d approach everything you’re describing with a for loop like that, sure it’s like 4-6 lines but it’s always gonna be that many and it’s extremely easy to read. one liner clever bash solutions are rarely ever maintainable except to the person who wrote it.

Define array then print each element + 4

list=(1 2 3 4)
echo $list | xargs -n 1 bash -c 'echo expr $0 + 4
Screen Shot 2022-09-02 at 9.45.05 PM

eta: you can just do one line. (and backtics weren’t showing correctly above - so I screenshot it below)

1 Like

what? sorry , that’s completely unreadable

please dont use backtics either, im begging you

I also prefer multiple lines over dense one-liners, maybe to a fault, but the spec is the spec.

spec? spec for what? you dont have to even print stuff to xargs ffs, pipes are a thing, cmon guys, i get that im an asshole but stop trolling me

The job spec. goofy asked for a 1-liner.

ok this is like tapping the tank at this point and probably the only reason i can actually eat so nevermind ig

source: a guy who has written so much bash he has to hide how much bash he has written in interviews because it’s legit embarrassing, if you’re using shell to begin with it’s usually a mistake

if you want a one liner just add semicolons. lol. I can do like 50 commands in one line. as much as my terminal lets me.

Shrug. I don’t know this stuff that well or really what goofy wants to do. My instinct for what this sounds like would be to write a python script that takes some command line arguments.

sorry this is just a trauma response to the bazillion metric tons of code i’ve had to refactor that looks exactly like what you just said because people dont think this stuff matters at all. it does matter, maybe not to someone like goofy, because inevitably you hire a consultant like me to fix it all. scripts live so much longer than you think they will. like every single time. i have some stuff of mine alive i’m actively ashamed of and spend every waking moment trying to figure out how to fix and it’s still usually impossible to make disappear entirely.

I love looping through stuff with lots of extra lines everywhere and spots to console.log or print() stuff out.