HNHacker News
TopNewBestAskShowJobs

orisho

527 karma · joined April 24, 2019

orishoshan.com
submissionscomments
orisho··on 20GB leak of Intel data: whole Git repositories, dev tools, backdoor mentions
It was disabled by default, and could only be enabled using environment variables. Even when enabled, the whole thing ran in Docker and the socket was bound to loopback, so you could only connect to it from within the container.

When the intention is a debugging server, making it exposed to the world is a mistake and a security vulnerability. At that point it is effectively a backdoor, but the difference between a high level vulnerability such as this and a backdoor is developer intent.

orisho··on 20GB leak of Intel data: whole Git repositories, dev tools, backdoor mentions
At a previous workplace we had a few places in the code which used the word backdoor. It was not an actual backdoor though, but merely a debugging server that could be enabled and allowed you to inspect internal state during runtime. At some point I removed the word backdoor, fearing it would get to a customer or during an audit someone would misunderstand. :|
orisho··on Stories and lessons from working with Jeff Bezos on the original Kindle
There just isn't any good competition. As with anything else, lack of competition stifles innovation. Why should they spend engineer time on this when it sells just as well?
orisho··on The Passport Payment (2000)
NXDOMAIN is often cached for much longer because it's assumed not to change soon. Sometimes, as in this case, that's a wrong assumption.
orisho··on “Industrial Society and its Future”: the writings of the Unabomber
I'm not though. It had the intended effect on me. I don't believe what he has to say is so revolutionary that I'm missing much by not reading it, and I agree with the sentiment that I'm respecting the Unabomber's goals by reading it - so I just wont. Good ideas are a dime a dozen, the tricky part is execution. Fortunately, murder is usually an ineffective way to affect public policies.
orisho··on “Industrial Society and its Future”: the writings of the Unabomber
While just not reading it likely has no effect, making this public post about it might dissuade others from reading and discourage manifesto publishing.
orisho··on There are more streaming choices than ever – why are prices going up?
Because they now offer more content, at a higher quality, with greater convenience than when they first started. It is also perceived as high value socially, something you should obviously have. This wasn't always the case, and the price had to be lower to reflect that - or some people would not pay it.

I'm sure before Netflix raises prices, they ask themselves the question "what % of our subscriber base will we lose, and how much will it hurt the growth rate?"

Presumably, they also do some research. For Netflix, previous subscribers were slowly grandfathered in to the new prices, while new subscriptions paid the full price immediately. I imagine that allowed them to measure the impact on growth and churn before affecting their entire user base, allowing them to reverse the change if they saw it was a big mistake.

Since they haven't reversed the change, one can only assume that it didn't have a big enough effect to justify keeping the previous pricing. Ergo, people consider it to be worth the money. I know I do.

Finally, presumably they arrived at the previous price point by playing with prices, content and advertising until they arrived at a sufficiently large growth rate, so they were at the right price for that time. But many variables have changed since.

orisho··on Go is boring, and that’s fantastic
You would never initialize an enum like that, since you would use one of the enumerated values instead. That is, after all, the reason behind defining an enum in the first place. When could you end up with an enum that has an invalid value? When you get the value during runtime and typecast from an int. In that case, though, you should obviously have a runtime check that verifies the value is legal.

Your example case is something that I can't think of a reason to do. It isn't a case where you would need to be careful and knowledgeable to avoid it - there's just no reason to do it. You would use On and Off instead of defining a variable with this type.

orisho··on DuckDuckGo browser seemingly sends domains a user visits to DDG servers
Sure it could. A junior programmer aware of the values but not the repercussions could easily overlook this without any malice or disregard for privacy.
orisho··on Ask HN: Has anyone fixed their own bruxism?
Sleep studies are often done at home now using a device you get and then bring back the next day. It has a finger VO2 sensor, snoring sensor, and you attach it to your chest to detect breathing. Contact your physician.
orisho··on Massive spying on users of Google's Chrome shows new security weakness
It's not. What's more common isn't that it's from Israel, but that people bother to mention Israel when that's the home country of the responsible company.
orisho··on Ask HN: How bad should the code be in a startup?
I agree - it isn't a real trade-off. I always hear people saying this and am puzzled by it. Indeed writing "good" code - modular, clean, tested is a matter of having good habits and acting on them. Sure, it technically takes "longer", but it's in the order of magnitude of several hours more over a course of weeks. It isn't something that I would even bring up with management - whether to do it or not is superficial because of the low cost.

What I do understand is that if you hire someone who doesn't have these habits already, or if you yourself don't have them, then it could take much longer than doing what you're used to. But that's on you.

