HNHacker News
TopNewBestAskShowJobs

roland-s

70 karma · joined March 21, 2014

submissionscomments
roland-s··on The Big OOPs: Anatomy of a Thirty-Five Year Mistake
The pipe operator eliminates the syntax problem.

Ocaml example:

  let increment x = x + 1
  let square x = x \* x
  let to_string x = string_of_int x

  let result = 5 |> increment |> square |> to_string
  (\* result will be "36" \*)
roland-s··on SurrealEngine: Open-source reimplementation of Unreal Engine with playable UT99
Does anyone have a good sense of how many dev hours it would take to write something like Quake/Unreal from scratch today? Not a port, but a full rewrite with a custom engine
roland-s··on IBM to buy HashiCorp in $6.4B deal
IBM owns Ansible, redserk is saying Terraform will go a similar route. Although I don't see what they mean by core being lower priority than paid. The paid features are all available for free via AWX, which is the open source upstream of the paid product AAP.
roland-s··on Helios: A distribution of Illumos powering the Oxide Rack
Linux now has eBPF, which is essentially a VM running inside the Linux kernel. You can run your own programs on this little VM and extend the kernel to a staggering degree. Some clever folks have used this to build open source tracing tools that rival and even surpass Dtrace in some ways. Brendan Gregg, a Dtrace wizard and old colleague of some of the Oxide team back at Sun and Joyent, has some great resources on the subject

https://www.brendangregg.com/ebpf.html

https://www.brendangregg.com/blog/2018-10-08/dtrace-for-linu...

roland-s··on Setting up my new laptop: Nix style
I dug into portage a bit and I think I see what you're saying. But the only way Portage can automatically load a dependency is if the ebuild specifies it. For example an ebuild can install dependencies in DEPEND or RDEPEND by checking what USE flags were passed ([1]). You can also have CFLAGs which modify compilation without installing any dependencies. So for example, in portage if I install vim with USE=python, and gnucash with USE=python, then they will both pull in python dependencies based on what was specified in the respective ebuilds (see [2] and [3]), which will probably install the same version of dev-python libs. But that's only because someone packaged vim and gnucash with a USE=python option and specified the required packages for that flag.

You can do the same thing in Nix (e.g. you can package software with a bunch of options and pull in required dependencies based on the options selected by the user), but you're right that Nix doesn't have a standardized API for doing this like Portage does. I think it would be a nice thing to have. Maybe it takes a lot of work for maintainers to pre-package every possible build option like they do in Gentoo. Instead, Nix focuses more on providing a unified interface (the Nix language) for end users to modify anything about any package. nixpkgs is also pretty flexible, allowing maintainers to use packaging approaches that aren't "standard practice", and those approaches are all exposed to the end user if they need to make changes. This usually means reading the Nix package source to see what's going on if you want to make changes to a given package. For example some packages like vim do provide a nice interface for users to choose pre-packaged build options [4], similar to USE in Portage. Since Nix is lazy-evaluated, you just have to reference the dependency in the code somewhere (search for ${python3} in the linked example), and then that dependency will only get installed if that bit of code gets executed (e.g. if the pythonSupport option gets passed).

I think that's a big part of what makes Nix a pain, the fact that end users can make almost any change they can think of to any attribute on the entire system. But that's also what makes it very powerful. Right now most people use overlays, as people described above. So you can modify the "buildInputs" attribute (the set of build-time dependencies), or the "buildPhase" to pass some different CMake flags, or any install phase you like, for any package in nixpkgs (see [5] for all bajillion phases). Nix flakes might make it easier to compose custom set of packages, but I'm not sure how yet.

Oh and one more random tangent - this whole time I've been talking about build dependencies in Nix as opposed to runtime dependencies. That's because runtime dependencies are loaded automatically based on whether they get referenced in the final output of the build. Since every package has a unique hash, Nix literally greps the final build for package hashes, and if it finds any it loads them in as runtime dependencies. This is different from something like Portage where runtime dependencies are explicitly specified in RDEPEND.

[1] https://devmanual.gentoo.org/general-concepts/dependencies/#... [2] https://gitweb.gentoo.org/repo/gentoo.git/tree/app-office/gn... [3] https://gitweb.gentoo.org/repo/gentoo.git/tree/app-editors/v... [4] https://github.com/NixOS/nixpkgs/blob/master/pkgs/applicatio... [5] https://nixos.org/manual/nixpkgs/stable/#ssec-controlling-ph...

