Better HN
topnewbestaskshowjobs
Log inSign up

usrbinbash

4,687 karma · joined Dec 4, 2021 (4y ago) · 1,693 submissions

Submissions

comment 4y ago · link · parent

Fact of the matter is, when a disk suddenly loses power, all bets are off. You can design intricate and complex systems of buffers all you want, but when the chips are down, at some point bits need to be flipped in the right positions to store the data, and for this you need electricity.

The only way around this, would be if disks incorporated some kind of internal backup power system, which kicks in and flushes its internal buffers in case of a power loss.

However, even that doesn't really solve the problem, it just moves it somewhere else...because the internal backup power is just another system that can fail.

comment 4y ago · link · parent

How do you figure that tech will mean very little?

What cannot continue is economic growth, for the simple reasons that the planets (and its biospheres) resources are finite.

What will continue however, is technological growth, as in technology will grow ever more complex, and solve more difficult tasks. Techn development is not inherently tied to economic growth.

comment 4y ago · link · parent

This.

Every single technical book I own is full of markers, annotations and references between pages in the same book and to other books, as well as notes written down and jammed between the pages.

btw. this is why it really annoys me when publishers print textbooks with insufficient whitespace around the text columns. Where the hell am I supposed to write then? :D

comment 4y ago · link · parent

If something is portable to every *nix system which uses the Filesystem Hierarchie Standard (FHS), it's portable enough for every system I ever encountered or worked with.

This isn't me ranting against systems with new ideas about file system layout, this is just me being pragmatic: When it works on all my work-, private- and production-machines, I see no reason to run an extra binary in front of all my shellscripts.

comment 4y ago · link · parent

IMHO, pair programming is a useful thing, but not for the reasons it's usually sold on.

It is a really good oboarding vehicle. Pair an Experienced Dev and a new hire, and let the former guide the latter through the codebase. It also works great for implementing changes involving very complex parts of the codebase, usually the kind that interact with many different subsystems, which can get really tricky toget a good grasp on.

comment 4y ago · link · parent

The stigma is not against shell scripting, the stigma is against using shell scripting for things and in settings it wasn't intended for.

Don't get me wrong, I have nothing against fun and creative projects. If someone wants to script something complicated in bash for the lulz, the challenge, to learn something, or just to show off bash-skills, I'm all for it.

What I am against, is when I get asked to debug a 2000 LOC system used in production that was thrown together in bash, waste 2 days on it, only to end up doing what should have been done in the first place, and rewrite the damn thing in 200 lines of Python or 400 lines of Go.

It can, and should, be used to automate some things, string some commands together, make certain tasks easier. I use and write bash scripts in my daily work, and make my life easier with it.

But there comes a point, and that is sooner rather than later, when something should no longer be written in bash, but in a language that wasn't designed primarily as a command line interpreter. Can I make large complicated systems in bash? Sure. Can I carve the handle of a hammer so that it can be used as a screwdriver? I'm sure someone more skilled in woodworking than me could do it. But sometimes the question isn't if it can be done, but if it should.

comment 4y ago · link · parent

    Use #!/usr/bin/env bash instead of #!/bin/bash.
    
    The former searches the user's PATH to find the bash binary.
    The latter assumes it is always installed to /bin/ which can cause issues.
And the former assumes that `env` is installed in `/usr/bin`, so I am trading one assumption for another.

comment 4y ago · link · parent

> Too many people believe that aiming for good software quality means you need to fully adopt that new technology, whether it’s microservices, GraphQL, or distributed tracing. You’re not done until you’ve switched fully over to the ideal technology.

This. We are constantly presented with new and shiny things. And then, barely a year later, there is the next ideal technology. And the next, and the next, and the next.

We have seen this with everyhing: Languages, coding standards, paradigms, editors, organisational methodology, interview methodology, frameworks, databases, security, design basics,...the list is endless.

But here is some truth:

C is still written. As is pure JS. Imperative/Prodecural code never went away. Websites on servers we can physically touch are still deployed. People still write working implementations for almost everything under the sun from scratch. Information-Dense, slim, efficient interfaces that get jobs done are still there. As are monolithic architectures. Good 'ol RDBMS still work great. bash is still the dominant shell. grep/cut/awk are still great for analysing logs. Water still flows downhill.

"new" and "better" are 2 different words, with different meanings. Something that's new could be better. But he fact that it's new, in itself, doesn't automagically make it better. And even if its better in one scenario, its doesn't have to be better in all scenarios.

comment 4y ago · link · parent

> But say you know the name that's redacted belongs to a small group

True, but sometimes there is no way around this, because redacting part of the text visually, so that it is clear where and how much was redacted, may be a requirement.

If there is no such requirement, one can always just replace the part of text like so:

   This is the original text that I am going to redact now.

   This is [REDACTED] now.

comment 4y ago · link · parent

Rest in Peace!

Her demonstration of the capabilities of the (then novel) pipes and scripts of the Unix Operating System is one of the best parts of this documentary:

