Church Numerals in C++ (and Haskell) - <AUTHOR> http://nonchalantlytyped.net/blog/2010/04/24/church-numerals-in-c/

<comment><USER2> Great argument as to why C++, though it works for functional programming in some technical sense, is far less than ideal.

<comment><USER3> If you want to be picky, you might even say this doesn't really implement Church numerals in C++ (it implements them in the C++ _compiler_ ), since the conversion between integers and Church numerals takes place in compile time template expansion. What happens if you want to throw a new integer at this program at runtime?

> You might have to pass -ftemplate-depth-1024 to g++ to get this compiled.

Yeah, no kidding. Semantic arguments aside, this made my head hurt, and I've actually done a reasonable amount of C++ programming.

For comparison, here are what Church numerals look like in Clojure, another language that (like Haskell) has first-class higher order functions:

        (defn church [n]
          (cond (= n 0) (fn [f x] x)
                (> n 0) (fn [f x] (f ((church (dec n)) f x)))))

        (defn unchurch [n]
          (n inc 0))

And it works at runtime.

</comment></comment><comment><USER4> I love reading about all the template meta-programming people like to do. Then again, I'm sure compile times are a bitch.

<comment><USER5> Would you like some run-time meta programming? if it didn't take too long to explain, I would slap you with some CLOS-fu.

Imagine a language with a programmable object system. Programmable representation of methods and classes. Programmable evaluation order. Programmable persistence, sharing, and initialization.

<http://lispm.dyndns.org/documentation/amop/toc.html>

Wherever you see the word "Protocol" in that index, it means there are hooks in place to let you override the defaults.

Common Lisp is so malleable, every programmer is almost forced to become a language architect. You will spend a great deal of your time searching for the most aesthetically pleasing way to do something, instead of the _easiest_.

The best part is your ability to step into macro expansion one step at a time. You will never be confronted with a pile of machine generated low-level rubbish. Macroexpand-1 each form, repeatedly, and you get to see the onion unfold in slow-mo.

</comment></comment><comment><USER6> This is pointless but fun to do,

      church = (foldr (.) id .).replicate
      unchurch = ($ 0).($ (+1))

</comment><comment><USER7> You have a problem.

You've decided to use C++ templates.

Now you have two problems.

<comment><USER8> Templates are useful when you need to use the standard containers.

When you start doing metaprogramming beyound that, guys like me start to get very nervous.

<comment><USER9> I like to make a very important distinction with templates in C++, categorizing uses into three classes:

1) "Java" generics. That is, anything you could do with generics in Java. No one should have an issue using templates like this.

2) Non-recursive "typedef" programming. That is, uses like "::value_type" in the STL containers. These are incredibly useful to have around when writing generic algorithms, but their overuse leads to unparseable code to some set of C++ programmers. Use with caution, but still use.

3) Recursive templates and other subtle uses I haven't covered with the above two. Try very, very, very hard to avoid.

That makes the "will my coworkers understand this code?" question very easy to answer.

<comment><USER10> Where would you place expression templates that help designers to embed simple domain specific languages in C++? The end user doesn't have to know much about templates, but this approach leads to high performance AND very concise and expressive code.</comment></comment></comment></comment>


Indian Government to intercept phone calls without operator knowledge - <AUTHOR> http://www.thehindu.com/news/national/article2920844.ece?homepage=true

<comment><USER2> So, let me see if I have this right.

The tax department approached telecom providers to intercept a bunch of calls with high-profile people (Radia tapes) conducting money laundering, tax evasion, buying media influence, etc. These were leaked (presumably by the telecom providers). This was so high-profile that there was a near-total media blackout about it.

Embarrassed, the government has created a central system for tapping phones, taking telecom providers out of the loop. Now they can tap a phone without the telecom provider knowing about it.

The government is making it easier to tap phones without anyone knowing: that's bad.

The government is ensuring that, when they do tap a phone, it isn't leaked: that's good.

The government is only doing this because there is so much corruption that it's embarrassing when these are leaked: that's hilarious.

</comment><comment><USER3> present government of India is always interested in shooting the messenger. They are paranoid to the core.

Now thats from the largest "Democracy" of the world

Pranab Mukherjee want to curb power of election commission

P Chidambaram infringe upon states power on Law & order

Kapil Sibal control the social networking sites. access the emails and chats

</comment><comment><USER4> it's a welcome move by the Government..!

<comment><USER5> you're kidding right ?

<comment><USER6> No he is not. I too whole heartedly support the move! We love this government and all their recent maneuvers to police us against the misguided thought that there is an alternative. Hopefully people of our nation who write slanderous posts about our leaders understand how much they care - they are investing (Rs.170 crore) for listening to what we have to say!

[Ok ... I Need to calm down!]

</comment></comment></comment><comment><USER7> bharat mata ki chuut !</comment>


Norway's Barnevernet: They took our four children… then the baby - <AUTHOR> http://www.bbc.com/news/magazine-36026458 <comment><USER2> Imagine someone slapped you on the face every time you did something wrong at work. Now imagine someone 3 times your size slaps you.

If you can't raise a child without hitting him/her, maybe parenting isn't for you.

<comment><AUTHOR> If they did something wrong, why don't say that and try to find a solution for the family, for the kids interest? If they are not alcoholics with known problems in society ... I still thik they are the best parents for them.

Why don't let children's speak with parents about what is "the problem".

After all, I was a kid who did a lot of stupid things ...

Is there anything that say the beat the so "cruel"? Don't judge so fast ...

<comment><USER3> First of all we are only hearing the parent's side of the story. For all we know there may be other concerns.

These parents broke the law. It is against the law to hit their children no matter the reason. When you move to a foreign country you need to follow the law. You don't expect the service to leave children in the homes of potentially abusive parents while they investigate?

<comment><AUTHOR> Correctly, but the state must say what accuse you of ...

If I do something wrong, take me (to prison or whatever), not my kids ...

PS: I'm not part of the family, but I support the parents.

Note: Imagine that you are a parent, have a kid and it's at my kindergarten. I didn't finished a psychology school, but I think something is wrong on your family and make a complaint about you.

They first take the kid and after try to see what is the problem, but won't say you exactly ... for the children protection. Sorry, honestly, it doesn't make sense for "democracy".

<comment><USER3> _> Correctly, but the state must say what accuse you of _

They were informed when they where taken to the police statoin to be questioned.

 _> but won't say you exactly ... for the children protection_

That is only regarding answering the media's questions. The parents are informed. The police are not allowed to give such information to the media in order to protect privacy rights of the children (and the accused parents if they wanted to)

 _> If I do something wrong, take me (to prison or whatever), not my kid_

Their focus is to protect the kids and separate them from potential abusers until they have clarified the situation. You can't take the parents out of the home and leave the kids alone? The only choice is to put the children under temporary foster care until they either clear the parents or find some other arrangement. As a general rule they prefer to let the children live with their parents of course, but they have to make sure that it is safe to return.

The baby has been returned, but the older children are still in temporary foster homes. The parents are under investigation and the police will decide if they are going to press charges in a court hearing next month. The system has to take the children's rights seriously, so they can not return until their rights are protected.

BTW: This is not something that is specific to Norway. All Nordic countries have come a long way when it comes to protecting children's rights.

I do not have any connection to this case. I'm just someone who takes the rights of children seriously, even if their parents think they have the right to ignore them.

I'm sure that the parents do not mean them harm, but when the police gets a warning they have to keep the children's rights in mind. Parents who get the media's attention should not get special preferences. The law should be equal to everyone. That is why they follow the same procedure so that everyone is treated equally. If the investigation proves that the parents won't beat the children again, they may be returned.

<comment> r-w 1\. Inform the parents and work out a plan.

2\. If nothing changes, move the kids to the same foster home and work with the parents to create a better environment to the kids.

No one here is trying to raise damaged kids; the parents seem to just have a view of how to raise their children that infringes on their kids' rights. If they break the law a second time after being informed that what they're doing is illegal, then we know it will require more than just informing them. Taking the children away clearly should not be the first step unless we already know they are defying the law.</comment></comment></comment></comment></comment></comment>


Google Wave Morphs Itself into New Offerings - <AUTHOR> http://blog.programmableweb.com/2011/01/10/google-wave-morphs-itself-into-new-offerings

<comment><USER2> as much as everyone likes to call it a failure.. I think google is awesome at releasing technology and seeing if theres anything there that people will like to iterate upon or pivot. Like the article states.. the wave technology I can see being used in a lot of their future products for real time.. possibly their social offering.

</comment><comment><USER3> Google Wave was awesome. I'm still irked that nobody else gave it a chance</comment>


Request HN: Follow-user feature - <AUTHOR>

I'm finding less and less on the front page to be of personal interest, not because it's not there - just there's more programming stuff now than 'generally interesting to hackers' stuff.  I'm manually hacking a 'following usr' submissions feature but its ugly. would anyone else see benefit in this?<p>Follow-usr List = usr adds a list of user names to their profile.  Only show submissions from this list. <comment><USER2> Personally I'm more interested in the stories. Following specific people might not yield the variety that I would like if they do not submit stories regularly, so my preference is still the home page as it stands. As an option though, I guess it might be useful, there are definitely a couple of commentators and friends I would like to quickly view, both their submissions and recent comments.

</comment><comment><USER3> <http://hnnotify.com/> sort of does what you want, but I agree that having following built in to HN would be slick.</comment>


Web typography is broken. Here's how we can fix it - <AUTHOR> http://www.studiothick.com/essays/web-typography-is-broken/ <comment><AUTHOR> There is little concept of the typographic baseline on the web — but maybe we can correct for it. In this post I've explored a number of vertical rhythm systems and writings that have influenced how we set type on the web. It's clear that there's a disparity between the way designers set type and the way browsers render text — so I'd like to introduce our solution — a new open source tool we've named MegaType.</comment>


On the Consequences of Simplicity - <AUTHOR> http://nirnlevy.blogspot.com/2001/12/seek-simplicity-and-distrust-it.html

<comment><USER2> Well..."Make everything as simple as possible, but not simpler."</comment>


Reverse engineering IT recruiting - <AUTHOR> https://www.togglegreen.com/

<comment><AUTHOR> What if recruiters only contacted you when you wanted them to. That's about to happen when ToggleGreen launches in mid December. This is secure, private network where job seekers and recruiters can connect, communicate and coordinate to fill positions.</comment>


