News for hackers. Stuff that matters.

chadscira

Re:Node v7.5.0 Released on Friday February 03, 2017 @11:21AM (#13560853)
Yea but when using promises with async/await its very beautiful.

    await asyncFuncOne();
    await asyncFuncTwo();
No more weird water-falling, and finally proper exception handling. The only gotcha is the fact that we cant awaits at the root of a module, and we need to wrap it in a async function.
Re:Stealing passwords from McDonald's users on Monday January 16, 2017 @01:35AM (#13408533)
If they don't have X-Frame-Options the attacker can also just use a 1x1 iframe on a popular website or shitty ad network to trigger that page to load
Re:CHVote: Open-source e-voting system from Switzerland on Wednesday December 14, 2016 @10:05AM (#13176421)
I don't know if I agree with this.

Even with paper ballot we still have to trust the people/devices counting the votes.

As an American citizen theres no website I can go to and check my vote. How do I know it was even counted, or properly registered.

Re:Show HN: ICanHazData – Data URI Swiss Army Knife on Monday November 28, 2016 @06:29PM (#13059333)
Yeah, but its a pain in the butt to iterate when doing that, especially when you just want to dump off clipboard, or drag & drop.

Also wanted an excuse to play with a few browser features :P.

Re:Show HN: ICanHazData – Data URI Swiss Army Knife on Monday November 28, 2016 @06:02PM (#13059200)
This was made to make playing with Data URI's much easier.

I find myself often needing a quick way to generate a Data URI when playing with files on jsfiddle, or codepen (due to CORS). So I thought it would be nice to have a website that locally stores those files.

This was thrown together in a couple of hours (using react/mobx), and inspired by [0] "The XSS Game By Google post". It turned out that quite a few people didn't know that you could use URI's for things that were not images.

If you have any suggestions feel free to voice them :)

- [0] https://news.ycombinator.com/item?id=13021869

Re:Show HN: Data URI Generator on Saturday November 26, 2016 @11:17PM (#13047685)
I made this because I was getting upset with the lack of a solid solution that did everything.

It locally stores the files as well, click on the hamburger menu to see them.

- drag & drop

- manual upload

- paste

- custom file creation

- local storage

Re:Cards Against Humanity is digging a hole in the earth on Saturday November 26, 2016 @11:41AM (#13044482)
Oh, awesome. Hopefully they drastically reduce it.
Re:Cards Against Humanity is digging a hole in the earth on Saturday November 26, 2016 @11:39AM (#13044469)
They are charging us too much for time!

We need the gates foundation to donate a billion, that should get us 31 years on the clock.

Re:Cards Against Humanity is digging a hole in the earth on Saturday November 26, 2016 @11:13AM (#13044323)
Awe, hey we end up with more than a empty hole! What about all of the dead code!
Re:What if jobs are not the solution but the problem? on Friday November 25, 2016 @10:37PM (#13041596)
Also those jobs wont be around that long. Every year we have quite a bit of progress on Self-Driving Cars.
Re:The XSS Game by Google on Wednesday November 23, 2016 @06:06PM (#13026514)
Seems like in chrome you can go much higher!

Here is a example of 5M

    data:text/html,<script>window.location='data:text/html,<!--'+new Array(5000001).join('a')+'!--><script>document.documentElement.innerHTML=window.location.protocol+\':\'+String(window.location).length;</'+'script>';</script>
I tried 110Mb and it actually worked as well! I'm not sure about the real limit.

You can store MASSIVE amounts of data in these things. It also seems to eventually break the url display and reverts to about:blank. It still retains protocol integrity though.

Re:The XSS Game by Google on Wednesday November 23, 2016 @11:52AM (#13023848)
I did

    data:text/javascript;base64,YWxlcnQoMSk=
I didn't know you could do stuff like this (not for XSS)

    data:text/html,<script>alert(window.location)</script>
Cool, you can store a whole website in a URL now.
Re:$15 Production Kubernetes Cluster on DigitalOcean on Monday November 21, 2016 @04:00PM (#13009174)
We currently just rent a few big boxes on OVH, and manage them via Rancher.

You should checkout ranchers channel for some videos: https://www.youtube.com/channel/UCh5Xtp82q8wjijP8npkVTBA

It's mind-blowing that they offer this for free, considering the impact it has.

Re:$15 Production Kubernetes Cluster on DigitalOcean on Monday November 21, 2016 @03:13PM (#13008724)
Because theres no perfect solution at the moment we have opted for a 4 disk setup, and mirror them all using ZFS. We also do 10 minute snapshots, and incremental snapshot backups (to S3).

Feels safe enough for our needs. Before this we didn't have 10 minute snapshots of all our data so this has actually allowed us to recover from dev errors as well (if they were to happen).

We do have our DB running in a container + mounted volumes that use the above configuration.

Re:$15 Production Kubernetes Cluster on DigitalOcean on Monday November 21, 2016 @02:55PM (#13008584)
We have been using Rancher as well... It allowed us to move away from DO and AWS. Now most of our infra is from OVH :).

It's been smooth sailing.

Because of massive costs savings we were able to just reinvest it in our own redundancy. Also 12-factor apps are pretty damn resilient.

Re:Making the Switch from Node.js to Golang on Saturday November 19, 2016 @08:15AM (#12993339)
Yep thats what it looks like.

So the take away is Go is better at handling massive amounts of open outgoing network calls.

In Node.js you want to restrict this to prevent the server from choking. If they did that I bet performance would be very similar.

Re:Making the Switch from Node.js to Golang on Saturday November 19, 2016 @06:46AM (#12993043)
I would like to know more about the implementation.

I have had node do 12000 requests a minute with no problem (on a single core). In this case they had 4 two core boxes, so they needed each one to at least perform 42 requests a second under max load.

I want to know more :)

Re:Making the Switch from Node.js to Golang on Saturday November 19, 2016 @06:37AM (#12993012)
This could have been solved with a simple addition of another queue.

Don't spawn off heavy requests without a throttle / queue, or else you will overload your single core.

We normally don't think about this because most requests are just tiny queries / small http requests.

Re:Making the Switch from Node.js to Golang on Saturday November 19, 2016 @06:09AM (#12992927)
Not really understanding the down votes (maybe the double question mark??), but oh well.

This is a valid comment considering that the EC2 instance mentioned is a 2 core box, and there is a possibly that the node implementation didn't take advantage of both cores.

- Go has multi-core support out of the box

- Node.js has to be shown a little love, and has limitations. But this would have been a great use-case for Cluster.

If the Node implementation was using all cores, then I wouldn't have asked this question. As it stands I don't really know what we are comparing even with all the graphs.

Also we are still missing a little info on how they handled the requests. When you have a endpoint on a node server that is not a simple one, it is best to queue those before handling them (yes a additional queue). This prevents the process from choking because it just opened up NNN requests to S3.

Most developers are not working with hundreds of HEAVY requests a minute, but in Node.js this usually has to be handled with care, and does not work out of the box.

But if you want to pick up a shinier hammer then Go for it.

Re:Making the Switch from Node.js to Golang on Saturday November 19, 2016 @03:24AM (#12992577)
Re:8M GitHub profiles were leaked from GeekedIn's MongoDB on Thursday November 17, 2016 @07:52PM (#12983348)
The email verification was easy when they provided gravatar ids, which used to just be MD5(email).
Re:8M GitHub profiles were leaked from GeekedIn's MongoDB on Thursday November 17, 2016 @03:44PM (#12981339)
Doesn't github already make majority of this data public? With the exception of emails... Previously they used gravatar hashes which allowed email brute forcing (since removed). Then they also were not omitting emails from commit messages.

https://cloud.google.com/bigquery/public-data/github

Re:React 15.4 on Wednesday November 16, 2016 @03:51PM (#12971365)
We also should remember that most react apps are single page apps, and usually this .js file is aggressively cached on a CDN. Most interactions are close to instant.

Server-side rendering fixes the issue of time to first pixel. I think we don't really need to worry about a 10KB bump, especially considering how many websites are serving ads to mobile which are sending over MUCH MORE DATA.

I have been traveling around to many 3rd world countries, and when I hit a website thats loading a little slow you know what I do? I wait for it to finish loading, or I refresh. One of the biggest things a site can do to improve speed is picking a good CDN (Cloudflare).

Re:Show HN: Sorting 50K Array, HTML5 Web Worker Demo on Friday October 28, 2016 @09:56PM (#12822205)
Its not just something me, and you disagree on. I would say it's me, plus a good amount of other, and also most browsers.

If the browser is locked over X seconds it will actually tell you that the script is unresponsive, and ask if it should stop it. But you can of course work around this, and disable it in your browser of choice (http://www.reginout.com/nflp/fix-unresponsive-script-error-i...). Or you could just use a webworker, and not lock the UI.

Re:Show HN: Sorting 50K Array, HTML5 Web Worker Demo on Friday October 28, 2016 @12:09PM (#12817506)
Good catch.

From my experience though there is a small overhead in terms of workers, also the message cost. But still even if it was 300% slower it's justified because it is unacceptable to lock the browser.

Too many commenters here are coming from the backend, or desktop software where they already have a UI thread. I ask these commenters a simple question, when is the last time you saw your browser freeze? If that doesn't happen often then the devs are doing many things like this to keep that experience enjoyable. Web is it own kind of beast in terms of development, the biggest concern is perceived responsiveness. We get to write off async delays when using webworkers (and similar methods) because users are already used to network requests taking time.

Re:Show HN: Sorting 50K Array, HTML5 Web Worker Demo on Friday October 28, 2016 @11:05AM (#12816567)
Life before WebWorkers was fun :). Another way was to create multiple iframes, and use a form of hacky message passing to use more cores, but i think this may have depended on the browser implementation.
Re:Show HN: Sorting 50K Array, HTML5 Web Worker Demo on Friday October 28, 2016 @10:50AM (#12816439)
In response to your last comment, you should check out https://github.com/icodeforlove/task.js. It will do that and much more.
Re:Show HN: Sorting 50K Array, HTML5 Web Worker Demo on Friday October 28, 2016 @10:36AM (#12816284)
If you wanted to go crazy you can use transferables to get around the memory copy cost. It would be a fun experiment to figure out at what point does it make sense to use multiple workers considering the initial cost of worker distribution.

Older »