https://youtu.be/tc4ROCJYbm0?t=935

comment 4y ago · link · parent

> Delete it.

Redaction and Deletion are not equivalent. There are many instances where a visible redaction is required rather than a deletion.

comment 4y ago · link · parent

1. Delete the text

2. Set Background Text Color to black

3. Put spaces in place of redacted text

4. Save

comment 4y ago · link · parent

Pixelation is one of these hilarious instances of where a needlessly complicated approach is used to do something that can be done much quicker, easier, and, as it turns out, way more secure.

Wanna redact text?

Put a solid bar over it. There, done. No takesies-backsies from that one.

comment 4y ago · link · parent

> List comprehensions are just a syntactic sugar for a for loop with a single line that appends something.

They can be that.

They can also be syntactic sugar obscuring a construct that would be much more readable if it were written as some nested loops and if statements.

Problem with all things that fall under the category of syntactic sugar: The small gain in readbility in some cases is more than offset by the LOSS of readbility when they are overused.

Just as an Example: Do I think Decorators are neat? Sure. When they are used in moderation, they absolutely are. However, when codebases start to have decorators everywhere, use multiple Decorators on functions, with some Decs with Args thrown in for good measure, things start to get tricky. And latest when they are used to do something completely different from their original intent (act as syntactic sugar for wrapper functions), what began as a nice idea, can quickly escalate into a debugging nightmare.

IMO, Language design needs to be much more careful about what is added to a language than what is left out.

comment 4y ago · link · parent

But how does => make it more obvious to someone who's new to python?

comment 4y ago · link · parent

<sarcasm> Yeah, great, let's add more syntax to python. Because a cake always tastes much better, the more ingredients it has. Just ask C++! </sarcasm>

Sorry but did I miss something?

When exactly did "this saves 2 lines in the code!" become reason enough to introduce new syntactic elements?

comment 4y ago · link · parent

> Used judiciously

Which is exactly the problem. Yes, some people will use it judiciously.

Other people will just use it wherever possible. Yet others will mix it with the alternative style willy-nilly. Some won't use it at all. And as you so correctly point out, some people will try to be too clever with it.

The result is the exact opposite of what was originally intended by syntactic sugar: Instead of making code easier to read, it becomes harder.

The only way to , at least partially, prevent that, is for languages to be restrictive in their syntax. Yes, that may be more verbose at times. But I consider that a small price to pay for consistency.

comment 4y ago · link · parent

"Elect government" doesn't necessarily mean "vote for the another party". Candiate c1 may support issue X, while candidate c2 does not, so I vote c1, if X is an important enough issue for me, and if I trust c1 to actually make good on the promise of B.

comment 4y ago · link · parent

If its required by law, then telcos need to comply, that isn't in question. If that is not what the majority wants, they need to elec governments committed to change these laws.

I am merely pointing out that, once the law permits doing so, actually not storing something is quite easy.

comment 4y ago · link · parent

So it is more costly not to store surveillance data than to store it?

    $ vim awesometelephonesystem.conf
    
    [logging]
    logpath=/dev/null
Done. No need to redesign anything about the system itself. Data comes in, data gets thrown away.

comment 4y ago · link · parent

"The right move" would be for them to do away with programmable documents altogether, and replace them with a simple scripting language that reads and generates documents, similar to how static HTML is generated by template languages.

That way, it would be clear for users that they are not "opening a document" but "execute a program".

There simply is no need to conflate documents and programs.

comment 4y ago · link · parent

Probably the best way I have seen so far to explain git.

Whoever made this: Good work!

comment 4y ago · link · parent

But it will definitely make it easier for European companies to have a competitive advantage over their US counterparts.

comment 4y ago · link · parent

> Apple, Google, Facebook cannot leave.

Well, that's their problem.

I think we will see a lot of companies founded in the next decade ready to take over such services in the EU. China already has its local companies, and the rest of the world will not be far behind.

comment 4y ago · link · parent

Sorry, can't hear anything, over the sound of hand-rubbing by Non-US tech companies looking forward to the ENORMEOUS competitive advantage they will be able to offer if this is actually implemented :D

comment 4y ago · link · parent

I got this little gem:

https://www.allyourbasearebelongtous.com/

:D

comment 4y ago · link · parent

I'm not surprised.

"simple" has to imply neither "primitive" nor "bad workmanship". Bauhaus takes this principle, and expresses it in architectural and industrial design.

This is a timeless truth, that can be seen in everything humans create, from art, architecture, writing, up to and including software.

comment 4y ago · link · parent

Yes I do, and I think it would be good for the web if more websites were designed according to a more minimalist approach:

https://idlewords.com/talks/website_obesity.htm

comment 4y ago · link · parent

Shutdown:

    sudo shutdown now
Shutdown if I'm feeling generous:

    sudo shutdown -r now
Boot process:

    *press power button*
    *sip coffee*
    *start working*
1
414243
57