HNHacker News
TopNewBestAskShowJobs

Ixiaus

3,134 karma · joined June 24, 2009

submissionscomments
Ixiaus··on How Supervisors Work
Supervisors aren't just for restarting processes that crash, they're also responsible for cleaning up processes when the tree is being shutdown.

If you're using spawn to fire off a long-ish running process that is too small in scope to justify making a gen_<something>, you might be doing it wrong. You can easily affix the logic you need as a process on a supervisor which will (very importantly) help clean up those processes for you.

A common pattern is to use a high-level supervisor for starting up the primary gen_<whatever>'s with sub-supervisors responsible for short-lived and long-lived "small logic" children - you can also ask a supervisor to add and start a new child and to remove one, let the supervisors do the bookkeeping!

Supervisors make your process trees declarative and help you avoid process soup, even when the processes aren't that important. I highly recommend harnessing that as much as possible when designing non-trivial Erlang programs.

Ixiaus··on How Supervisors Work
A few ideas come to mind:

1) Use systemd; I've taken the time to learn it and the tooling it exposes for codifying process dependencies, how weak or strong they should be, and restart behaviors is thoroughly designed

2) Use Erlang/OTP - I went this route for an IoT product I worked on that used Erlang as the primary high-level "firmware", I codified the process tree and dependencies and custom supervisor restart behaviors for unix processes into Erlang/OTP's supervision tree; using Erlang process ports

The second approach has worked extremely well for me in the past but I would only recommend it if you're going to use a lot of Erlang to process output from the programs it spawns for you, which was the case for how I was using it at the time, the robust supervision of the processes it managed in a supervision tree was incidental to the primary use but extremely robust.

Ixiaus··on Mastering Time-to-Market with Haskell
It is faster for large programs. For small programs, I think Python is great but you also have to consider that there is no such thing as prototype code and a small script (usually but not always) balloons into something more involved than was originally intended.

THAT is where Haskell shines, the ability to refactor and expand fearlessly and aggressively.

I think for large or complex programs Haskell is much faster for constructing a skeleton because it's usually not the logical operations that trip us programmers up, it's the data flow and correct alignment of types, which are implicit in a dynamically typed language and explicit in Haskell.

So, it's kinda-sorta like writing your ideas down in a structured language which enables you to "see" the abstractions in a rigorous light, then the ability to refactor aggressively and safely kicks in so once you can see your abstractions you can quickly adapt for better ones.

So I think the initial work is made quicker in that it forces you to excogitate then because it's in some concrete form you can see it clearly and take advantage of quick turnaround time in refactoring.

Ixiaus··on Running Docker in production for 6 months
Yeah a book on nixos would be valuable I think. Understanding nixos really comes down to reading all the docs then trying to accomplish what you need to do, learning by doing and reading source code.

I love nix, my biggest gripe would be that the Nix language is dynamically typed...

Ixiaus··on Running Docker in production for 6 months
Nix derivation and nix store managed artifacts is a superior model to many language specific package managers (though the learning curve is non-trivial), we use it with Haskell extensively, for instance.
Ixiaus··on Running Docker in production for 6 months
No. They do not. Docker wants to manage containers but nix wants them in the store. I went so far as writing a derivation and tool for pulling a container into the nix store without docker so it could be docker loaded.

I really don't like docker.

Ixiaus··on Running Docker in production for 6 months
What's hilarious is that we use both nixos and docker...
Ixiaus··on Trump’s sweep could be a big setback to Tesla and Elon Musk
It's not just presidents that don't have the balls, it's also consumers and other policy makers.
Ixiaus··on Ask HN: Who is hiring? (November 2016)
I don't even know you so don't take what I said personally, I was attempting to be helpful :)

I think stating the salary range and then providing examples of the CoL in the area without trying to justify the salary range in comparison to it is the best way to advertise the position.

Saying what you just said: We are looking for great candidates wanting to live in beautiful southern Idaho is compelling too (for people wanting to get away from the huge and congested cities).

Anyway, random internet stranger conversations, take it all with a grain of salt :)