roland-s··on Setting up my new laptop: Nix style
Nix can be a huge pain to use, and with the recent redesign it somehow feels even more disjointed than before. But it's still one of my favorite pieces of software. I think a clean interface like https://devenv.sh/ could make all the difference (havent tried it yet but looks promising).

That said, if I understand you correctly, I think nix does let you do what you're describing. You can make an overlay, which is a way to modify a set of packages by reaching in and changing build instructions or add packages to the set. So, you can make an overlay of nixpkgs and add a modified libgcc called mylibgcc to the set. In the same overlay, you can modify package A and package B that depend on libgcc, and change their build instructions, including making them use mylibgcc as a build dependency. If you do this for then both packages will use mylibgcc as a single shared dependency without duplicating it.

Im on mobile but could try to send a working example if you need one, lmk.

Some references:

https://nixos.wiki/wiki/Nixpkgs/Modifying_Packages

https://nixos.wiki/wiki/Overlays

roland-s··on Backblaze IPO
Backups are deleted after six months not 30 days. 30 days is the default revision history kept for each file. Point still stands though.

source: https://help.backblaze.com/hc/en-us/articles/217664898-What-...

roland-s··on How Silicon Valley destroyed Parler
So next we would just have to fix the justice system (giant corporations have a bit of an advantage in the current one).
roland-s··on SolarWinds leaked FTP credentials through a public GitHub repo since 2018
This is wild speculation but just to highlight how FTP could be leveraged to get a signed DLL. Imagine SolarWinds has a "sign everything in this directory" script. Attackers gain access to that trusted directory either directly via FTP or by pivoting off FTP access. They just plop their DLL in there and let SolarWinds auto-sign it. No cert required.
roland-s··on FTC issues orders to nine social media and video streaming services
iMessage is E2EE (according to Apple). But Apple can still see who's messaging who. With that you get an intimate social graph. Similar to what the NSA has on US citizens via phone records. Apple also says they don't sell your personal info to advertisers. But they can still use that data however they like, and there's nothing stopping them from selling that data at some point in the future.
roland-s··on Coordination, Good and Bad
Does high tx count and low price really mean utility? Seems it could also mean market is unsure of the asset's intrinsic worth and speculations are constantly in flux. Or could mean lots of speculative alts being built on top of main chain, things like Omni?
roland-s··on Show HN: Shift-Ctrl-F: Search a webpage with natural language and TensorFlowJS
OpenAI API has a similar demo, the Wikipedia one at https://openai.com/blog/openai-api/
roland-s··on Sampler for Mac Touchbars
Jesus christ
roland-s··on Keep Your Stuff, for Life
100% yes. With non-ECC you will always have bad RAM bits eventually. With ZFS this is especially bad because it can corrupt your checksums or your ZFS metadata, which means either silently corrupting your data, or corrupting ZFS itself and losing your entire zpool (akin to losing a RAID array).
roland-s··on HQ Trivia shuts down after acquisition falls through
I found a job posting of theirs a while back while trying to figure out their tech stack. It required experience in docker, redis, node, can't remember what else if anything. Given the on demand nature of the game you can kind of imagine the kind of microservice architecture built from those components. For example each container handles X number of users, redis cache has a copy of game state/user state, each round questions/answers are handled and losers are kicked out so load is progressively reduced through the course of a game until only a winner remains. Most likely cloud was used to spin up containers right before trivia starts so you only pay for compute while a game is in progress then spin everything down.
roland-s··on Best Practices for Data Modeling
If you're using table aliases like "O" you're already throwing clarity out the window. The following is perfectly clear and readable IMO:

    Orders.id = Customers.order_id
and also indicates which column is the primary key and which is the foreign key. What about other column names duplicated across tables, should

    Orders.created_at = Customers.created_at
become

    Orders.order_created_at = Customers.customer_created_at