orisho··on Ask HN: What is the cheapest way to make a website?
This is my entire CI yaml, which copies static HTML and other files (I don't use any static site generator, just plain HTML & CSS) and flushes the Cloudflare cache:

  stages:
    - deploy
    - clear-cache
  pages:
    stage: deploy
    script:
      - mkdir .public
      - cp -r * .public
      - mv .public public
    artifacts:
      paths:
        - public
    only:
      - master

  clear-cache:
    stage: clear-cache
    script:
     - curl -X DELETE "https://api.cloudflare.com/client/v4/zones/$CF_ZONE_ID/purge_cache" -H "X-Auth-Key:$CF_AUTH_KEY" -H "X-Auth-Email:$CF_AUTH_EMAIL" -H "Content-Type:application/json" --data '{"purge_everything":true}'
    only:
     - master
orisho··on Ask HN: What is the cheapest way to make a website?
GitHub pages / GitLab pages. I prefer the latter since the CI for pages is less magical and more flexible as a result - you aren't limited to what they support, and they don't claim a 100GB* traffic limit (just fair use). Couple with a cheap .com and free Cloudflare for DNS and caching.

* Corrected mistake, was 10GB

orisho··on Crew Dragon Docks with ISS
They mentioned something about the suit pressure for one of them being lower than expected and asked them to check for "white teeth" on 3 zippers, which they reported seeing on all 3. Can anyone explain what that is?
orisho··on The use of `class` for things that should be simple free functions
The difference I was aiming at is that you (a library author, whether public or internal) shouldn't implement adder, you should implement add. And let your caller implement adder using add, if they require it. If you only expose adder, you limit possible uses for your library.
orisho··on The use of `class` for things that should be simple free functions
If you know better than the calling code, you're probably writing a framework and not a library :) A library should not be limiting, and should be easy to adapt for use with other code. Frameworks are highly opinionated so it's ok for them to only work in specific use cases (in exchange, they offer increased ease of use for those cases).

For example, the Golang Echo HTTP framework supports generating Let's Encrypt certificates using AutoTLS mode. It's not very configurable (and for my use case, that was a limiting factor), but because it was built on top of the autocert library, I was able to use the library directly and make it work with Echo in my use case. If the library was too opinionated, I would've had to fork it to use it in my use case, which was not anticipated by Echo's author.

orisho··on The use of `class` for things that should be simple free functions
Is that true though? You can pass the function itself. If your interface is a function that takes no parameters and returns an int, just wrap this function with another function that takes no arguments and moves the arguments into a closure.

Doing it in a class is forcing these assumptions on your user - that they need this added complexity in all of their uses, and will make for unwieldy code when they don't, or even more unwieldy code when they use a facility that doesn't satisfy the interface you decided on. Let your user be responsible for deciding that and wrapping your code for whatever use they want to do with it - if you write library code (library and not framework), it should be as simple as possible to allow flexibility for the user.

orisho··on Ask HN: Has anybody shipped a web app at scale with 1 DB per account?
Sure, this problem can be solved as can any other -- but there's a cost to it in development time. For every feature, the dev working on it had to do it in 3 steps to ensure backwards compatibility and handle partial migration failures gracefully. Imagine doing this for a small feature - the ops effort dwarfs the actual feature! Many small features would probably be dropped.
orisho··on Organ transplants down as stay-at-home rules reduce fatal traffic collisions
Fatality rates are up, but overall fatality count is down as less people are on the road.
orisho··on Ask HN: What is your learning strategy?
By deliberately selecting your objectives and evaluating possible solutions based on those objectives. If the objectives are unclear when you start (e.g. your objective is achieve a certain level of perfomance but you don't know enough to know what you can adjust, or how you can measure, or what delivers the most gain for least effort), I just get started and revisit it once I have something basic going.

Often, a basic, naive solution will give you the understanding and domain knowledge you need to be able to read what others have said about the same problem.

It also allows you to more easily dive into the solution as implemented by popular open source projects. Even if they don't write about it, you can often learn a lot from the code -- even more if the rationale is written in comments in the code.

For example, let's say you're contemplating how to implement an audit log for your product. You've never done this before, but you're experienced enough to know that you might hit unexpected hurdles (such as features that are difficult to implement) well into development, or maybe after deployment. Something you might do is research commercial open source products which have an audit log, and read their code to understand how they did it and perhaps why. Another way you can figure out the rationale is by looking at their full set of features and asking yourself how might each feature be implemented in an alternative implementation. If alternative implementations don't work well with this feature, this could provide an answer for why they chose this implementation over the other. And then finally, you can ask yourself if you need these features, which brings you answers to the original question of what are your objectives.

Or the short version: there are indirect ways to learn from the experience of others. Looking at a battle-tested implementation of a feature you want to add is one -- and it's perhaps even better (= more enlightening) than reading some blog posts you might find.

orisho··on The logging framework isn't a bottleneck, and other lies your laptop tells you
Yes, that one is definitely very unfortunate :(
orisho··on The logging framework isn't a bottleneck, and other lies your laptop tells you
Render is the term used by many templating languages to denote transforming a template to a result using parameters. So in the case of web apps that use templates, it's the terminology commonly used (you could argue about its correctness, but it is this word). For example, the jinja2 library names the transform function 'render'.
orisho··on Use the Golang Context argument to indicate that a function can block
Hi HN, this is my first blog post (ever). I'm working on improving my writing so I've decided to write every now and then.

Feedback on the style, as well as the content, is very welcome!

orisho··on Ask HN: Name one idea that changed your life
1. That getting good at something can sometimes be quick; if you have the right background. But when it's not quick - that doesn't mean you can't get good. It simply means it's a process. Experiencing the part where I'm bad at something as simply the "beginning of a progress bar" and knowing it's going somewhere, and that practice is necessary allows me to persevere and not experience frustration or a feeling of inadequacy.

I would tell this (along with a real life story to match about myself) to my employees whenever they got discouraged. As a team lead, I would often do the same work they did, so they compared themselves to me, thinking something should be easy for them just because it's easy for me at this point in time. I would tell them it's not a fair comparison to make - I have several years of additional experience doing this compared to you, and I've done this a thousand times, while they're doing this the first time. Of course it appears easier to me - I've had practice, and that's all the difference between them and me, not intelligence or some other trait they have no direct effect on.

2. Evaluating my own and others' ideas through a set of explicit criteria (asking yourself "what does the solution to this problem need to solve in order to be considered adequate?") keeps me from falling in love with my ideas or solutions to problems. For example, my specific implementation for some software might look good to me. If someone else shows up with a different solution (e.g. during code review), then those criteria are the questions I need to ask them to verify that it is indeed a better solution, and that it doesn't overshoot what's needed. If it is better by those criteria, then there's no reason not to toss my idea aside and use theirs.

Of course, this concept also applies to the criteria themselves - someone else might convince me that my criteria are wrong, by noting that some of them are not explained by a greater goal (such as the larger task at hand -- the company's mission, turning a profit, etc.), and so on.

orisho··on Data Shows Shelter-in-Place Is Ending, Whether Governments Want It to or Not
Don't hurry to attribute to malice that which can be attributed to stupidity
orisho··on OFFSystem
This is nonsense IMHO. This is just an encoding scheme to encode data. Just because blocks used by the encoding scheme are cached and reused for other data does not mean that they're not used to represent this data. If the data downloaded is copyrighted work, then copyright applies. Are copyright laws specific as to the technical method in which reproducing copyrighted material without authorization counts as a violation, or is the method irrelevant?

If the method is irrelevant, then yes, using this scheme to copy copyrighted material is copyright infringement.

If it is relevant, then there's nothing special about this scheme at all except that it is different than the specific methods outlined in the law.

orisho··on Public Health Responses to COVID-19 Outbreaks on Cruise Ships
I've been going on 9 days, so I've been quarantining masks for 10 days before reusing them (unfortunately I don't have the luxury of using new masks, I have just 10 total)
orisho··on We have to talk about this Python, Gunicorn, Gevent thing
Yes, but you shouldn't just do that every time as calling into the event loop has its own processing cost. If you do that on each iteration of the loop, it will probably become much slower.

At a previous job, I wrote a wrapper that would compare the last execution time of the event loop scheduler, and if it was larger than some value, it would yield (by sleeping for 0ms). This was intended for use in loops with varying length, which might be long and could be short depending on some external factors, but yielding on each loop iteration made them slower by an order of magnitude.

IIRC It was sending messages to RabbitMQ, which somewhere down the line is writing to a socket, but not necessarily blocking - if the socket manages to flush its buffer fast enough (faster than the processing code can send messages), writing to it may never block, resulting in a CPU bound loop (since the loop may perform work other than sending).

We didn't want people to have to think too hard about how their loop was going to behave (especially as it might mean reasoning about the internals of a third party library), and so the wrapper was born. If your loop was short enough, all it did was compare ints so the cost was negligible.

orisho··on We have to talk about this Python, Gunicorn, Gevent thing
There are other costs to regular context switching as opposed to goroutines/greenlets (the green threads that gevent uses). I don't remember the details but specific attention was paid to the point of making context switching and other resource consumption by these green threads cheaper than native threads, so I suggest reading about it in greenlet/Golang docs :) You can also try searching for C10K which was the term people used to discuss how to achieve 10K connections, and is often associated with cooperative threading.

For example, the cost of the context switch itself (storing all registers) is more significant with native threads.

Just try spinning up 100K threads that each print a line and then sleep for 10ms, and see how high your CPU usage gets.

Also, doing IO does not necessarily mean context switching - it means calling into the kernel (system calls). If you use an async IO operation (read/write from a socket) and then continue to the next thread, by the time you're done with all ready threads, you're likely to have some sockets ready to read from again, so you might not context switch at all. Kernel developers are working on even reducing the need for syscalls with io_uring, which is designed to allow you to perform IO without system calls.

← PreviousPage 3 of 4Next →