Ixiaus··on Ask HN: Who is hiring? (November 2016)
> ...because of people like you.

Your generalization is not true. There are many reasons why a company does not want to post salary ranges and I'm quite sure that direct and non-hostile feedback about how copy for a job posting on Hacker News might be interpreted, is a small maybe even insignificant, reason.

Ixiaus··on Ask HN: Who is hiring? (November 2016)
Salary will range from $80-120K. (That's like $150-$200K in CA with Idaho cost of living adjustment :) )

It's fine to post the desired salary range for a candidate no matter what that range is, you'll filter out the people who are or are not willing to work for that range, which is fine.

But 80-120 in Idaho is not equiv to 150-200 in CA. Most outfits that I've worked for and spoken with pay based on "fair and equitable" comp and do not attempt to complicate the situation with a "cost of living bonus".

By phrasing it the way you have, it sounds like you're trying to get away with cheaper comp "because of lower cost of living" without actually considering that you're competing against many other companies willing to hire remotely that pay significantly more regardless of locale.

Ixiaus··on Ask HN: How do you organise/integrate all the information in your life?
Emacs and org-mode.
Ixiaus··on AWS S3 open source alternative written in Go
Or, run Riak with their S3 compatibility layer. Riak is extremely stable and the work Basho has done to make a truly robust distributed database is significant.

http://docs.basho.com/riak/cs/2.1.1/

Ixiaus··on Loneliness Is a Warning Sign to Be Social
There's nothing wrong with the path you've chosen for yourself but I can say based on my anecdotal experience that human social dynamics, particularly in groups, can be counter-intuitive and are definitely a "you get what you put in" kind of thing (not to be confused with being a doormat for your "friends").

I think it's remarkably important to surround yourself with people that are meaningful to you; that to me is different from things in common. Having things in common helps provide a medium for bonding but it's rarely the specific activity that is the focus for bonding, it's the shared experience that is.

There are lots of people that I call friends with whom I have little in-common, but there's a specific experience I've had with them or perhaps one specific thing to bond over that has created a strong connection.

Meaningful conversation is important too but I often find that trying to have a conversation I want to have can be productive. Many people are actually very interested in different ways of thinking or approaching life.

Ixiaus··on Malicious computers caught snooping on Tor-anonymized Dark Web sites
GNUNet / SecuShare though it isn't quite mature enough...
Ixiaus··on Algebraic patterns – Semigroup
I would checkout Christopher Meiklejohn's website, he's a researching working on this stuff and doing some cool OSS work: https://christophermeiklejohn.com/
Ixiaus··on Algebraic patterns – Semigroup
Yeah I'm excited to see what you guys come up with on delta CRDTs.

Our node cluster sizes are fairly manageable so we can tolerate the inefficiency right now but it will be nice to have a solution in-place when we want to optimize.

I did not know about HyParView. Thank you!

Ixiaus··on Algebraic patterns – Semigroup
noelwalsh also included a bit about CRDTs, which he didn't expand upon, but is pretty different from "the Map-Reduce programming model" in a few ways. I expanded on the CRDT comment above.
Ixiaus··on Algebraic patterns – Semigroup
This is a good reply and I'll add to it.

Note that CRDT stands for Conflict free Replicated Datatype and there are a few sub-acronym expansions: Convergent Replicated Datatype and Commutative Replicated Datatype.

[EDIT] I wanted to add that CRDTs were mentioned here because in order for them to provide the kind of guarantees they do they must satisfy the law of associativity (or, be a semigroup), commutativity, and idempotency. So, technically, you have to go further than semigroups with commutative semigroups. [/EDIT]

At Plum we made heavy use of CRDT's on-top of an eventually consistent whole-state replication technology called Plumtree, no relation to the company's name, just coincidence, within the internet-connected dimmer we built called the Lightpad.

The primary design goal was to enable advanced configurations: Arbitrary groups of Lightpads could be controlled from any other one on the same network by binding it to a specific finger gesture. We also did not want this configuration to be dependent upon any single master, they had to be truly master-less.

In-general, Eventual Consistency is pretty scary when you're deploying it to embedded internet-connected devices where you can't immediately shell onto the device like you can with a server in a data center. I have lots of stories here I'll write about sometime of the pains I encountered while developing this solution and how I ended up on CRDTs.

Strong Eventual Consistency (typically, CRDTs deployed on-top of an eventually consistent substrate), though, is very safe and provides a lot of guarantees about the concurrent behavior of the algorithm as it acts upon your data.

Using a CRDT (specifically the ORSWOT - Observed Removal Set Without Tombstones) eliminated the majority of our pains and concerns with data-loss, conflicting concurrent writes, and integrity in the face of flaky consumer-grade home networks (Plumtree is highly-available and partition tolerant - perfect for our needs where we have to be able to continue moving forward even if a majority or more of the Lightpads go offline and never come back up).

Ixiaus··on Our nightmare on Amazon ECS
Use kms and dynamodb with key enveloping, or this tool: https://github.com/fugue/credstash

Don't initialize into env vars and don't store in repos, even private ones.

Ixiaus··on Our nightmare on Amazon ECS
Probably want to use a secret management tool and just not initialize into environment variables...

https://github.com/fugue/credstash

Ixiaus··on Google Deactivates Web Search API
From my last and admittedly cursory look it wasn't that simple. IIRC JSON wasn't even used, I think it was a binary protocol.
Ixiaus··on Google Deactivates Web Search API
When you set the location in Google it customizes the cookie with a named field that is a capital L I believe. That field is encoded or encrypted and I could never figure it out so I just constructed a rainbow table by using phantomjs to set a location and scrape the cookie out, pairing the known location value with the encrypted value so that we could customize "the location of the search".
Ixiaus··on Google Deactivates Web Search API
No because then you'd have to use a headless browser that can execute js. That increases time and cost when scraping, though it wouldn't surprise me if it ends up going that way.
Ixiaus··on Google Deactivates Web Search API
It was indeed pretty rough it wouldn't surprise me if Google moves to js generated dom elements to combat rank trackers, at the time it was fine because they want to service non-js browsers but that might change.

Parsing it wasn't hard but it wasn't fun...

Ixiaus··on Google Deactivates Web Search API
Oh and I just used a generic HTTP request client in Erlang and xpath / HTML parser to extract what we needed.
Ixiaus··on Google Deactivates Web Search API
We had a pool of IPs we were leasing on our own, proxy services get abused and are poisoned.

We didn't rate limit, we would just increase the size of the cookie pool if a captcha was hit, which was rare because we would scrape n-pages till a threshold was met to prevent that session from being captcha'ed so we wouldn't have to captcha solve it. We had two pools, the primary pool and the "chilling" pool, cookies near their captcha life would cool off for a few hours before returning to the active pool which behaves just like any other resource pool, every page scraped would "borrow" a cookie out of the pool, customize the encrypted location key, and make the request with a common user agent string.

Scaling it was difficult but once we had it figured out, Erlang was invaluable to us and our dependence on IPs dropped once we figured out the cookie methodology.

Solving captchas is cheaper than renting IPs.

Ixiaus··on Google Deactivates Web Search API
I also built a rank tracker (WhooshTraffic at the time - no longer around) and we scraped the Search Result Pages as the user would see them, spoofed the session cookie and used human captcha solvers. We would then cache the cookies generated from the captcha solve.

It was highly effective and very scalable because you can stimulate the captcha pages easily and out-of-band generate a very large cookie pool by captcha solving. Then when you go to actually scrape google you can balance your pool of IPs and cookies, chilling them before they trigger another captcha, to handle spiking demand. Contant, sustained demand was very easy to plan for.

Anyway, we stopped using the API after the third day and realized it was not only not accurate and you couldn't turn many knobs (want to scrape results as they look for a different geographical region?)

Ixiaus··on CopperheadOS: A hardened open-source operating system based on Android
It is very dire and painful :-(
Ixiaus··on Erlang 19.0 Garbage Collector
This is very exciting. We use Erlang in an embedded environment and 19.0 will be a valuable release for us.
← PreviousPage 5 of 34Next →