Scope exists for a reason, don't be afraid to use it!
roland-s··on Matrix 1.0 and the Matrix.org Foundation
If you're willing to ditch iOS, Android has Messages for Web (an official service by Google) which lets you view/send SMS from any browser and supports file attachments etc. It's pretty great.
roland-s··on Doom 3 in WebAssembly
Newgrounds.com, addictinggames.com, and kongregate.com are the three I remember. RIP Flash and Shockwave
roland-s··on Doom 3 in WebAssembly
I had the same gripes, I use justwatch.com to search for a movie and see what streaming platforms offer it. Roku global search also does the same thing.
roland-s··on Doom 3 in WebAssembly
I think the problem is that nobody wants to go manually find games across the web, then maintain a bookmark list of their games, share purchasing info with 100 different sites, throw away a central liaison for customer support/community/developer interaction. Centralized repositories are way more useful and convenient and manageable. Now you could still do a central repo of webasm games but if anything I could see Steam offering a WebAssembly portal or something.
roland-s··on Cloud Computing Without Containers
Scaleway out of France has been doing baremetal cloud nodes for years. I used them during the beta and they are fantastic (despite slight latency due to being in France). Their smallest baremetal node starts at €3/mo for 4 ARM cores/2GB RAM/50GB SSD. Pretty cool infrastructure to be able to auto provision physical nodes on demand, but I think it's a different use case from the whole lightweight serverless processes on demand thing.
roland-s··on Host Your Blog on DigitalOcean with Docker, Nginx and Let’s Encrypt
Socket exposure can be avoided by running jwilder's nginx and docker-gen containers separately as explained in his repo (you still bind to tthe docker socket but on a separate unexposed local container): https://github.com/jwilder/nginx-proxy/blob/master/README.md...
roland-s··on Show HN: Ipfs-dropzone, a subclass of Dropzone.js that publishes to IPFS
Man, I typed a whole reply saying basically the same thing but you beat me to it! To expand a bit further, in this demo app, the "Save" button calls an API of a pinning service (Eternum), which pins the file on an external node so it will stay there as long as it's being paid for. Right now most pinning services require that you pay them to host your file, but the plan for IPFS is to use something like Filecoin to incentivize pinning. With Filecoin, instead of paying a single service to host your content, you would put out an order to the Filecoin network which says "anyone who hosts my file gets $x per GB per second", along with some settings (e.g. I want minimum 5x copies of my file on the network). Then, anyone hosting a Filecoin node will automatically fulfill requests by hosting content in exchange for a cryptocurrency payout. So, instead of a single hosting service, you are paying the entire network to automatically host your file in many places at once.
roland-s··on Ask HN: How do you take idea notes / voice memos / reminders to yourself?
Workflowy! The nested bullet structure is so simple and quick but powerful. If ur a vim head there is also vimflowy.
roland-s··on Instead of containers, give me strong config and deploy primitives
I'm not too knowledgeable on the subject but I know there are a lot of groups working on persistent storage for Docker. I think most of the time this means a docker volume that lives on some network attached storage (this could be redundant across the compute cluster or on dedicated storage servers), which is then linked to a container via the network. If you remove that container or destroy the host, the volume persists and you can recreate the container on a new host and re-attach it to the associated volume (automatically).

As far as databases and horizontal scaling, this could probably be done currently within each Docker container at the database layer as you mentioned (CockroachDB also comes to mind). So let's say you add a new docker container with its own persistent+redundant storage volumes, and that container is running a cockroachDB node. You can add more containers as cockroachDB nodes, each with their own persistent+redundant storage, and you get all the DB sharding etc across nodes from cockroachDB while the redundancy+persistence are handled by Docker (plus storage solution) as far as restarting, migrating, reconnecting, etc. This probably has all sorts of problems I'm blind to but that's my rudimentary understanding.

Handling horizontal scaling, sharding etc at the storage layer directly through Docker sounds much much harder, and I don't even know what I've been talking about so far so I'll leave it at that

Here's a list of some people doing persistent Docker storage :

  Flocker
  Portworx https://portworx.com/
  StorageOS https://storageos.com/
  Rancher Longhorn https://github.com/rancher/longhorn
  Quobyte https://www.quobyte.com/containers
  Nexenta https://nexenta.com/solutions/containers
  Infinit https://infinit.sh/docker
  EMC REX-ray https://github.com/codedellemc/rexray
  Ceph
  Gluster
  Mesos https://mesosphere.github.io/marathon/docs/external-volumes.html
  Kubernetes https://kubernetes.io/docs/concepts/storage/persistent-volumes/
  vSAN
  Nutanix http://next.nutanix.com/t5/Nutanix-Connect-Blog/Containers-Enter-the-Acropolis-Data-Fabric/ba-p/11122
  Netapp (Docker volume plugins for SolidFire+ONTAP+E-series)
  AWS EBS/EFS
