Better HN
topnewbestaskshowjobs
Log inSign up

gregmac

9,763 karma · joined Mar 4, 2015 (11y ago) · 1,712 submissions

Simplicity is underrated.. YAGNI.
Submissions

comment 3y ago · link · parent

Sorry I said unionfs but it's actually handled by mergerfs [1], and it's all automatic. There are a whole boatload of policies [2] to control writes.

I use "existing path, least free space". Once a path is created, it keeps using it for new files in that path. If it runs out of space, it creates that same path on another drive. If the path exists on both drives for some reason, my rationale is this keeps most of the related files (same path) together on the same drive.

I see there's some newer "most shared path" options I don't remember that might even make more sense for me, so maybe that's something I'll change next time I need to touch it.

[1] https://github.com/trapexit/mergerfs

[2] https://github.com/trapexit/mergerfs#policy-descriptions

comment 3y ago · link · parent

I can afford it, but have a hard time justifying the costs, not to mention scrapped (working) hardware and inconvenience (of swapping to a whole new array).

I started using snapraid [1] several years ago, after finding zfs couldn't expand. Often when I went to add space the "sweet spot" disk size (best $/TB) was 2-3x the size of the previous biggest disk I ran. This was very economical compared to replacing the whole array every couple years.

It works by having "data" and "parity" drives. Data drives are totally normal filesystems, and joined with unionfs. In fact you can mount them independently and access whatever files are on it. Parity drives are just a big file that snapraid updates nightly.

The big downside is it's not realtime redundant: you can lose a day's worth of data from a (data) drive failure. For my use case this is acceptable.