Not available on the App Store - <AUTHOR> http://notonappstore.com

<comment><USER2> Pretentious twaddle.

<comment><USER3> cynical HN comment.

<comment><USER4> Utopian rebuttal.

</comment></comment></comment><comment><USER5> Note to self, put playground on app store.

</comment><comment><USER6> I thought it was going to be a list of stuff that had been banned... like bitcoin apps, etc.

</comment><comment><USER7> You should move that PDF to S3. Dropbox sharing isn't really for publicly hosting downloads and there's a quota.

</comment><comment><USER8> Site created on Tumblr, available on the App Store: [https://itunes.apple.com/gb/app/tumblr/id305343404?mt=8](https://itunes.apple.com/gb/app/tumblr/id305343404?mt=8)

</comment><comment><USER9> The author should run a Teespring campaign with this logo. I'd happily have one.

</comment><comment><USER10> Genius. Even with all this technology, there's still the good old swing park.

</comment><comment><USER11> These are great.... but $3 per sticker?! That's absurd.

<comment><USER12> I agree, someone should make an app that would take arbitrary picture and allow you to overlay sticker over it. Add some simple transformations for sticker and put it in the app store.

"Not available in the app store? Sure, there is an app for that."

</comment></comment><comment><USER13> What is this, your anti-drug?

<comment><USER14> What is this, an app store for antss?

</comment></comment><comment><USER15> [http://imgur.com/g/memes/AHHAsPD](http://imgur.com/g/memes/AHHAsPD)</comment>


Let's Make Great Software For Writers, Together - <AUTHOR> http://moron4hire.tumblr.com/post/80162485841/lets-make-great-software-for-writers-together

<comment><USER2> Seems interesting.

For most kind of books (non-technical ones), I think a simple text editor would suffice. Write in markdown (that's easy enough for non-technical writers to grasp) and then convert to epub with pandoc or something similar.

Or was your idea different, like a full-fledged word processors that can export to epub?

<comment><AUTHOR> JWD is just a text editor. It is meant to be a platform for training people to complete writing projects. The un-distracted writing format was a big win for my friends. It was difficult to keep up with the project after NaNoWriMo finished and my friends weren't writing anymore, emailing me all the time, bugging me for updates :)

Some of the feedback I got early on was that some people really wanted to do some basic formatting. I think what they really meant was that they wanted basic organizing, the formatting was just how they knew how to do it. There is no point in letting them choose fonts, for example, because once the book is on the Kindle it will only be readable in a select few fonts, chosen by the user, anyway. Simple interface. Get the writer to stop futzing around with meaningless activity. Get them focused on writing.

I think the next "big win" in that respect would be to make the ePub package. It should be dead-simple for a user to go from editor to saved document to uploading to Kindle Direct Publishing. And they should have a reasonable expectation of what that document will look like.

Semantic markup in the back end, a default style sheet on top of it, and yes, perhaps a Markdown-style interface for the user.

</comment></comment><comment><USER3> i'm just about to release a whole ton of stuff...

one-click output to many formats, including .epub, from light-markup (zen markup) ascii-text-files...

2-pane setup: supercharged textarea on one side, and nicely-formatted live display on the other...

other apps cover the entire workflow, start to end.

i'd love pre-release feedback. firstname.lastname@example.com

-bowerbird</comment>


The top ad when you Google 'amazon' is a scam - <AUTHOR> If you google amazon the top ad is a blue screen saying your computer has a virus. <comment><USER2> This has been going on for a week, but the thing that hits the top of HN is that they updated Google Voice. Serious security issues need not apply to front page.

I've pinged a couple security experts directly, nobody's responded on the issue. I told a tech news site about it. Waiting for someone to recognize that Google Ads has a major security problem right now.

My submission from a week ago: [https://news.ycombinator.com/item?id=13413399](https://news.ycombinator.com/item?id=13413399)

<comment><USER3> I agree with your take. This should absolutely be taken more seriously. At the very least this site is a scam site, and it seems possible that it is even more nefarious. Google ads are supposed to be very credible, unlike the Wild West of some ad networks.

<comment><USER2> I'd contest the claim that "Google ads are very credible", they ship a lot of malware. But the key point is that that green URL bar NEEDS to be accurate. If it says [http://www.amazon.com](http://www.amazon.com) in the green text next to the Ad marker, it absolutely had better go to amazon.com.

</comment></comment></comment><comment><USER3> There was post early today ([https://news.ycombinator.com/item?id=13463263](https://news.ycombinator.com/item?id=13463263)) where the same issue was happening, but the search was for youtube. The hoax site looked just like you are describing. Interestingly, I am no longer seeing any ads on my google searches.

<comment><USER2> If you wanna check and see if Google Ads are live, search "windows support". There's always scam vendors in the ads there, and Google never does anything about them. Part of their business model to push Chromebooks. :)

As the case is, "windows support" still has three malicious ads up top, but the YouTube ad from earlier is gone, and it looks like they fixed the Amazon one, AFAICT.

<comment><USER3> Yeah, the ads for windows support show up, however they all actually link to where the add says they do. In the case of the youtube and amazon ones today, the add link showed amazon.com and youtube.com respectively, but didn't go to either.

</comment></comment></comment><comment><AUTHOR> [http://imgur.com/a/BK2MZ](http://imgur.com/a/BK2MZ)

the link looks like:

      amazon.com - Amazon - 20% off on all products

<comment><AUTHOR> [http://imgur.com/a/psP7X](http://imgur.com/a/psP7X)

The search looks legit and everything though, even shows the url as www.amazon.com

</comment></comment><comment><USER4> For years the top result in bing for "chrome" was a virus. Again bing showed the url as google.com and the site was made to look like google.

<comment><USER5> I'm sure nobody over at MS totally unintentionally overlooked that for a long while. :^)

</comment></comment><comment><USER6> So this is the aftermath of all the shadesters buying adwords accounts off Craigslist?

</comment><comment><USER7> Adblock is your friend.</comment>


Scientists Brace for Media Storm Around Controversial Flu Studies - <AUTHOR> http://news.sciencemag.org/scienceinsider/2011/11/scientists-brace-for-media-storm.html

<comment><USER2> See also (<http://news.ycombinator.com/item?id=3279225>)

I wonder how many ferrets the researchers used? I'm curious to know if all that kind of information is being kept hidden already?</comment>


Strunk and White's Macho Grammar Club - <AUTHOR> http://www.thedailybeast.com/articles/2015/07/12/strunk-and-white-s-macho-grammar-club0.html

<comment><USER2> Geoffrey K. Pullum: 50 Years of Stupid Grammar Advice [1]

[1] [http://chronicle.com/article/50-Years-of-Stupid- Grammar/2549...](http://chronicle.com/article/50-Years-of-Stupid- Grammar/25497)

<comment><USER3> _Even the truly silly advice, like "Do not inject opinion," doesn't really do harm. (No force on earth can prevent undergraduates from injecting opinion. And anyway, sometimes that is just what we want from them.) _

Geoffrey's writing would be stronger omitting "truly", "really" and "anyway". It isn't just novice writers who need reminders to omit needless words.

</comment></comment><comment><USER4> OT, but what are we calling this recently trendy pattern of putting multiple distinct articles on one page? I just saw it on Bloomberg, and now TDB. I keep scrolling and thinking to myself, "What a long article!"

It's like the worst form of infinite scroll.

</comment><comment><USER5> Do read the comments.

<comment><USER6> I tried, but that smiling Republican refuses to budge and is creeping me out.</comment></comment>


Apple Finally Figures Out A Way To Get An iAd In My Face: An iAd App - <AUTHOR> http://techcrunch.com/2011/04/05/apple-iad-app/ <comment><USER2> A free and constantly updated gallery of professionally designed ads is nothing to scoff at, especially for creative professionals.

</comment><comment><USER3> The effect iAds so far has had on me is to buy the Pro version just to get rid of the ads. Too invasive and they keep drawing my eyeballs to them and gets in the way of using the app. Probably not what Apple had in mind, but the developers are probably happy.

<comment><USER4> iAd Gallery Pro, now with fewer ads?

</comment></comment><comment><USER5> I Fucking Hate It When People Write Headlines Like That, Especially When They Have Lots Of Short Words.

<comment><USER2> And articles written in a stilted style peppered with sentences that begin with And and But.</comment></comment>


Ask HN: Does using a VPN meaningfully increase security on public networks? - <AUTHOR> I've been using Algo VPN (https://github.com/trailofbits/algo) to tunnel traffic to a VPS I control. I primarily use it when I use my computer at airports, coffee shops, etc. It's highly recommended by people I trust in the security community, hence why I use it. Apologies for my ignorance, but how does my setup increase security as opposed to browsing the internet on a public network over https? <comment><USER2> It increases security against ISP surveillance, local attacks (DNS poisoning, man in the middle) performed by adversaries on your local network, hostile access points and other public honey pot attacks, and general eavesdropping anywhere between you and the VPN provider. It also helps combat network non- neutrality by making it hard for your ISP to throttle or selectively prioritize traffic.

Regular privacy VPNs will not protect you against adversaries beyond the VPN in the network path, nor will they protect your anonymity against highly sophisticated or nation state level attackers with the capacity to either surveil the network broadly or just subpoena the VPN provider.

</comment><comment><USER3> * DNS visible

* HTTP visible

* SMTP visible

* POP3 visible

* Traffic timing/volume analysis

* Ports you're connecting to identify the service you're using

And so on ...

Not a problem with a VPN.</comment>


Senator presses NSA to reveal whether it spies on members of Congress - <AUTHOR> http://www.theguardian.com/world/2014/jan/03/nsa-asked-spying-congress-bernie-sanders <comment><USER2> Only for training purposes, with recordings promptly destroyed! See from 1995 (!):

[http://articles.baltimoresun.com/1995-12-12/news/1995346001_...](http://articles.baltimoresun.com/1995-12-12/news/1995346001_1_nsa- eavesdropping-listening-national-security-agency)

FTA:

 _" We listened to all the calls in and out of Washington," says one former NSA linguist, recalling a class at the Warrenton Training Center, a CIA communications school on a Virginia hilltop. "We'd listen to senators, representatives, government agencies, housewives talking to their lovers."_

<comment><USER3> Also, for those who have missed it:

Obama was being surveilled as well, before being elected:

[http://www.boilingfrogspost.com/2013/06/19/podcast- show-112-...](http://www.boilingfrogspost.com/2013/06/19/podcast-show-112-nsa- whistleblower-goes-on-record-reveals-new-information-names-culprits/)

Which means Obama may effectively be a puppet (if you compare his promises and reality, it sure looks like it). And that would then mean that no future President would be able to start limiting the growing corruption, with the NSA in power.

<comment><USER4> > _Which means Obama may effectively be a puppet_

Effectively? Nobody gets the backing of a major party for his nomination, donations, etc, without being thorougly screened and vetoed that they'll "do the right thing" to continue supporting several interests (partisan, financial, political, etc).

It's not like parties do all this gerrymandering and political games to then allow some loose canon President to realy change the system.

In that sense, they are all puppets, even without surveillance coming into play.

<comment><USER5> The difference is that when the puppetmasters are two political parties in competition to each other, they have adapt their positions to popular opinion or else their puppets loose power and become worthless. When the puppetmasters are the NSA, then they do not need to adapt their posistions, because regardless of the election, they still have puppets.

<comment><USER6> "two political parties in competition to each other"

Where can we find these parties? When last I checked, we had two parties that share a common high-level agenda and which generally agree on the majority of issues (to the point where people have basically forgotten that there could even be any debate on such things).

<comment><USER5> >to the point where people have basically forgotten that there could even be any debate on such things

Exactly. The problem is that the public accepts the status que as correct on numerous issues. If their were an issue where a significant portion of the voting public had a different view, then I would expect a one of the political parties to adopt that view to gain voters from the other.

I agree that a two party system is far from ideal. The main problem is that if every one who disagrees with the current position on issue X is already firmly committed to their own party for unrelated reasons then their is no pressure. The traditional solution to this problem to focus on primary elections. Unfortunately (for me), a group of Republicans have recognized this, and managed to affect significant change by focusing on the getting their views through in the primaries. In the long term (I hope) this will self correct as it damages the Republicans in the main election

</comment></comment></comment></comment></comment></comment><comment><USER7> This is brilliant. This is how we'll get legislation passed reigning in the NSA. Elected officials will wake up and ask "Wait, you mean they're spying on ME?!"

<comment><USER5> In fairness, spying of congress (and the president, judges, etc) does seem much more concerning then spying on most citizens, as it would allow them to break the checks on their power that those bodies should provide. In fact, one of the largest concerns I have heard about surveleince is that it would allow them to blackmail politicians.

<comment><USER8> Yeah but if you're trying to catch criminals the signal to noise is far better with presidents, judges, and congress than with boring, normal citizens.

<comment><USER9> Hehe, good one.

FTR, the ratio is much lower when trying to catch foreign terrorists. :P

</comment></comment></comment></comment><comment><USER10> "...if the NSA has spied, or is the NSA currently spying, on members of Congress or other American elected officials"

It depends on your definitions of "has", "spied", "spying", "currently", "elected" and "members".

So the answer is, "No".

<comment><USER11> I find it very depressing that semantics and definitions of fairly common- sense words are at the center of this particular set of weaseling.

<comment><USER12> Lawyer talk and double speak.

Bill Clinton got away with the Monica comment about sex and so will the next bunch about something different.

<comment><USER13> If you call impeachment getting away with it.

Side note: his predecessor had a long-time mistress that was well known to beltway insiders. The Right changed the rules once they were out of power.

<comment><USER12> Times have changed its no longer acceptable to have a mistress no matter what position you're in.

</comment></comment></comment></comment></comment><comment><USER14> If you'd like to call or get in contact with Senator Sanders, try: [http://www.callcongressnow.org/profile/S000033](http://www.callcongressnow.org/profile/S000033)

Just click the call button, give the microphone permissions, and then it will call his Washington office for you via Twilio.

If you'd like to find another member of Congress, just visit the root domain: [http://www.callcongressnow.org/](http://www.callcongressnow.org/)

This is a little app I've been working on and I'm just starting to talk about it today, so bugs are to be expected. If you find one, please file an issue here: [https://github.com/zmaril/callcongressnow](https://github.com/zmaril/callcongressnow)

</comment><comment><USER15> Now it makes sense. Every closeted gay Republican senator and aide knows the NSA has dirt on them, so they shut up.

(We all have stuff we don't want others to know, but few seem as common or career destroying as gay-bashing senators being in the closet)

Relevant: "Apparently to the homophobes running the NSA, chickenfuckers were a-okay — the security threat came from gays." [http://pando.com/2013/12/29/snowdens-biggest-revelation- we-d...](http://pando.com/2013/12/29/snowdens-biggest-revelation-we-dont-know- what-power-is-anymore-nor-do-we-care/)

<comment><USER16> I think the chickens were judged okay only after they'd confirmed no roosters were involved.

</comment></comment><comment><USER17> Gen Clapper lied once[1] under direct questioning by a Senator who knew the answer already. What makes Sen Sanders think that they won't lie again?

[1] [http://www.slate.com/articles/news_and_politics/war_stories/...](http://www.slate.com/articles/news_and_politics/war_stories/2013/06/fire_dni_james_clapper_he_lied_to_congress_about_nsa_surveillance.html)

</comment><comment><USER18> I wonder if I can do the same thing with the MPAA:

well, yes I downloaded all those movies, but I haven't watched any of them. Really, if I decide to watch one, there is a process by which I purchase it first. Promise. It's not infringement unless I actually _WATCH_ the movie.

</comment><comment><USER19> This was actually central to a scandal that happened a few years ago involving former congresswoman Jane Harman. The allegations claiming that she was caught red-handed in impropriety were based on _NSA transcripts_.[1,2]

Also, somewhat unrelated yet interesting: Harman authored an op-ed in the Washington Post a couple months ago.[3] It seems she primarily railed against the NSA, while simultaneously failing to disclose her obvious conflict of interest, and took a parting shot at Snowden in the process.

[1] [http://latimesblogs.latimes.com/washington/2009/04/jane- harm...](http://latimesblogs.latimes.com/washington/2009/04/jane-harman- denies-cq-report-she-was-caught-on-nsa-wiretap-lobbying-for-aipac- officials.html)

[2] [http://www.salon.com/2009/04/20/harman/](http://www.salon.com/2009/04/20/harman/) (Gleen Greenwald authored this piece.)

[3] [http://www.washingtonpost.com/opinions/security-policies- for...](http://www.washingtonpost.com/opinions/security-policies-for-a-post- snowden-age/2013/11/07/be307c90-464c-11e3-a196-3544a03c2351_story.html)

</comment><comment><USER20> >Sanders ... defined "spying" as "gathering metadata on calls made from official or personal phones, content from websites visited or emails sent, or collecting any other data from a third party not made available to the general public in the regular course of business".

To the twisted minds at the NSA, there are a ton of loopholes in that language, unfortunately.

</comment><comment><USER12> Keeps your friends close and your enemies closer.

In this case why not spy on the people who have the power to cut your funding. Even though its clearly wrong and sounds like something North Korea does.

</comment><comment><USER21> Uhh of course they do. Why would they be exempt? If anything they are a legitimate target for fears of compromising national security.

<comment><USER22> Congress can fuck up the country far more effectively than terrorism. See: Congress' response to terrorism. The scrutiny on them should be ENORMOUS but instead it is exactly the reverse, they are using a billions-dollar world eavesdropping device to parallel-construction convict petty pot dealers.

<comment><USER23> Yes but I don't think closed door NSA style surveillance of congress people would be helpful. Government open data programs? Probably a better direction.

</comment></comment></comment><comment><USER24> Of course they do.

If I am controlling the spying, every top law and business school student and people close to them would be under surveillance the day they were accepted.

</comment><comment><USER25> Does anyone feel more reticent than usual to chime in on these threads despite this being one of the most provocative topics on HN? Asking for a friend...

<comment><USER26> No, I don't. I admit that I very occasionally think twice about saying some things.

Actually I think writing about the NSA in forums like this, and in email, is the only effective way I have at trying to convince the analysts and spies that they're doing the wrong thing. [You listening, analyst spy?]

</comment></comment><comment><USER27> I'm confused by this. I thought this was already established fact based on declassified documents?

[http://www.theshillongtimes.com/2013/09/27/nsa-spied-on- us-s...](http://www.theshillongtimes.com/2013/09/27/nsa-spied-on-us-senators/)

</comment><comment><USER28> IMO, this is something tax dollars _should_ pay for. Don't use tax money to spy on citizens, use it to spy on members of congress so they have incentive to behave in a less corrupt way. I personally don't mind that elected officials should have to transparently have their lives monitored. If I was an elected official, I wouldn't mind either. I'd rather it be the reason I was voted into office in the first place.

If members of the legislative branch are transparently spied on by another branch (in this case executive) of the government, it should keep corruption down, no?

</comment><comment><USER29> I hope they strongly deny any spying, only to be burnt on the next morning by yet another leaked slide.

</comment><comment><USER30> How many senators and congressman (conservative republicans in particular) are thinking "oh shit, i hope grindr uses eliptic curve crypto" right now?

</comment><comment><USER31> I'm pretty sure they keep an eye on representatives that are involved in acts of treason, such as questioning or attempting to restrict the NSA.

</comment><comment><USER32> This result of this should be interesting.

</comment><comment><USER33> I can't help but feel that this is fake outrage, given for example, this writeup of a 60 minutes interview ... from the year 2000: [http://www.cbsnews.com/news/ex-snoop-confirms-echelon- networ...](http://www.cbsnews.com/news/ex-snoop-confirms-echelon-network/)

"America politicians may also have been eavesdropped on, says Margaret Newsham, a woman who worked at Menwith Hill in England, the NSA's largest spy station. She says she was shocked to hear the voice of U.S. Sen. Strom Thurmond (R.-S.C.) on a surveillance headset about 20 years ago."

<comment><USER34> I thought of this too!

This is why the question is such a good one. When 'Snowden's grandmother' tried to out them on exactly this minor detail of spying on a congressman she did not provide any primary first hand evidence, e.g. a tape recording. It was her word against the NSA's. Obviously we believe her, or at least we do now!

So when the NSA say they have never spied on anyone in congress, they will have to carefully craft their lie. I can't wait for it!

</comment></comment><comment><USER35> Uhh duh? Can't have those closest to you acting up..

</comment><comment><USER36> Obviously they do. What kind of naive child would ask this question?

<comment><USER26> A child trying to draw out perjury in the same way that a prosecutor might.</comment></comment>


Ask HN: Website Terms of Use - Best/First Practices? - <AUTHOR>

I'm about to launch a web app, closed alpha testing just for a few friends at first.  I'm curious as to how others set up their terms of use.  Is it almost time for me to hire a lawyer?<p>Also - does anyone know why Facebook need their users to be at least 13 years old?  Is this some kind of standard to which a typical site would need to adhere? <comment><USER2> If you're just doing something standard, it is not worth spending your money on a boilerplate ToS.

<http://news.ycombinator.com/item?id=37112> <http://news.ycombinator.com/item?id=48910>

For the age 13 thing, I believe it is holdover from when this law was in effect: <http://en.wikipedia.org/wiki/Child_Online_Protection_Act>.

Edit: Actually, the 13 thing is still in effect, it's this similarly named act. [http://en.wikipedia.org/wiki/Children%27s_Online_Privacy_Pro...](http://en.wikipedia.org/wiki/Children%27s_Online_Privacy_Protection_Act)

</comment><comment><AUTHOR> Thanks for the quick and helpful reply!</comment>


Ask HN: Recommended visualization software? - <AUTHOR>

Can anyone recommend inexpensive (or free) visualization software like iRise? Or some program that can help non-programmers create flows and business logic for websites mock-ups? <comment><USER2> <http://www.balsamiq.com/products/mockups></comment>


Show HN: My windows phone app for 30tolaunch, On This Day... - <AUTHOR> http://www.windowsphone.com/en-US/apps/cef00dc2-697f-4f1a-9107-396cd98ed591

<comment><AUTHOR> I learned how to program windows phone and submitted my app On This Day... Please take a look and let me know what you think.

It turned out to be a very pleasant programming experience, I highly recommend anyone to try out writing a win phone app.

Even better, Nokia sent me a new Lumia 800, totally worth the effort.

<comment><USER2> If I had a windows phone I'd totally check it out. The screens looks nice and concise tho, very mango style; how much of that layout/flow do you get 'for free' when developing for WP? And... how did you get Nokia to hand you a Lumia?</comment></comment>


Unmasking Northrop Grumman's XRQ-72A - <AUTHOR> https://www.thedrive.com/the-war-zone/32807/exclusive-unmasking-northrop-grummans-xrq-72a-great-horned-owl-spy-drone <comment><USER2> I'm willing to bet the name "Great Horned Owl" was purposeful for a vehicle where quiet is a priority. Owls have feathers which make them essentially silent in flight.

[https://www.youtube.com/watch?v=d_FEaFgJyfA](https://www.youtube.com/watch?v=d_FEaFgJyfA)

<comment><USER3> An owl still emits more acoustic energy per kilo-mile than a passenger jet.

<comment><USER4> That's just a variant of the square-cube law. An owl the size of a passenger jet wouldn't.

<comment><USER5> Let's all just be thankful that there are no owls the size of passenger jets.

<comment><USER6> That's, again, the same law. It would break under its own weight.

</comment></comment></comment></comment></comment><comment><USER7> It looks like the flying wing! [https://en.wikipedia.org/wiki/Northrop_YB-49](https://en.wikipedia.org/wiki/Northrop_YB-49)

My grandpa worked on drones for Northrup from the late 60s to the late 80s, and he loved the flying wing design (not used on his drone though). He built op-amp based control systems, and flew jet drones with oscillators and large portable field plotters.

<comment><USER8> Inspired by the captured WW2 German flying wing, no doubt.

<comment><USER9> The idea of a flying wing predates WWII.

[https://www.airforcemag.com/article/jack-northrop-and-the- fl...](https://www.airforcemag.com/article/jack-northrop-and-the-flying-wing/)

</comment></comment></comment><comment><USER10> Fascinating new (to me) stuff here...

"The resulting XRQ-72A has a general planform reminiscent of other Northrop Grumman designs, including that of the B-21 Raider stealth bomber"

You mean "platform"? Nope! It really does have a similar planform, a word I last heard in what, high school drafting/CAD? You mean "B-2" bomber? Nope, I just hadn't heard about it...

Also interesting that it has no landing gear and uses a fuel generator to power electric engines...

<comment><USER11> Planform is a syonum for shape, usually as viewed from above.

</comment></comment><comment><USER12> I wonder about the radar profile of those ducted fans. Why stick them on a stealthy airframe? Curious - what is the radar reflection of plastic? Is it feasible to use modern plastics along with a hydraulic drive system? Would avoiding metal(i.e. copper coils in electric motors, metal fan blades, etc) keep the external fans from producing a radar reflection?

<comment><USER13> I came here to say the same thing. Why would you bother going to the trouble of designing a stealthy aircraft if you're going to plop a load of decidedly unstealthy motors on the top of it. Really bizarre decision.

<comment><USER14> What makes you think they're unstealthy? I doubt there's even a tiny bit of metal in them. If they're made out of Teflon, PVC, and exotic composites, they'll have barely any radar return.

They're just propulsors. The motor is inside the airframe.

</comment></comment></comment><comment><USER15> > A pair of fuel-powered generators inside the central fuselage produce the > electricity that powers four ducted fan propulsors mounted on top of the > aircraft's flying-wing fuselage.

Is this efficient?

<comment><USER16> I think it's meant to have a low heat signature, so efficiency was probably part of the consideration (less heat to shed).

<comment><USER17> Reminds me of E.E. "Doc" Smith's diesel-powered stealth spaceship in _First Lensmen_ (1950)

[https://gutenberg.ca/ebooks/smithee-firstlensman/smithee- fir...](https://gutenberg.ca/ebooks/smithee-firstlensman/smithee- firstlensman-00-h.html#chapter12)

</comment></comment></comment><comment><USER18> I live near an airport. It would be nice if this quiet first approach was taken on by passenger aviation. All I can see at the moment is gradual improvement in noise performance being countered by increased traffic. A stepwise improvement would be most welcome.

<comment><USER19> I've wondered why catapult designs haven't been studied for airports, since they're used frequently for launching fighter jets from aircraft carriers.

It would cut down on fuel consumption, emissions and noise when taking off.

<comment><USER20> Do catapults on aircraft carriers cut down noise and fuel consumption? No because you still run the engines at max.

<comment><USER21> Ostensibly over a shorter period of time though.

<comment><USER22> Not at all, planes keep full afterburner until they reach a safe speed and level (varies by aircraft) and most planes are refueled again after the take off. The catapult just enables them to take off with serious costs for the pilot, plane and energy.

</comment></comment></comment></comment></comment><comment><USER23> I wonder what's the rationale behind releasing this information to the public ...

I understand when they release info about weapons, to let your enemies know what you're capable of or to just sell the tech to foreign customers.

But this thing is a surveillance drone that probably will never be sold, wouldn't it be better to keep it fully secret ?

<comment><USER10> It might be aimed at impressing and retaining investors, perhaps even with some urgency. From Motley Fool, discussing defense companies including Northrop Grumman:

"Assuming these companies avail themselves of the [USG's COVID-19] aid, therefore, it could be a good long while before investors can expect to receive any dividend income from them. That probably doesn't seem like such a big deal to investors in Textron, which only has a 0.3% dividend yield. But for shareholders in Northrop Grumman (with an 1.8% yield) or General Dynamics (3.6% yield), it could be a much more significant factor in your decision to buy or sell."

Also I do wonder just how secret this tech is. The shape has a stealthy look but other than that?

Anyway just some thoughts.</comment></comment>


Introducing Authgasm: "Rails authentication done right". - <AUTHOR> http://www.binarylogic.com/2008/10/25/authgasm-released-rails-authentication-done-right

<comment><USER2> _Sigh_. Just what we needed; another authentication plugin... that uses crackable salted SHA256 to store web passwords. Of course, it provides a plugin interface --- including, inexplicably, support for symmetrically (ie, recoverably) encrypting passwords. What it doesn't do is support bcrypt-ruby, which is _the only correct answer to this problem_.

<comment><USER3> You would know better than me and almost certainly keep more in tune with the cutting edge on this but how easy is it exactly to crack a salted SHA256 password?

<comment><USER2> You want your authentication hash to be slow. Password tests are never in your 80/20 performance hot spot. The faster a single password test is, the faster it is to run an entire dictionary through that test function looking for a matching hash.

SHA256 is slower than SHA1, which is slower than MD5. But in the grand scheme of things, SHA256 is fast. It's designed to be fast --- fast enough to run on a per-packet basis in secure network protocols.

Bcrypt is designed to be slow. So is "stretched" SHA256, which is simply SHA256 iterated thousands of times. Both these schemes are much harder to crack than simply hashing a password with SHA256.

The trouble I have here is that authentication is one part of your application you don't want to mess around with, but already someone here said "I'm going to try this just because the name is awesome". Forget the cosmetics. There's only one right answer to this problem.

<comment><USER4> I did a bit of looking into bcrypt-ruby after hearing about it here. It sounds good, I like the idea of the "cost" attribute.

However, I note that Coda Hale appears to have no interest in supporting his bcrypt-ruby gem for Windows. On his blog he says essentially that he doesn't use Windows and hence has no motivation to put any time into getting a pre- compiled bcrypt-ruby to work on Windows.

I can totally understand where he's coming from and as I do all my dev work on Debian Linux, it's not a problem for me personally. But my partner is a Windows user and it would be a problem for him.

The closest I have found to instructions on getting bcrypt-ruby compiled on Windows are from the bcrypt-ruby README:

 _You'll need a working compiler. (Win32 folks should use Cygwin or um, something else.)_

So does this mean that my partner would then have to use the Cygwin environment for all his dev work from this point on?

And a random comment from Coda Hale's blog:

 _bcrypt seems to work with the Windows One-Click-Installer too. It was easy to compile it with MinGW (I just had to define the missing types u_int8_t, u_int16_t, and u_int32_t). All your tests pass. So you might consider to offer a precompiled version for us Windows users._

I am not a C programmer (getting more experience with a compiled language is on my todo list, just no time as yet) nor am I a security expert. My past experience with compiling stuff basically extends to typing "make" and "make install". I don't really understand what "I just had to define the missing types u_int8_t, u_int16_t, and u_int32_t" means.

So as much as I would like to try and incorporate bcrypt-ruby into my current Rails project, I can't really justify this added overhead of getting it to work on my partners Windows dev box with near zero support.

If anyone has more info, that would be great. But otherwise, I will - for now - be sticking with salted SHA256.

<comment><USER5> I am the creator of this plugin.

Who cares about the name. I wanted something unique that would get people's attention and return unique content when searching. I also thought it was funny. People need to lighten up a little bit if the name bothers them. It's not like I put the name "authgasm" in helpers that you have to use all over your application. It sits in your plugin dir, that's all.

Anyways, regarding encryption. You can encrypt the password any way you want. Use bcrypt-ruby if you want. It would take no time at all to set up. Checkout the acts_as_authentic documentation. You can provide your own "crypto provider" and have it do whatever you want.

Lastly, I don't use Sha256 straight up. I add in salt. So reverse lookups are out of the question. Your last option is brute force. There is no encryption / hashing algorithm that is safe from brute force. Granted some might slow it down more than others, all that is doing is setting up more hurdles to jump, not 100% secure.

But I really like bcrypt, I'll look into it and maybe switch it to the default crypto provider. But, I really think for anything that is not being used in the NSA, Sha256 + salt would work just fine.

<comment><USER2> "Salt" does nothing to address the primary way passwords have been cracked for the past 20 years, which is with incremental password crackers like Crack, L0phtcrack, and John the Ripper. Your comment about "anything not being used by the NSA" is silly, and misses the point entirely. Most Rails app users will entrust those apps with horribly bad passwords; bcrypt protects those passwords, and "salted SHA256" doesn't.

If you don't understand the problem you're trying to solve with this plugin, why are you promoting it?

<comment><USER5> My comment about "anything not being used by the NSA" is not silly, it's true. Hell the NSA developed the Sha functions. I am not one to take security lightly, and salted Sha256 is not taking security lightly. I am not sure what kind of apps you write, but for 99% of the apps in the world, salted Sha256 is plenty secure. If it was as big of a problem as you said it would be highly discouraged, which it is not. The leading authentication solution in rails uses Sha1. Regardless, if you are extra paranoid, you can use any type of encryption you want with authgasm. So the argument is moot. Lastly, authgasm is not about promoting sha256, its about a style of authentication in rails. The method of encryption is just an option, which is what the crypto_provider option is all about. If you don't understand the subject which you are discussing, why are you discussing it?

I actually looked into bycrypt and it's great. But it would be silly of me to use a linux only encryption solution in a library available to the ruby public.

<comment><USER2> It really doesn't sound like you've read any of the other comments in this thread.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER6> I would be very happy if they could move in some standard user authentication into rails. Tired of the stream of plugins that become abandonware in a couple of months.

<comment><USER7> well most of the authentication plugins are only 100 lines of code or so. Even if the plugin author dies in a freak accident involving toothpicks, you should have no trouble maintaining the plugin yourself.

<comment> Frabjous-Dey Are they all pretty much the same? Is there currently a reigning/most popular plugin floating around?

</comment></comment></comment><comment><USER5> This discussion is moot since Authlogic easily supports BCrypt:

[http://www.binarylogic.com/2008/11/22/storing-nuclear- launch...](http://www.binarylogic.com/2008/11/22/storing-nuclear-launch-codes- in-your-app-enter-bcrypt-for-authlogic)

</comment><comment><USER8> I really like the name. I may try it out just because of the name.

Authgasm.

<comment><USER5> Awesome, you shouldn't even consider using a plugin / gem unless it has a good name. The same applies with books. Unless you like title / cover you shoudn't read it.</comment></comment>


Attention poker playing hackers - <AUTHOR>

I'm a wannabe on hN.
I have zero technical chops, just grand ideas.  Frankly I'm quite sick of the status quo.
my offer: as an ex-professional poker player with near 7 figures in life time winnings, I will trade you poker guidance for programming mentorship/guidance.  I'm also currently the "business guy" on a small niche product company, and you can be the judge of my business decisions I'll be open to you with.  You can bounce your ideas with me. I DO believe the startup blood runs in me.
Please be candid with me how much I can bother you, so I don't get out of line.
If you are still here, drop me a line at firstname.lastname@example.com if not, a vote up would be appreciated.  do it for Karma :) thanks
-Eric <comment><USER2> I went from knowing virtually nothing to being able to write Objective-C and having my apps in the app store in the last 6 months. It was hard and took a lot of time, but its possible.

There are enough resources out there for you to get started on your own. You can make those first steps before trying to find a mentor, and it will be way more efficient if you're at a stage where you understand and can communicate the basics. So just go ahead and get started and see where that takes you before finding a mentor. Good luck!

</comment><comment><USER3> Chances are, you're US based but if European assistance is an option then I sincerely suggest you check out <http://startuppoker.co.uk/>

There are a large number of talented developers who are keen poker fans within the UK and Ireland and I'm sure quite a few would jump at the chance to have a chat with you.</comment>


Orcas striking sailing boats in the Straits of Gibraltar - <AUTHOR> https://www.theguardian.com/environment/2020/sep/13/the-tale-of-the-killer-whales <comment><USER2> In case it gives some HNers joy, India now recognizes Orcas as non-human person [0]. India is the fourth country in the world to ban the capture and import of cetaceans for the purpose of commercial entertainment - along with Costa Rica, Hungary, and Chile. Me thinks that it is about time.

[0] [https://www.dw.com/en/dolphins-gain-unprecedented- protection...](https://www.dw.com/en/dolphins-gain-unprecedented-protection- in-india/a-16834519)

<comment><USER3> It seems backwards, to me, and I suspect it will be widely viewed as backwards in the distant future. Why a top-down approach? Countless other species are sentient like orcas are, even if they may not be quite as cognitively adept as orcas at certain tasks or quite as fortunate to receive the same amkunt of marketing and PR.

Why is this a default deny policy, with just a few exceptions for the tiny few species we feel hold the relative position of more valuable than other species? If orcas never existed, would they award their runner-up the get-out- of-kill-free card instead?

I think it should be the inverse, with extremely rigorous criteria and years of deliberation over which species to exclude, rather than which ones to include. Don't get me wrong, I prefer one over none, but it feels a little bit like Saudi Arabia finally permitting women to drive and then showering them with praise for their admirable feminist ethos.

I don't know when the day might come, but I think it's inevitable in the long run that this inverted approach will be what almost everyone does and almost everyone will be absolutely baffled and mortified that it used to be done any other way. I don't know whether or not any of us will live to see that day, but I'm prety confident it'll happen eventually.

</comment></comment><comment><USER4> Absolute shot in the dark, I have near-zero knowledge of Orca and even less about sailing...but I did notice one common link in the article. They were using autohelms. Are the ones they are using commercial ones? Are they homebrew (which is becoming more common in the raspi world)?

Could it be that the PWM motor control on the autohelm is bothering them...it could resonate down the rudder and essentially make a speaker. Once the Orca destroy the sound they seem to be leaving.

Again...total shot in the dark. Just trying to spur some thought in other directions.

<comment><USER5> On the one hand, I have a hard time imagining that noise being more bothersome than the motor of powered boats, but with a sample size of two, it fits the data as well as any other theory.

Having said that, I think the simplest explanation for targeting sailboats is simply that the orcas are less likely to be injured by the motor, and it doesn't blast deafening static when you get close to it.

<comment><USER4> It has no motor sound...but has a varying "whine". Also, when the rudder is bumped that whine is going to change due to attempting to realign...which could sound like an injured cry.

I know people younger than me complain about the pwm sound from my stepper drivers on my printers...but I cannot hear it.

</comment></comment></comment><comment><USER6> The "stressed" angle is interesting, and I appreciate it since these are experts discussing the matter.

I wonder, however, if there is something more sinister at play. Orcas are very intelligent animals. Is there a chance that they knocked a lone sailor off of a boat once and found a new food source? What if they're trying to replicate previous success? The entire pod could have learned this behavior.

Orcas are known to eat large terrestrial mammals. The fact that we don't have a documented case of them eating humans doesn't mean it can't or hasn't happened.

These are the bears and lions of the sea. Except they're even smarter.

I wouldn't want to be in a small boat or kayak near orcas.

<comment><USER7> From the article:

> "I've seen them look at boats hauling fish. I think they know that humans > are somehow related to the scarcity of food"

If they are really that smart, they would be smart enough to figure out humans are made of food too, right? Some orca at some point in time would've realized it and eaten a human, yet that hasn't happened.

Hear me out: what if they don't kill us out of self preservation? They see the fishing boats, the harpoons. They even see the gigantic war ships, and are probably smart enough to realize that those are linked. Would we attract the ire of a species that is much more advanced than ours if it was just harvesting resources? Not until we're almost dead from starvation.

<comment><USER5> They don't attack us because it would waste calories and risk injury in exchange for nothing.

<comment> rv-de They specifically remove the liver of sharks and ignore the rest ... they could do that with humans, too.

<comment><USER8> A great white shark's liver is huge, heavy, and oily. I'm not sure an orca could physically even accomplish the task of separating out a human liver and if it did, it sure wouldn't be satisfying.

</comment></comment></comment></comment></comment><comment><USER5> I think these are attacks by a population that's starving to death, surrounded by deafening noise (and remember, their primary sense is hearing) and poisoned by heavy metals accumulating in the food chain. I think they understand that humans and boats are responsible for the stress they're experiencing, and are attacking smaller boats that they think they can sink in desperation or anger, similar to how Tilikum snapped one day and killed Dawn Brancheau.

The southern residents of the Pacific Northwest are the most studied population of wild of orcas in the world (actually, they're probably the most studied population of wild mammals). They seem to have a lot of similarities to the Gibraltar orcas- both seem to eat fish exclusively, and in fact heavily specialize in one large fish species (Chinook salmon for the southern residents, bluefin tuna for the Gibraltar orcas). Both populations appear heavily stressed due to human activity, especially food loss due to fishing, and both have experienced a crash in successful pregnancies. In the southern residents, two years ago this led to Talequah making news by carrying her dead calf for two weeks over hundreds of miles, seemingly in mourning. I think these attacks are also basically emotional and based on a correct general understanding of how boats are affecting them, and not especially different from what humans would do in a similar situation.

<comment><USER9> In your first paragraph, you might be humanising the beasts quite too much.

<comment><USER10> Orcas are known to be highly intelligent and are also known to be able to operate on a pretty decent level of thinking. Seeing boats take your food while you starve is not a difficult conclusion to draw that the boats are total assholes who need to be taught a lesson.

<comment><USER11> Why are humans that catch the food they need to survive total assholes, but the oracs who need to catch the food they need to survive are not total assholes?

<comment><USER12> if orcas were successfully depriving us of food rather than the other way around, we would view them as assholes

</comment></comment></comment></comment></comment><comment><USER13> On TikTok I saw a man drop is cellphone into the water. A watching Beluga promptly swam over, picked up in his mouth and delivered to him. It was amazing.

The animal clearly saw the man drop the item, but also seemed to be aware of the man's inability to fetch it, and that perhaps it was a 'possession' of some kind.

It seems _ver reasonable_ to me that mammals have emotions, memories, and rational emotional response. If they were 'hurt' by a boat it seems super rational to me that they would be angered by or dislike boats. I suspect they are aware 'boats do fishing' and can directly correlate their hunger to the boats.

I don't know why this isn't the first response, and is considered 'unscientific' in the article.

<comment><USER5> Assuming you're taking about a Beluga in Norway, that whale was likely trained by the Russian military to do something vaguely similar.

</comment></comment><comment><USER14> The article offers some anecdotes, but nothing to support the claim that attacks have been "unusual" in the past or are increasing in number. There's no sense of whether this is still an isolated problem, whether it has exploded in recent years, or whether there's anything that connects these attacks with attacks in other places.

Local coast guards might keep track of this sort of information. But there's nothing about that one way or the other in the article.

Without some quantitative handle, it's impossible to even know whether something unusual is happening here.

<comment><USER15> > Without some quantitative handle, it's impossible to even know whether > something unusual is happening here.

Do you need a number? A chart?

It's right there on the page. We're up to from "several" from "never". That's an astounding change in a rapid time.

<comment><USER16> > "several" from "never"

TFA: In 1972 the Robertson family from Staffordshire were shipwrecked off the Galapagos Islands after an orca strike (their book, Survive the Savage Sea became a classic).

</comment></comment></comment><comment><USER17> I have a theory - that they know we're taking too much fish out of the seas and they want us to stop.

</comment><comment><USER18> They are probably orca-hestrated attacks...

<comment><USER19> It takes guts to go for such a stretched auditory pun via text, kudos to you

</comment></comment><comment><USER20> I believe there was a story some years ago about a sail boat in the pacific, about a day's sail from the Panama Canal that was broken up by a pod of killer whales.

</comment><comment><USER21> Covid-19

It's causing aassive amount of shark deaths in Australia -

[https://taronga.org.au/conservation-and- science/australian-s...](https://taronga.org.au/conservation-and- science/australian-shark-attack-file)

This is assuming it's this year this orca phenomenon is happening.

Not sure why.

I'd start by at looking at engine noise no longer scaring off these predators.

</comment><comment><USER22> I've read stories of whales attacking boats before, and theories about they being bothered by the boat's sonar.

</comment><comment><USER23> Crazy, this popped up in my YouTube subscriptions two days ago.

[https://youtu.be/pgPfkqQcIZs](https://youtu.be/pgPfkqQcIZs)

They do seem to know what they're doing by going after rudders and keels. And they seem to take off when they have accomplished their objective.

</comment><comment><USER24> >This tiny population's presence is of huge importance, and if human activity is affecting their behaviour, human activity must be regulated.

This is thrown in at the end. Why is the presence of 30-50 adult orca distributed over 5 pods in this particular part of the ocean of huge importance?

<comment><USER25> Apex predators are always of huge importance..

[https://en.m.wikipedia.org/wiki/Trophic_cascade](https://en.m.wikipedia.org/wiki/Trophic_cascade)

<comment><USER24> I'll read through that article but since the article discusses a general dynamic it's fair to reason about whether and to what extent that dynamic is in play in a given particular context . It seems that the point of 'contention' here is food scarcity and competition for Tuna, and it seems the orca are losing the point and either the humans have acquired the role of apex predator in that particular part of the ocean or at the least the orcas' services as such are no longer required.

It may be that reading this article will provide the wherewithal to answer this question but perhaps there's someone here who understands the particulars and can shed some light.

</comment></comment></comment><comment><USER26> Seems mind-boggling to me that the article mentions, but makes no comment whatsoever on, the fact that in every case the boat was turned around. Like not just turned, but turned 180 degrees or close to it. Just in case you've been locked in a geometry classroom since birth, 180º is what we out here might refer to as "back the way you came." Orcas be like: "Hey, nice to see you, welcome to our feeding area, too bad you can't stay, here's your coat & hat, don't let the door hit you etc etc!"

I certainly wouldn't want to imply in the slightest that huuu-mons are narcissistic or focused only on themselves (like "ouch the kick from the shotgun hurt my thumb" is how we might summarize a shot that ruined the lives of an entire pheasant family), but would we be sad to find out that things like "attacking us" and "scaring us", "and making us feel totally powerless by breaking our rudder," all of which figure prominently in the human experience of the encounter, don't even merit a mention in the orca newspaper article about it? Could it be that the orca newspaper article (just bear with me for chrissakes) simply says "Another Boat Found in Feeding Area" and goes on to describe how so-and-so and his crew followed procedure and first broke the rudder, which they've figured out seems to be a prerequisite for taking over steering, and then turned the intruder away?

</comment><comment><USER27> This is the first § of the article:

> _Reports of orcas striking sailing boats in the Straits of Gibraltar have > left sailors and scientists confused. Just what is causing such unusually > aggressive behaviour?_

We don't know if orcas are "stressed" or if they're having fun, or if they patiently, rationally decided to wage a war against humans on boats.

Adding "stressed" in the title is a judgment call, and a condescending one.

<comment><USER28> The rest of the article goes on to detail the collapsing population of orcas, and the reasons why.

It's not a stretch to say a population with catastrophically declining population is likely stressed.

</comment></comment><comment><USER29> Another interesting phenomenon are the sharks that destroy undersea optical cables.

</comment><comment><USER30> Sounds like the intro of The Swarm, the novel.

</comment><comment><USER31> Nature exists? Surprise, haha

</comment><comment><USER32> Gangs of Gibraltar.

</comment><comment><USER33> It begins.

</comment><comment><USER34> I see a lot of crazy speculation in these comments. Seems to me they are just attacking a competitor, something almost all animals do in some fashion. They aren't dumb but they aren't human either. They don't have our motivations.

<comment><USER35> How would you know though?

</comment></comment><comment><USER36> I wonder if there is some kind of noise generator that a small boat could carry that would repel, but not harm, enraged orcas. Maybe there's a whale equivalent of nails-on-chalkboard that would work without being loud enough to do damage or require too much energy to be practical.

If there is an attractive rather than repellent sound that would work (a calf in distress?) maybe it could lure the grampus away with a little remote control boat.

But their intelligence might make whatever does work only temporarily effective.

<comment><USER37> More than likely the noise of the boats is what is enraging the Orcas.

<comment><USER36> Except such aggressive orcas are new while boat noises aren't. And some of these incidents are with sailboats.

<comment><USER38> Not saying I give credence to the original comment about noise being the cause but most cruising sailboats have engines and in the Mediterranean they are used quite often because the wind is often not sufficient to sail. The Mediterranean is called the Med for short and there is a joke that Med actually stands for "Motor Every Day".</comment></comment></comment></comment>


The Future of Compiler Optimization - <AUTHOR> http://blog.regehr.org/archives/247 <comment><USER2> Excellent post. Aside from the very interesting and important (hence many PLDI publications) work of Sorin Lerner, there is a workshop which deals with the first point of Prof. Regehr: Compiler Optimization meets Compiler Verification, which is a satellite workshop for ETAPS. So for interested people, this might very well be the point to start digging for relevant publications.

</comment><comment><USER3> Surprisingly, compilers already do much of these optimization, particularly profile directed feedback (basically a static JIT), and the mixing of high- level and low-level optimizations.

Now while, LLVM may not do this, it's far from the only compiler on the block; especially in the non-open-source world.

The IR argument is a non-argument. Certain optimizations work better with certain IRs than others, that's just the way it is. It's unlikely that there will be one to rule them all. More likely, we'll convert between them to use the optimal one.

Superoptimizers are an interesting case, it's kind of like having a database of optimality. While it may not give much speedup compared to time invested, if you're desperate for that last little bit of performance, it's a great tool. Plus it should make itself faster over time. Could even locate it in the cloud, such that a compiler send its hottest methods over to a remote machine, and it'll use its massive database of optimality to optimize it as best as possible.

Verifiable transformations are great in theory, but it's true, it's extremely hard to implement currently.

The author definitely has a point about AOT/JIT compilers being the future of optimization. Static compilers have been done to death, while dynamic compilers are still (comparatively) new and fresh.

<comment><USER4> The interesting thing about the peephole superoptimizer paper that he linked is that the actual peephole optimization process is not necessarily slower than a regular peephole optimizer, as all it is doing is looking up faster equivalent instructions in a database.

The difficult (compute intensive) part is training the database, and you only have to do that once for each optimization...

I am a little confused by why he stated that the results of the super optimizer were not very impressive. Presumably, man-years have been invested in defining optimizations for compilers like GCC and the intel C compiler, by human experts...

To have a machine that even gets close to those results is impressive to me. If the technique were used for an actual compiler, it would mean that no one would have to write peephole optimizations, instead, the compiler would just get better and better as it ages.

Combined with aggressive in-lining (or maybe dynamic recompilation? e.x. lisp style function compilation rather than C), it seems to me that this sort of technology could be incredibly powerful. Am I wrong?

<comment><USER5> Superoptimizers are good at finding complex combinations of mini optimizations, but often optimization is finding creative solutions to lots of special cases. Machine learning does not help you with creating more mini optimizations.

</comment></comment></comment><comment><USER5> I think he emphasizes the joining of verification and optimization too much. No doubt verification may get easier, if they use the IR and all analysis info the compiler already did. SSA makes this stuff easier for example.

Just tell me what optimization could learn from verification? Everything verification does is too slow to do within a compiler. Sure, you can produce better code, if you are allowed to use NP algorithms, but in reality i have never seen any algorithm more complex than O(n^2) in a compiler. Usually O(nlogn) is the most one can afford.

<comment><USER6> Arguably, types are a form of verification, and they already lead to better optimizations.

<comment><USER5> Types were invented for optimization and used for verification later, weren't they?

</comment></comment></comment><comment><USER7> What is the most advanced compiler, across all high-level (not C/C++) languages? The GHC?

<comment><USER5> What do you mean by "most advanced"?

* LLVM is probably the Open-Source compiler which fits your intention most.

* GCC has man-years of efforts for little bit/byte tweaks, which no other compiler does. This is not advanced, but tedious.

* libFirm is the only compiler which does not deconstruct SSA form. This is advanced in a mostly academic sense.

* GHC is probably the best functional (CPS) compiler.

* Sun JVM is probably the best Hotspot (online) compiler.

* I'm not sure which compiler is "most advanced" for dynamically typed code. Some Smalltalk or Javascript compiler? PyPy?

<comment><USER2> I think at least worth mentioning in this list is the milepost project:

* <http://ctuning.org/wiki/index.php/CTools:MilepostGCC>

Smalltalk JITs are pretty darn good, e.g., the Strongtalk project is known to be pretty fast. As of 2006, Sun released the Strongtalk source code. Its publication record is relatively weak (aside of type system related publications), but it contains a wealth of relevant optimizations and I am sure the interested reader/programmer will find something valuable in there. (<http://www.strongtalk.org>)

Eliot Miranda has been implementing Smalltalk VMs for quite a while, and I think his recent addition ("Cog") to the Squeak implementation is probably the most recent addition to JIT compilers for Smalltalk VMs. Given his in-depth experience and expertise (particularly with inline caching), this could probably serve as a blueprint for other (Smalltalk) JITs.

V8 for Javascript is supposedly very fast (interesting side information: Robert Griesemer is working on V8, but worked on the Strongtalk interpreter before), but I don't know about the involved benchmarks, and how they stack up against each other--particularly since the TraceMonkey trace-based JITs came along.

Mike Pall's LuaJIT is a very interesting project (only one-man JIT project I know of), too.

PS: I am sorry for the overly long post...

<comment><USER5> Milepost Gcc is interesting. Regehr does not believe in it, though: "machine learning in compilers will not end up being fundamental."

His argumentation is flawed though. He says "I could always get a good optimization result by running all of my optimization passes until a fixpoint is reached," but unfortunately there is no such fixpoint. Many optimizations reverse each other (e.g. loop fusion vs loop spitting) or just arbitrarily choose some normalization (e.g. 2*x vs x+x vs x<<1).

You can build a superoptimizer, which constructs all variations (e.g. equality saturation <http://portal.acm.org/citation.cfm?doid=1480881.1480915>), though this is no fixpoint search, but an optimization problem to choose the least cost alternative. You can not construct all variations anyway. For a simple example consider loop unrolling an infinite loop.

Hence, unlike Regehr I would not devalue machine learning. I would not bet on it either, though. ;)</comment></comment></comment></comment>


How to Implement Email Confirmation in Laravel - taha-sh http://taha-sh.com/blog/how-to-implement-email-confirmation-in-laravel <comment><AUTHOR> Obligatory "use HMAC over random tokens": [https://neosmart.net/blog/2015/using-hmac-signatures-to- avoi...](https://neosmart.net/blog/2015/using-hmac-signatures-to-avoid- database-writes/)</comment>


Ask HN: How do you handle auto renew for SaaS? - <AUTHOR>

If you have an SaaS product (or any product with recurring billing), what is your auto renew policy? Obviously not all forms of payment support it, but for the ones that do, how do you ask the customer if he wants? The options as I see them:<p>- Checkbox at signup, checked by default<p>- Checkbox at signup, not checked by default<p>- Auto opt in, with a note at signup, and an opt-out in client dashboard<p>- No auto billing <comment><USER2> You prominently disclose that it is priced on a monthly basis and then charge your customers as agreed. Very rarely, a customer will be very surprised that SaaS which is priced on a monthly basis means that they will be billed a second time in the second month. You will apologize to them for the confusion and ask whether they'd prefer a refund or your software.

This question suggests you may not be psychologically OK with taking people's money, since approximately every SaaS handles this identically, without drama, in a fashion which doesn't even seem to be in your solution set. You run a business. I would counsel coming to the realization that, if you're providing value to people, it is in fact OK to take their money.

<comment><AUTHOR> I am perfectly okay with taking people's money. In fact, in the past I managed $20,000 of monthly recurring revenue. In that case, it was set to auto bill. However, I found that many customers, rather than coming to the site or emailing support to cancel, would simply submit a chargeback on their credit card. Obviously that did not stop recurring billing, so then they would submit another chargeback the next month. Sometimes this was compounded by the fact the credit card was also stolen.

The problem was likely due to cancellation requiring an email to support, rather than a way to do it on the site. That business was selling proxies to SEO people. I eventually let it whither because 1) I was not happy with my customer base's use of the product, and 2) chargebacks got out of control due to the above fact, combined with fraud. At one point it had a chargeback rate of 14%, and close to half of those were stolen credit cards. I'm now starting a VPN business, which will face many of the same problems, so I'm merely wondering the best way to mitigate this one particular reason for chargebacks.

<comment><USER3> > rather than coming to the site or emailing support to > cancel, would simply > submit a chargeback on their credit > card. Obviously that did not stop > recurring billing

Why not? If I receive information that a payment has been stopped, I deactivate their account and send them an email that their subscription has been canceled. Unless the customer sends a new payment, the account stays deactivated and I make a +1 under "Lost Customers".

<comment><AUTHOR> The short answer is that the payment system I was using at the time had no easy way to do this programmatically. Remember, a chargeback is not a missed payment. I would receive the payment on time, and then some arbitrary 15-20 days later I would get a paper envelope in the mail notifying of a chargeback with last four credit card numbers XXXX. It was a mess.

But yeah, all these are good points and also reasons I shut down the business. This time around I can apply all these lessons learned.

<comment><USER3> > This time around I can apply all these lessons learned.

Good luck. :-)

</comment></comment></comment></comment></comment><comment><USER4> This is how I handled it. As for auto renew, I have it where all saas subscriptions by default are auto-renew.

1) On credit card submit, I had a checkbox at sign-up NOT checked by default. Also right next to it was a link to the terms of service they can read.

2) On billing confirmation e-mails, I put a link where they can change their plan or cancel.

Now here are a couple particular scenarios I've handled

\+ Several customers called in the second month being very surprised they got charged as they thought it was a one time fee and not a saas subscription. In both cases, they e-mailed or called me directly. I told them I could refund their last month's charge and cancel their account.

\+ I had one chargeback, but it was a generally unhappy customer. I let that chargeback go through, and e-mailed the client apologizing and mentioning I would not challenge the chargeback.

\---Chargebacks Now in the general case of chargebacks, you can defend against them (I use Braintree Payments who have been awesome in guiding me through the process), if you generally do the following

1) State exactly what your refund policy is in your tos. For me, I have a 'we refund your last month for any reason'.

2) Keep track of your billing e-mails. If the client files a chargeback, the bank will check to see if the payment has been monthly. If the bank sees it is a monthly bill, there is a very low chance of them winning the chargeback.

tldr; Make your tos policies as transparent as possible.

</comment><comment><USER5> Having sold two different SaaS products over the last few years, I would do a couple of things.

Make it clear on the website. $20.00/user per month. To most people, that is clear that they will be charged each month that price.

In addition to that, in your terms & conditions, you can explain the exact details of the terms.

Depending on the price of the product, I wouldn't waste too much space on the website explaining that they will be auto-renewed as it should be self explanatory and it could cause confusion.

Also, do you have a sales team or do you rely on people to just sign up on the website?

</comment><comment><USER6> You should try this as a poll: [https://news.ycombinator.com/newpoll](https://news.ycombinator.com/newpoll)</comment>


Ask HN: I want to build my own Android phone. Where do I start? - <AUTHOR>

I want to build my own phone at home. As a kid, I remember building my own PC from a kit (or going to Fry's). Where do I even start if I want to build a phone? Forget about form factor, it won't be sleek or tiny. Where do I get drivers and silicon? Has anyone seen any good books or manuals on the topic? <comment><USER2> Qualcomm seems to have some nice 3G products that are supposedly compatible with Android. Some drivers are included with Android, but you may need to write some of your own.

But seriously, you don't just walk into Mordor, nor do you just build a phone. Building a basic 2G phone that does only voice and nothing else probably would be doable by a hobbyist, but building modern 3G phone capable of running Android is waaay harder. And a lot more expensive too. I'd be surprised if you can actually get your hands on 3G chips without buying thousands of them.

</comment><comment><USER3> This is where I would go when I build my own phone. Wrap it in metal with a hinge to mimic a standard flip phone.

<http://www.opencellphone.org>

</comment><comment><USER4> <http://hbmobile.org/>

</comment><comment><USER5> I believe the Neo FreeRunner can run Android: <http://wiki.openmoko.org/wiki/Neo_FreeRunner_GTA02_Hardware>

I'd suggest you start with some sort of kit unless you're a real whiz. It's not a small project.

</comment><comment><USER6> I'd probably start with phone components from Bug Labs: <http://www.buglabs.net/products>

Maybe start off with some of their modules for a base phone and hang out on their forums for a while.</comment>


Terminal Server on a Budget - <AUTHOR> https://blog.lasseter.org/posts/2020/07/terminal-server-on-a-budget/ <comment><USER2> > I no longer have that box of serial adaptors and my wife somehow can't > remember where it went since we got maried.

I used to have a glorious box of ram, spare drives, and every cable and adapter imaginable.

My box also mysteriously disappeared some time after I got married. I feel your pain :)

<comment><USER3> Sounds like some serious boundary-crossing behaviour; have you ever discussed that with your spouse? Did some of their stuff "disappear" as well?

I'm just saying, this is not normal or acceptable behaviour.

<comment><USER4> Did I just teleport into /r/relationship_advice?

</comment></comment></comment><comment><USER5> > One small disadvantage not addressed is that neither of the two motherboards > support BIOS access via COM1, which is a bummer.

I've always wondered if you could burn SGABIOS ([https://code.google.com/archive/p/sgabios/](https://code.google.com/archive/p/sgabios/)) to a PCI(e) card ROM to get this working on real hardware instead of just in QEMU.

Apparently someone did try this, so it might just work: [https://www.flashrom.org/User:GNUtoo/Howto_flash_sgabios_on_...](https://www.flashrom.org/User:GNUtoo/Howto_flash_sgabios_on_an_Nvidia_video_card)

Maybe I should dig up some old flashrom supported NIC card or something.

</comment><comment><USER6> We are searching for a new serial to ethernet solution which is not as expensive as most B2B products. Right now this [1] would be our dream product. We are also looking into a combination of a mini-pc (like PC-Engines [2]) with two of these miniPCIe serial cards [3].

If you have better recommendations feel free to share them :)

[1] [https://freetserv.github.io/](https://freetserv.github.io/) [2] [https://www.pcengines.ch/apu2c2.htm](https://www.pcengines.ch/apu2c2.htm) [3] [https://www.delock.de/produkte/G_95244/merkmale.html](https://www.delock.de/produkte/G_95244/merkmale.html)

<comment><USER7> Old multi-port serial consoles can often be found used quite cheap.

Personally, I'm a big fan of the OpenGear units. They're *much^ more than just basic serial consoles and are quite extendable. You can even write your own scripts to interact with them, trigger them on specific events, and so on.

<comment><USER8> Yeah +1 for OpenGear console servers, I've used them for years. Looks like there are some bargains to be had on ebay, I see a 32 port one for $150...

</comment></comment></comment><comment><USER9> Interesting but why not a kvm rack unit from ebay? Cheaper and easier only issue is most vendors stop supporting the switches and the software on them can be complete garbage (only works with firefox version x or IE version y).

<comment> matt-attack Yeah everyone I've used requires java in the browser. Feels like 1998.

<comment><USER9> Later avocents have a sort of usable HTML5 implementation. It would be nice if there was something like OpenWRT for kvm switches

</comment></comment></comment><comment><USER7> "conserver" (which the author is hsing) is really handy for quickly and easily accessing and/or monitoring the (serial) console of not just physical machines (like the author is doing) but also virtual machines as well.

I've used it with virtual machines running on both vSphere and QEMU/KVM to make their serial consoles available over the network... to access the serial console you can just connect to the corresponding TCP port. Just make sure to lock down / restrict access appropriately and ensure you don't send sensitive info over the network in clear-text!

It works the same way with physical devices too (Cisco devices, primarily). It's great when you want to a "permanent record" (on disk) of any output that is sent to the console.

As mentioned, it's really nice when you need to provide "shared" console access and/or access to multiple devices and/or users simultaneously. It's really an under-rated tool.

</comment><comment><USER10> > _more than a few times I have gotten into a situation where I have attempted > to preform a system update on one of the pair remotely from cafe or sofa and > the PC failed to come back up after a reboot._

This happened to me as well. In fact it happened so often that I took all of the critical network software off the home server and run it on an edge router-x.

Also, setting "power on after power loss" and running the computer through a smart plug is a good idea. When it gets jammed, you can at least power cycle it remotely and it _attempts_ to reboot.

</comment><comment><USER11> Why not use a Raspberry Pi populated with several USB to console adaptors, there are USB console cables with up to four serial ports per connection which would result in 16 console ports per Pi.

</comment><comment><USER12> Note: Some server motherboards also have a setting in the BIOS to show boot- time text, and allow BIOS configuration, on a serial port.

<comment><USER13> Not only server. If you have a Q-series desktop motherboard with AMT you can enable Serial-Over-Lan and access the machine remotely (and power on/off or reset it as well). Q series chipsets are also found on Fujitsu/Dell/HP prebuilts which can be picked up quite cheaply when companies decide to upgrade. For servers you usually have IPMI/iDrac etc. which uses more power, but usually has a better (web)interface.

<comment><USER14> Yep. I've just picked up a few second hand HP EliteDesk 800 G2 desktops with the intention of turning them into a homelab for k8s learning. They have AMT and the web power control, VNC based KVM and SoL work well.

There is no BIOS serial redirection, so SoL is no use until the OS starts booting, and grub has a bug[0][1][2] which means it can't find the AMT SoL when booting in EFI mode. But SoL works fine as soon as the kernel starts, and the KVM VNC works fine during BIOS and GRUB if I have an emergency.

One gotcha which would catch someone out who wasn't expecting it - the onboard video disables itself when no monitor is connected, so the AMT KVM just shows a black screen. This can be solved by DisplayPort or VGA "ghost" dongle in the back of the machine to talk EDID and pretend to be a screen.

I'm a big fan of conserver, and intend to use it in this project to spawn amtterm processes to connect to the SoL ports.

0: [https://savannah.gnu.org/bugs/?42026](https://savannah.gnu.org/bugs/?42026)

1: [https://community.intel.com/t5/Intel-vPro-Platform/No-AMT- se...](https://community.intel.com/t5/Intel-vPro-Platform/No-AMT-serial-port- in-Linux-grub2/td-p/720528)

2: [https://wiki.networksecuritytoolkit.org/index.php/HowTo_Head...](https://wiki.networksecuritytoolkit.org/index.php/HowTo_Headless_Intel_NUC_vPro_AMT#AMT_Serial_Port)

</comment></comment></comment><comment><USER15> Maybe I missed it, but what device is on the other end of the COM connection? His router?

What's the reason against SSH'ing from the gateway to the servers instead of the physical COM connection?

<comment><USER7> > _Maybe I missed it, but what device is on the other end of the COM > connection? His router?_

The plan was to use a Raspberry Pi to access the two PCs (via USB-to-serial adapters), though he hasn't made it to that point yet ("I have not used it for this project yet, but it is still in my plans."). Right now, the two PCs are just connected to each other, back-to-back.

> _What 's the reason against SSH'ing from the gateway to the servers instead > of the physical COM connection?_

I would assume that he _does_ just use SSH -- under normal circumstances.

It's when SSH access isn't available that access via the serial console would be used -- such as the network connection being down or b0rked, when the kernel (or required) modules failed to boot/build/load properly, a bad firewall change has locked you out, and so on. This method even provides access to the bootloader.

If your BIOS supports "console redirection" (to a serial port), you also gain access to the BIOS, can watch the startup (POST) process, or even change the boot device -- in order to fire off a kickstart installation, for example.

He mentioned that his PCs don't have ILO/DRAC/IPMI, so this is his backup solution. -- remember that his machines are headless.

</comment></comment><comment><USER16> This is super cool! I'd love to get this working for my home servers as well one day (priority number one is making them accessible outside my LAN again).

<comment><USER17> I'm currently using a Digital Ocean droplet with wireguard and my home server connects to that VPS via wireguard site-to-site. I have Nginx on the VPS and do a proxy_pass to my local services. Just set it up a week ago and works great, very simple once you understand the setup.

<comment><USER18> Wireguard requires a more complex setup than for IPSec, believe it or not.

To give my home router a static IP address, I use a Vultr VPS and pay for an additional IP address. I then use IPSec encapsulation to forward traffic for the second IP address directly to the router, which initiates the IPSec SA setup. The router has a loopback device configured with the static IP address; the routable static address is effectively local, even from the kernel's perspective. The IPSec rules handle forwarding of everything, so I don't even need packet filtering (e.g. OpenBSD PF in my case) rules.

No need to fiddle with private address ranges, NAT'ing, reverse proxying, or packet filtering of any sort. The IKEv2 setup is a single line on the VPS and a single line on the router, though OpenBSD's OpenIKED (as well as their isakmpd fork for IKEv1) is awesome that way; StrongSwan and other Linux IKE daemons require a more verbose configuration on account of their key-value pair syntax, but in any event it's still relatively simple.

<comment><USER16> Unfortunately I can't fiddle with the router I'm behind, so I think the wireguard route is the way to go. I also like the wireguard approach because as far as I can tell it should be completely portable -- if I move to be behind another router/NAT, I can just plug in my box (it's a laptop with a broken screen), run my dynamic DNS update script (I'm using DuckDNS) and I'll be off to the races, as I understand it.

<comment><USER18> I just happen to put my ISP's (Sonic's) router in passive mode and use a PC Engines APU2 running OpenBSD for NAT'ing my home network, but the same IPSec setup works even if the termination point is behind a NAT gateway. Sonic doesn't offer static IP addresses, so the VPS could never directly connect to my router unless I fiddled with dynamic DNS or scraped together some other hack, which IMO is far more hassle than it's worth. Also, I've used this exact same setup before except with the termination point inside a corporate LAN, tucked away on someone's desk. IPSec+IKE has done NAT traversal and dead peer detection for many, many years, notwithstanding that some IKE implementations have sucked at it.

Wireguard is just a better wire protocol for moving packets, but IMO it's mostly a solution in search of a problem. Most of the complexity that people disdain about IPSec actually comes from IKE, but it's largely irreducible complexity. IKE is what initiates and negotiates security associations based on abstract flow rules--in this case 0.0.0.0/0 <-> W.X.Y.Z, where the latter is the static, routable address. Wireguard doesn't diminish the need for this layer, which is why you've been forced to hack a complete solution using a reverse proxy. IKE is far more mature than the experimental additional software Wireguard developers have been cooking up to automate tasks like this (abstract flows, key management, etc), and definitely more mature than the homebrew solutions people put together.

I bring this up because I think IPSec has gotten an undeserved bad rap. If people make do with Wireguard + hacks, great, but this particular scenario is a great example that shows the strengths of IPSec+IKE and the weakness of Wireguard; a reality people don't hear about given the unabashed enthusiasm for Wireguard.

</comment></comment></comment></comment></comment><comment><USER19> A fair amount of PC's already have remote access built in, via Intel's vPro. Might be worth checking for that if you're on a budget.

</comment><comment><USER20> So, why not a KVM ?

</comment><comment><USER21> I would love be to know what the family is using the servers for.

<comment><USER22> _I run a number of services in my home covering all the essentials such as media serving, DNS, local cloud, PBX, Minecraft containers, etc._

'graph 2 of TFA.

<comment><USER23> Is it really a time-savings to say that instead of "Paragraph 2 of the article"?

<comment><USER21> Ah missed that, thanks for pointing that out.

</comment></comment></comment></comment><comment><USER24> Why not use a jumpbox /ssh ?

<comment><USER25> Because when the box doesn't boot you can't ssh in.</comment></comment>