roland-s··on Instead of containers, give me strong config and deploy primitives
It's tough to give a definitive answer because every company is different, but I work at a very small strange shop, 5 devs + 1 manager, maintaining 10-15 custom websites (5 of which are on a single VM) and I have been deploying our new apps in Docker (no K8s). I use each container as a "miniature VM" which runs the entire web app (except the database), blasphemous I know. Compared to putting multiple apps on one box, the Docker method adds some minor complexity, but keeps apps isolated. That was my biggest requirement, to prevent devs from cross-pollinating applications, which happened constantly when everything was on a single server. It was much simpler than setting up Puppet on a bunch of legacy machines. I also considered putting each new app on its own VM, but went with Docker because a lot of our apps hardly get any traffic and would have wasted quite a bit of resources to spin up a VM for each (all our servers are in house).

The pros to Docker so far: Dependencies: Dockerfile gives a list of explicit system dependencies for each app. This can be done in other ways with package files or config management but this was not being done before and this is an easy catch all to force it for any different type of environment. Logical Grouping: App environment (Dockerfile + docker-compose.yml) lives alongside codebase in a single git repo Deployment: Deploy to any box with `git clone myapp && docker-compose up` for testing/dev instances or migrations Development: We mount the codebase from a host directory into each container, with git hooks to update the codebase, which works well for us (we have no CI) Plus it's fun!

Cons: Operational Complexity: Devs/Ops teams probably won't want to learn a new tool. I setup a Rancher instance to provide a GUI which makes things a bit easier to swallow. It has things like a drop in shell, log viewer, performance metrics, etc. Network complexity: we never needed reverse proxies before, now we do. Clustering/Orchestration: We don't cluster our containers, but the more we add the more I think we might want to, which would add a whole new layer of complexity to the mix and seems unnecessary for such a small shop. Security?: lots of unknowns, lack of persistence can be bad for forensics, etc. Newness: Documentation isn't great, versions change fast, online resources may be outdated.

Like you, I'm sometimes unsure if this is the right choice. Maybe a monolithic server or traditional VMs + Puppet would be easier, simpler, better? In the end, I think Docker just fit with the way I conceptualized my problem so I went for it. You may never get that "definitely good enough" feeling, but if it fits your workflow and keeps your pipeline organized and manageable, then I say go for it.

roland-s··on Ask HN: Which Berkeley Courses Should I Archive?
Laws are often written with good intentions but enforced rigidly and with little common sense. A balance is needed between individualism and utilitarianism. At what point do my civil rights, when enforced by the state, infringe on yours? Who gets to determine which rights are worth protecting? Who draws the cost/benefit line in the sand? Not all men are created equal, but in a liberal democracy we mold society into one that provides equality in spite of our innate disparities. In my opinion, this equalization should be done by raising up those less fortunate, not by punishing those with advantages.

I think the real issue here is the fact that Berkeley was giving away the videos for free. If they were charging for those videos, they could incorporate the cost of ACA compliance into the price of the video. As it stands though, the state has the right to force work without providing any compensation. ACA compliance then becomes a form of servitude. (being a public university, UC Berkeley does get some state revenue, but it is only 14-25% of the total [1][2] and much of it comes in the form of contracts & grants which can only be used for the specific project they are awarded for). To me that is the real issue here, a simple matter of being compensated for one's work. I think they shouldn't be held to the same standards as someone selling a product, but that doesn't seem to be the lay of the land. I guess this is why we can't have nice things (for free).

[1] http://ucop.edu/operating-budget/_files/rbudget/2016-17budge... (page 47) [2] http://cfo.berkeley.edu/sites/default/files/2013-14%20UC%20B... (Page 1)

roland-s··on A One-Line Proof of the Infinitude of Primes
Correct. For example the series (1/n)(1/n+1)(1/n+2)... converges to zero as n-> ∞ (actually the term is "diverges to zero" for products)

You can play around with different series on Wolfram Alpha https://www.wolframalpha.com/input/?i=infinite+product+1%2Fn

roland-s··on DDoS Attack Against Dyn Managed DNS
Paypal and others still down for me at University of California (I think we're our own ISP?)
roland-s··on Google search indexes itself
Google's robots.txt http://www.google.com/robots.txt disallows /search but not //search.

However, if you search site:http://www.google.com/search and show omitted search results, you get a bunch of results (all 404s).

If you do this there are some strange results on the last couple pages.

For example: Obama won't salute the flag | Phallectomy | horse+mating+video | feral+horses+induced+abortion | Lactating+dog+images | animal+mating+video | mating+mpg+-beastiality+-...

So, Half Life 3 confirmed.