A huge upside is rebuilds are fairly painless. Rebuilding a parity drive has zero downtime, just degraded performance. Rebuilding a data drive leaves it offline, but the rest work fine (I think the individual files are actually accessible as they're restored though). In the worst case you can mount each data drive independently on any system and recover its contents.

I've been running the "same" array for a decade, but at this point every disk has been swapped out at least once (for a larger one), and it's been in at least two different host systems.

[1] https://www.snapraid.it/

comment 3y ago · link · parent

I would think a combination of git, unit tests, and comments would solve this problem?

Unit tests prove the code works as intended, and are basically examples of what the code is doing. Whether the code is actually "good" is a bit more subjective -- but tests give you the freedom to modify it without breaking it.

Checking into git frequently is also a way to give yourself some freedom. Commit at every milestone, like every time the next thing is "working". If you feel like refactoring, go for it -- you can reset back to working state in a few seconds.

And lastly, leave comments in. You can always clean it up before you push. You can even squash or interactively rebase your history so no one else sees the gory details how the hot dog was actually made.

comment 3y ago · link · parent

I don't monitor services at that level at all, because it means basically nothing. More acutely: the the lack of a notification doesn't tell mean everything is "ok".

I tend to monitor the actual service. If it's a web server, have something checking that a specific URL is working (tip: use something specific, not /). Likewise any other network service is pretty easy to monitor.

For backups, check the date on the most recent file in the backup target location. If that date is older than "x", something is broken. This can apply to most other types of backend apps too -- everything has some kind of output.

It's when these checks fail that you can investigate deeper and start diagnosing systemd or whatever. It's also possible there's a bigger problem -- like DNS got messed up, or the hardware died -- and checking the final outcome will catch all this.

Basically explicitly checking systemd is a lot of extra work for no real added benefit. If your systemd service is failing often enough that knowing that is the problem immediately (at the alert level) IMHO you'd be better off to spend the time fixing the service definition so it doesn't fail.

comment 3y ago · link · parent

> Some aspects of the business want to tweak things and it should be reasonably guaranteed that the automated side never touches it.

What would a legitimate case for this be?

It seems to me like any changes either must be done via IAC -- and tracked in source control, PR'd, tested in non-prod, etc -- or a missing feature.

If there's a legitimate case for modifying something not in IAC, it should be supported -- this is what I mean by "missing feature". The app and/or IAC should have code for that feature.

Modifying IAC-deployed settings is akin to someone hacking the binary of an executable from a software vendor while still expecting the vendor to support that modified executable. Not gonna happen.

comment 3y ago · link · parent

> I think you're conflating "cloud" to mean any computer on the internet.

If you read "cloud" as "somebody else's computer" it entirely depends on perspective.

If you're running a service on your own hardware in your own datacenter, you're clearly not cloud.

However, if you're a user of that same service, and your data lives on some computers that are running in someone else's data center, then for all intents and purposes your data is "in the cloud". It's indistinguishable if the service you're using is using AWS/Azure/etc, running their own hardware, and/or storing data on something like S3.

There's of course a mix of in between stuff that makes this 10x more complicated: if it's a rented server in somebody else's datacenter, are you "cloud" or not? What if it's your hardware, but somebody else's datacenter? What if you store backups on S3?

comment 3y ago · link · parent

> it hasn't conquered that one place they've been trying to conquer since the start

Who is "they"?

There's are a heck of a lot of people happily building [software for] Linux systems that give precisely zero care to the success of Linux desktop.

comment 3y ago · link · parent

My company had tech leads that are explicitly not managers of the team. There are still managers scattered throughout - some of the tech leads, and some people who are otherwise ICs - but they are always from other teams.

This is an interesting model, because it means when someone disagrees with their tech lead they are explicitly not disagreeing with their manager but with a peer.

The managers also can't assign work (explicitly or implicitly) because they're not even on the same team. This stopped a bunch of non-planned work, such as when a manager said something like "it would be nice if you built x" or asked questions that required a lot of research, as it's too easy for an IC to take that as a directive to actually do it. Now that is more like "good idea, you should ask my tech lead or PM to create and prioritize a ticket so I can do it."

comment 3y ago · link · parent

> The average length of time represented in 250 words of fiction had been getting steadily shorter since the early eighteenth century.

That is a fascinating detail in itself. My first thought is this is reflective of life moving faster in general.

For example, travel by horse vs plane is the difference between days (or weeks) and hours. If you're writing about this travel in modern era, the trip can be summed up in a partial sentence like "After landing in (new city), ..." but you can't really gloss over a days-long trip by horse in the same way.

Basically, "event density" has gone up: more things can happen in a smaller length of time, and number of words is reflective of how many things are happening.

comment 3y ago · link · parent

> UUIDs belong where you can't afford that simplicity. Where you e.g. cannot coordinate the creation of your primary keys. Or where you cannot allow them to be predictable. There you pay the price.

You often don't realize you you have non-simple needs until your application is reasonably mature, and in production. If you already picked integer keys, you now either forever deal with the issues caused by not using UUIDs, or you deal with the unknown-but-non-zero pain of converting to UUIDs.

comment 3y ago · link · parent

I've also moved it, but rarely disassemble. Drawers out, sure, but otherwise just move intact. Can almost always Tetris stuff together so it doesn't really save any space.

Adding wood glue to any places with dowels or even any joints is a pretty cheap, low-effort way to get a 2-3x life multiplier on that type of furniture. As long as you don't want to disassemble again, of course.

comment 3y ago · link · parent

Is this more than a different client interface to git?

"fuse" looks like rebase.

"switch" with automatic stash is handy (is there more to it?). It's a feature that several popular GUI clients have had for years.

comment 3y ago · link · parent

This is one of those UI conventions that would be good, but is actually unusable and ruined because there's too much other bad UIs that don't even think about time zones.

comment 3y ago · link · parent

> Everything else really isn’t worth the $65 bench fee

And it's not like that is a guarantee. You might not find the cause in an hour, or two, or three -- and quickly you approach the cost of a replacement unit.

Sometimes the problem is essentially "critical, proprietary chip/motherboard needs to be replaced" where the only option is to try to find another unit that's broken for different reason and do a transplant.

comment 3y ago · link · parent

What do you mean by just "RNG"? Hardware ("true")?

comment 3y ago · link · parent

> If you're working on a part of the code base you should just have to change classes in one single folder. A new feature should just be a new folder. That change alone speeds up teams by huge factors.

This is a neat idea. Have you done this in practice, and how does it work over a long time frame?

One of the big advantages of separate packages is purely for references: The model package has no reference to service or database code, so it's not possible to include SQL or other hidden service calls in it -- at least not without adding a new dependency which makes it blatantly obvious you're doing something wrong.

On the other hand, if your features are self-contained, and you have good unit test coverage of all the logic, then I guess it doesn't really matter as much what the structure is. The fact it's unit tested forces it to be loosely coupled, and testability is one of the main reasons to organize code into layers in the first place.

comment 3y ago · link · parent

Something that stuck out to me was a side-note:

> Note that we do like endings that we didn't expect, as long as they derive naturally from character action.

This, to me, is probably the biggest thing that makes me hate a story:

The character is faced with a situation and reacts in a way contrary to the way we'd expect them to act based on what we've seen so far. It soon becomes obvious they made that decision only to move the plot to a specific ending or scene.

comment 3y ago · link · parent

It kind of is black and white, from technology point of view.

You, the website owner, can control what your server does in response to HTTP requests a client makes. You control what data is sent, and under what conditions you'll send that data (ie: presence of a valid session cookie, correct username/password, cryptographly signed request, etc).

I, the user owning a computer, get to control what my computer does. I run a web browser, and can choose what happens in response to data your site sends me via HTTP.

Most notably, your site can send some javascript, but my computer doesn't have to run it. My computer can also selectively block what it does, including limiting its access to initiate web requests to other sites.

Anything beyond this is artificial, such as laws like DMCA or CFAA.

comment 3y ago · link · parent

> It’s never been so easy to create incredibly polished mockups

The advice in this article applies even to literal mockups you do as part of regular development (ie: even as part of adding new features to an existing, polished product).

The more "real" your mockup looks, the more concrete it looks and, even if unconsciously. With high-fidelity mockups, you'll typically get feedback about font choice, colors, spacing and other trivial bits.

If you do low-fidelity, you'll get feedback like "why does this data have to be a table?" "Can we just not have these input fields, and move them to advanced options?" "Woah, I thought this would be an entirely different workflow, like (example)".

In the first pass, Low-fidelity can be as low quality as a whiteboard, sharpie or mspaint. If it takes more than a couple minutes to draw (not including thinking / discussion time) it's probably too detailed.

comment 3y ago · link · parent

HTTP-01 works really well for when you host a custom domain on a SaaS application. The domain ownership stays with the customer, and all they have to do is CNAME/ANAME to your server. No messing with DNS TXT or NS records, 3rd party DNS provider API keys, etc.

comment 3y ago · link · parent

The asthetics are hard, too. If it can't be completely hidden and has to sit out in the open, it needs to look decent (aka "spouse acceptance factor").

Amazon and Google have both done pretty good here, and I hope there's a good option to replace them in the future. Maybe it's possible to transplant an esp32 into one of those devices? Maybe sometime will start selling something.

comment 3y ago · link · parent

A huge portion of "applications" I use on my computer happen to run in a web browser. And I mean this as a distinct activity from "browsing the web" (which might be something like HN or researching a topic or shopping).

All the browsers have the ability to open both windows and tabs. If I wanted stuff grouped in one taskbar item, I'd open a tab. If I've specifically opened a new window, I am specifically saying I don't want those grouped -- the OS applying its own grouping is obnoxious.

If all the apps I use had native executables, they'd appear as their own taskbar icon. If they were wrapped in an Electron app, I'd have essentially the same user experience but they'd get their own icon.

My point is really that combining windows/processes that happen to be hosted by the same executable is silly -- even as a highly technical user I don't care about that detail. I'm doing a semantically different activity; I specifically opened a new window; I want a dedicated taskbar icon for it.

I'd be curious: if "Always combine" wasn't actually the default, how many users would specifically turn it on? 50%? 5%? A fraction of 1%?

comment 3y ago · link · parent

What I've also experienced is a whole ecosystem has been built up in other departments in the organization (but outside of development) around the crazy CSV file formats, eg: Marketing uses it to trigger campaigns; Accounting uses it to reconcile live accounts; Support uses it to find accounts.

So anything you do to make this better means you now have to deal with this ecosystem. At best, you're solving some pain point these groups have and they're happy about it, but in most cases you're probably forcing unexpected, extra work on them to "fix" something they perceive as not broken. At worst, you don't discover they're even doing this until after you've changed it, and now you just broke a production system you didn't even know existed.

In some cases, the hack another department put in place will also have their own ecoystem built on top -- it's turtles all the way down.

How bad this situation is directly corresponds to how your organization has grown and how siloed different departments are. And keep in mind we're talking about a fictional but easy-to-understand "emails in a CSV file" problem -- most of the real-world problems are significantly more complicated.

comment 3y ago · link · parent

The most successful APIs I've worked with have been done this way.

In one project we were rebuilding an old outdated UI. We started with being very strict about literally only implementing what was needed for frontend, for example not even a GET /widgets/{id} until there was a UI that needed it. We also explicitly built new models for this, separate from our database models, so it wasn't just "return everything in the table": if the UI only displayed half the fields, that's what was returned. A big benefit of this mindset was when we needed a list of things from joining multiple tables, there was no thought of pushing this to the front-end; we just made a viewmodel, did the work server-side and returned it.

Also, pretty early on we implemented Swagger (OpenAPI) and built in docs to our code. This helped establish it as a part of dev and the coding style that any new devs quickly bought into, as opposed to an afterthought everyone sees as a chore.

After we had a a dozen or so APIs done, we started opening it to customers. We'd add new things they'd request (but our UI didn't need), but strictly kept the use-case-first mindset, as well as continuing the UI port (page-by-page, effectively). Even a few years later, the feedback from our developer users was overwhelmingly positive, along the lines of "this is the best API I've ever used".

comment 3y ago · link · parent

I don't have an iOS device to test, but just found a video [1] showing someone connecting a USB keyboard and immediately using it with no prompts. Same on Android.

Even better, here's [2] a direct example of this attack using an O.MG cable [3].

[1] https://youtu.be/COndab_rQkE?t=76

[2] https://www.youtube.com/watch?v=7YpJQT55_Y8

[3] https://shop.hak5.org/products/omg-cable

comment 3y ago · link · parent

> if you aren't coding the solution to the problem, you shouldn't be allowed to define the solution

I think you're on the right track here, but from the wrong direction. You pretty much stated it earlier:

> the only way you can avoid that is by almost annoyingly probing to find the root of problem

I approach this as: if someone brings a solution, mostly ignore it and start asking "why?" until you're back at a root answer like "so my business can make money". I can't even count the number if times someone has proposed a solution where I've done this and not only ended up with something simpler and faster to build, but a better or more complete solution.

This often comes in like "just build a button to export this data to csv", which if you probe is actually "..So I can get it into Excel easier" ... "So I can reformat it to bring to this other system". The result is something like "what if we push the data to their API, that we already have integrated with, once every hour?"

Sometimes it's software, sometimes it's not, mostly it ends up being a mix -- but importantly if you don't ask "why" enough, you'll solve the wrong or at best only an intermediate problem.

comment 3y ago · link · parent

> I quickly realized that despite a lot of techies being very loud about WLB, that's not how it works with exceptional people.

> They are so interested in what they do that WLB is not really a thing.

(I'm assuming WLB = work-life balance)

There's a really important distinction: a job asking someone to work crazy hours is very different from choosing to spend your personal time coding or learning technical things that may or may not be directly related to your $job.

Some people have hobbies as Nd interests that closely mirror what they do for work. Learning about stuff that you're interested in anyway, but also applies to your job, is not a problem of balance.

I've sometimes been so invested in something I'm working on that I'll pick it up late at night after everyone else is in bed. The balance part of this is when I do that, I'm going to take off early another day. That's a big difference from working extra hours or being told to work extra hours.

comment 3y ago · link · parent

Another thing I've been told by a manufacturer: paper quality is apparently the biggest factor in longevity of a printer. To the point they custom order "the worst paper" for testing purposes (which apparently a speciality paper mill agreed to do, but absolutely refused to put their name on).

I don't know the specifics of this, beyond if you buy the cheapest paper you can probably expect your printer to jam up sooner.

comment 3y ago · link · parent

Pretty neat, and it definitely can generate some complex regex.. But I have to say I don't trust it!

When I add a regex to something, I pretty much always also add a bunch of unit test cases for it, and I request the same if I see one in a PR. It's much easier to just see a bunch of test cases that help validate than it, and frankly, half the time when I write my own cases I think of situations that could be better handled.

Human- or GPT-generated doesn't really matter IMHO; it still needs tests.

Interestingly, chatGPT is pretty good at generating test cases for regex. It would be really cool to see that functionality integrated to this tool.

comment 3y ago · link · parent

Well, your guesses are all incorrect.

The "dual climate" does work decently well, though we don't actually use it that often. Seat warmers do a better job if you're actually cold (and my wife usually puts hers way higher than mine).

> Blasting heat is usefull when e.g. you don't have windows, blasting cold is usefull when you have raw meat in the back and you don't feel like freezing too.

You can still "blast" heat or cool: by turning the temperature way up or down it goes to "MAX" (I don't recall exactly, but something like below 16 or above 25C) and the fan will also run at full speed.

I'm not sure how manually "blasting cold" to keep raw meat in the back cold also doesn't freeze you in the front, or what that has to do with auto mode, but we typically don't have groceries in the car for more than about 20 minutes and don't worry about it. I know people who have a much longer trip to get groceries and they use a plug-in cooler; that seems like a more sensible option.

> auto mode [...] messes it up and I just want "cool" or "hot" air not to fiddle with bad UIs on dimly lit displays I can't see in the glare from the snow/blue sky to figure out the "right" temp to reconfigure too...

Just not reality, in my experience. Auto mode just works. I've been in other cars where it's bad so I understand where you're coming from. I adjust a couple degrees up or down, usually based on what we're wearing, and that's it -- and no need to use display or touchscreen for this.

On the display: About the only time it's hard to read is if there's direct sunlight coming through a non-tinted window. I usually drive with polarized sunglasses and then it's basically never an issue at all.

1
567
58