HNHacker News
TopNewBestAskShowJobs

10165

81 karma · joined May 2, 2017

submissionscomments
10165··on Writing a Unix Shell
This is the output I got, tab separated:

   2017-05-29T13:37+0200 DEBUG: Garply exited with 0.
   2017-05-29T14:55+0200 ERR: PLUGH QUUX CORGE!
                        ^tab
All you have to do is substitute tab for space.

Ctrl-V then tab. Or if using GNU sed just type \t.

We can reject this simplicity as a "trick" and demand something more complex.

But that suggests that the goal is not to solve the problem, it is to satisfy someone's desire for having some underlying complexity that moves the solution out of the realm of "trivial".

10165··on Writing a Unix Shell
"grep ^2017-05-29 /var/log/somefile | grep -v 'INFO|WARN' | tail -n5 | cut -f1 -f3"

Did you mean cut -d' ' -f1,3?

Assuming delimiter is a space the above example can be reduced to:

    sed '
    /^2017-05-29/!d;
    /INFO/d;
    /WARN/d;
    s/ /INFO/;
    s/ /INFO/;
    s/ .*//;
    s/INFO.*INFO/ /;
    ' /var/log/somefile \
    |tail -n5
"... compile a set of commands into a single program and run that."

Linux: see busybox ("multicall binary") BSD: see binaries on install media ("crunched binary")

sed and tail are both compiled into busybox re: bsd compiling in tail with crunchgen is easy

As for "objects", the k language can mmap the output of UNIX commands and run parallel computations on those results as "data" not "text". It can be faster than I/O.

10165··on ‘Carbon Dating’ the Internet Archive with OpenTimestamps
No Javascript version:

https://raw.githubusercontent.com/opentimestamps/opentimesta...

https://archive.org/download/opentimestamps-calendar-backups...

https://ia801509.us.archive.org/13/items/opentimestamps-cale...

https://github.com/opentimestamps/opentimestamps-client

https://alice.btc.calendar.opentimestamps.org/calendar/ https://bob.btc.calendar.opentimestamps.org/calendar/ https://finney.calendar.eternitywall.com/calendar/

10165··on Chrome Won
"Mozilla's founding mission was to build the Web by building a browser."

I have been using the Web since 1993.

I always thought the Web had the definition given in its Wikipedia entry.

Web servers and hyperlinks.

Apparently some people believe "the Web" is actually a browser, or a small set of them.

This is like suggesting a galaxy is actually a telescope, or a small set of "standards compliant" telescopes.

Browser-centrism is truly myopic.

What is relevant is the ever expanding practice of installing web servers into all sorts of devices, not simply racks of computers in server rooms and offsite data centers.

10165··on The Blockstack Browser: A Gateway to a New, Decentralized Internet
"Javascript Required." "Oh snap! Your browser doesn't support Javascript."

I have seen so many of these Javascript-only "websites" posted on HN I am wondering is this coming from some web development template? How difficult is it to have a page with text for those not using Javascript? Something like

  <html class=nojs>
  <p>This website was designed for browsers that run Javascript.  Are you using one?  Here are some examples of browsers that work well with our website: browser1, browser2, etc.  Alternatively, a no-JS version of the website is available <a href=https://blockstack-site-api.herokuapp.com/v1/blog-rss>here</a>.</p>
  </html>
There are of course other ways to do this. The point is that it can be done and is not difficult.

For those not using or with Javascript disabled:

https://github.com/blockstack/blockstack-core

And a blog

   curl -o 1.htm https://blockstack-site-api.herokuapp.com/v1/blog-rss
   tr -cd '\12\40-\176' < 1.htm > 2.htm
   xyz 2.htm
where xyz is some program that displays html or rss.
10165··on U.S. top court tightens patent suit rules in blow to ‘patent trolls’
Fact: Certain federal judges were getting a disproportionate amount of patent cases.

Consider: Over time, it is possible judges in other jurisdictions did not like this. (Why?)

Question: Can anyone assume that these other judges not in, e.g., ED Tx, will not also be "plaintiff-friendly"?

Consider: Being "plaintiff-friendly" can have the effect of more patent cases being filed in the judge's jurisdiction. Further consider that some judges may want more patent cases filed in their jurisdiction.

As such, the headline may be prematurely drawing conclusions. Or not. Will patent litigation continue to rise, will it remain steady, or will it begin to fall?

10165··on How to Build a Non-Volatile Memory DBMS
"Every commodity system that has tried to do without PMMUs has failed..."

I would like to read about these. Anyone have any pointers?

10165··on The Quants Run Wall Street Now
Using links is both better and easier.

amp html pages look great in links.

10165··on The Quants Run Wall Street Now
I know there was just a discussion yesterday on how amp is awful but it still is useful, e.g., to read WSJ articles.

   curl -o 1.htm https://www.wsj.com/amp/articles/the-quants-run-wall-street-now-1495389108
   sed -n '/./{/<title/,/<\/title/p;/<p>/,/<\/p>/p;}' 1.htm > 2.htm
FWIW, 2.htm has no amp elements, no Javascript, no images, no ads, no externally sourced resources and therefore no tracking.

Add links to non-essential images (cf. auto-loaded by browser). With available captions.

  sed -n '
  /./{/div class=.image/,/<\/div/!d;s/ *//;}
  /src=/{s///;s/\"//g;s/.*/<a Href=&>&<\/a><br>/;}
  /alt=/{s///;s/[\">]//g;/./s/.*/<P>above: &<\/p>/;}
  /Href=/p;/<P>/p' 1.htm >> 2.htm
10165··on Windows 10 Enterprise ignores various privacy settings
I read that Windows 10 uses peer-to-peer file sharing with any other Windows hosts it locates on the same network.

This way each Windows computer does not have to connect to Microsoft to download, e.g., the Windows 10 "upgrade". It seems like this could also be used to evade attempts by users to block such downloads by blocking Microsoft IP addresses.

Windows 10 could propagate itself through a network of Windows computers, like a ...

Seriously, how does this work in pratice?

Windows 10 does peer-to-peer file sharing automatically without requiring any user interaction?

10165··on Notes from an Emergency [video]
Regarding the "right to go offline", I see an increasing trend of non-networking software that inexplicably "requires" the user to have an internet connection.

This trend may have the effect of coercing users to stay connected. (Even if the "requirement" is not truly a requirement but merely a suggestion or recommendation disguised as a directive.)

As such, users with the "right to go offline" may not do so because a company is telling them they must stay connected in order for some (non-networking) software to work.

There are many examples of such software, and at the risk of annoying some people, I will provide some.

But the nature of my question arises from the simple idea that sometimes software can accomplish it purpose without an internet connection, as will be familar to anyone who used such software before internet connections were inexpensive, "always on" or fast.

This a broad concept. It applies to all software.

Random example 1: Professional/hobbyist audio recording, editing software

Random example 2: Unnamed operating system setting world records for number of "updates"

"Office suite" software, e.g., word processor, spreadsheet, etc.

Can a user record and edit audio without having an internet connection?

Can a user read, create, edit a document or spreadsheet while being disconnected from the internet?

There are reasons that companies want users to stay connected.

However users are not always given full details on those reasons.

Obviously leaving computers connected poses risks for the user.

Users have to weight those risks. Should users be entitled to the full details? (Without having to use a program like "Little Snitch".)

The first question to ask is: Can a given program accomplish it purpose without using the network?

If yes, then the next question is: Why does a company "require" a user to have a working internet connection for the use of this software?

Free use of a user's internet connection by a company enables collecting user data and potentially generating revenue from user data, e.g., through advertising.

But should users give away their network bandwidth to companies to use however they see fit?

Even more, should users give away their RAM as if it was an inexpensive, infinite resource?

Software programs that generate revenue routinely increase "minimum RAM requirements" year by year but many times users receive no details on why the increases are needed.

The reasons could be legitimate however they might also be questionable. Without consideration of the undisclosed details, how can users make informed decisions?

10165··on Twitter abandons 'Do Not Track' privacy protection
Commenters are confusing ads versus tracking.

Remember that it is possible to track users without the use of ads.

A browser written by an organization that profits from ad revenue or collecting user information (hereafter "well-known browser") will load elements, e.g., images, in a web page automatically.

No user interactivity is required. The user need not "click" anything. The user may not even be able to see the element loaded.

Email clients supporting HTML email can do the same thing, loading images automatically, hence suporting a method of tracking.

This is a very old method but still widely used.

What if the user is not using a "well-known browser"? What if those elements will not be loaded automatically? Will these methods of tracking still work?

All methods of tracking, other than IP addresses in access logs, rely on assumptions. Many rely on assumptions about usage of a "well-known browser".

The assumption re: automatically loaded elements, "beacons" or whatever one wants to call them, is that the user is using a "well-known browser" that will load elements automatically. If the user is not using a "well-known browser", all bets are off?

Another example is the HTTP header "fingerprint". HTTP headers are tied to "well-known browsers". What if suddenly all users decided to only send the same minimal headers? In the way that some server software might try to hide its version (e.g., BIND) imagine that users decided to hide their client software version.

Aside from IP addresses, many methods of web tracking are heavily reliant on assumptions about use of "well-known browsers" and the behavior of those browsers. Could these assumptions ever fail to be true? Can users think for themselves?

The www as a medium for exchanging information or even doing commerce does not necessarily require the use of any particular browser. That "requirement" is only imposed by certain sites on the www, for reasons that may ultimatley benefit the site owner more than its users. No such "requirement" is imposed by the www itself.

Thinking of this in terms of "a carrot and a stick", as far as I have seen using the www since 1993 there is only a carrot in the form of a "well-known browser". There is no stick. Users are free to make HTTP requests using any client they choose, including ones that do not expose them to advertising or tracking. Such clients may not require an "adblocker" because they do not requests elements automatically.

There used to be and perhaps there still is a never-ending battle between commercial entities over which is the "default browser" in a graphical OS. Certain companies tried to coax users into using certain "well-known browsers". There was even a large antitrust case in the US over this issue.

The implication seemed to be that if not set by default users might otherwise choose some other HTTP client to interact with the www. In those days one company wanted to sell a browser as enterprise software. Today that browser is owned by a "non-profit" organization of salaried employees. Other well-known browsers are owned by "for profit" (subject to taxation) commercial entities with thousands of employees.

Today, these well-known browsers are "free". And yet these browsers are written by salaried employees, not open-source project volunteers. These entities continue to market their "free" browsers aggressively to users.

As a user, ask yourself why.

Ads? Tracking?

10165··on Elf Hello World
I like your page about making Android executables, especially the quote from Carmac and comment about the vurtues of being control freak. Have you tried to do the same thing for iOS? What is the current file and directory count for Xcode?
10165··on Lessons from last week’s cyberattack
The real question should be: Can Microsoft write an OS that does not have to be constantly patched, month after month?

We know they have written such things as part of research. But still they continue to release software that is unfinished.

They have trained their users that failure to update is fatal. No doubt, if they are using Windows.

They also like to conflate "update" with "upgrade". They use these security problems in Windows to scare people into upgrading.

Windows 10, whether they like it or not. As others have noted, by design the new versions are not safer than the old ones.

Retroactively fixing reported issues does not make a new version more secure by design. They could just as easily fix the issues in the older version.

Can this company get anything right the first time? Will they ever design a system that is secure?

Do they have any interest in doing so?

Are they incapable?

There is nothing wrong with releasing something simple, secure and finished.

Does MS believe Windows users are not worthy of a secure OS?

I think Microsoft Research have contributed to development of L4 systems that run on baseband.

Do these systems have the same vulnerabilities as Windows?

Fixing problems after they occur (past problems) is admirable but other free opens source OS written by volunteers accomplish the same thing. The question is whether the design of the system is such that future problems are avoided.

Does Microsoft believe Windows users deserve more security? Can Microsoft deliver it?

All indications suggest the answer to both questions is no.

With no viable alternatives, no one can blame Windows users for sticking with it despite red flag after red flag, but it makes no sense to defend the Microsoft approach to security for Windows users. The company has no respect for Windows users.

Being responsive to a constant stream of reported vulnerabilities is an improvement from 1995 but as we can see it is not enough. Their software is still full of mistakes. They need to prove they can make something that is secure by design and that they are willing to do so for users.

(Truthfully, they probably do not need to do anything.

Quotes of 80% of Windows installations being tied to purchases of hardware are probably not far off the mark.

There is no selection of OS by most computer users.

A majority of users still get Windows pre-installed on the computers they purchase.

Microsoft could completely ignore users and it would not hurt their business, as long as they continue to maintain relationships with hardware manufacturers.)

10165··on Intel AMT Checker for Linux
Do you mean secretive about how it works or do you mean secretive about its existence?

There is a driver for it in the Linux kernel source tree.

Looks like it came in maybe around v3.9-rc1?

http://elixir.free-electrons.com/linux/v3.9-rc1/source/drive...

Did any Linux users question what this was at that time?

Is this driver part of the "default" Linux kernel configs?

What if the user compiles their kernel without this driver?

Would that change what could or could not be done by someone accessing the "ME" remotely?

10165··on Predictions of massive job losses to automation miss data that show the opposite
Non-paywall, non-Facebook link:

https://www.wsj.com/amp/articles/robots-arent-destroying-eno...

as in

   fetch -4o 0.htm https://www.wsj.com/amp/articles/robots-arent-destroying-enough-jobs-1494434982
10165··on A federal court has denied a pre-trial motion to dismiss a GPL enforcement case
True.

But the idea I had in mind with this question was that there is often an initial free source of high value code and then someone may add an addtional amount of their own code that is by comparison far less valuable.

The end user of the commercial product if it is closed source may not be able to see the extent of the contribution of that free portion to the value of the product as a whole.

For lack of a better hypothetical, imagine a product that is a combination of 1. GPL licensed command line executable that anyone can download and compile for no charge and 2. a GUI "skin" written by someone who has no copyright in the command line executable.

The author of the skin, let's call him "the entrepreneur", wants to charge end users.

The entrepreneur packages his skin together with the GPL licensed command line executable as a closed source commercial "product".

As you state, "Nothing stops anyone from charging for the GPL code in the first place."

But in this case, as is common among GPL-licensed programs, the author who wrote the command line executable never charged for it.

The problem I see with this situation is that because the product is closed source, the end user may not be able to determine the extent of "the entrepreneur's" work.

For example, his contribution to the "product" may be quite small in comparison to the work of the original author. That is, the core of the product, the most important bits, may comprise the freely available GPL source code, available to anyone for no charge.

This is not a situation that I expect anyone else to care about. But as an end user, if I were faced with paying for a commercial software product, I would want to know about the entrepreneur's use GPL source code that I could obtain elsewhere for free and the extent of the entrepreneur's "contribution" in relation to the original author.

Returning to my original stupid question, why does the entrepreneur not sell his skin separately from the command line executable. It is a rhetorical question. (Commenters tried to answer it anyway.)

Assuming the command line executable is a well-written, highly valuable program and an end user does not know about its existance, the entrepreneur's product may look quite valuable. The entrepreneur may be piggybacking on the value of the GPL source code but concealing this by keeping the source code secret.

10165··on Delegating complex treatments to filters in shell programs (2015)
The author's first sentence regarding "novice" shell programmers I think may be applicable to the other submission about shell scripts currently on the front page.

For example, in C the idioms often combine several instructions into a single line, i.e., "nesting". Kernighan suggested nesting in an early C tutorial:

   while ( putchar( getchar( ) ) != '\0' )
In the shell maybe it is better to test each "expression" on a line by itself. Or maybe not. I do this anyway.

More often I see on the web that other shell scripters prefer to nest as many commands as they can, perhaps to reduce the number of lines.

For example,

    variable=$(command1 $(command2));
This could be alternatively expressed as something like

   variable1=$(command2);
   # can now test variable1 before proceeding to next line
   variable2=$(command1 $variable1);
The result of nesting is subshells and complexity that I am not sure reluctant, occasional shell scripters are prepared to think about.

And if I am not mistaken that was at least part of the problem that Jane Street had in the other submission.

10165··on A federal court has denied a pre-trial motion to dismiss a GPL enforcement case
To be clear, the silly question I posed was not directed at avoiding copyright violations. What I ask is whether anyone is ever curious about the value of the derivative work versus the original work.

For example, the original work might be very valuable, a significant work. It could be the collective work of many authors. But it has been made available for free. The derivative work, maybe patches or some additional source code by a single author, is also valuable but on its own much less so.

Then the large original work is packaged together with the patches and additonal source code as a "derivative work". It is commercially licensed to an end user who sees the value as a whole, most of it coming from the original work, which of course was available for free.

Depending on whether attribution is given, the user may have no idea that the core of the product was open source and available for free.

More importantly, there appears to be no assessment of the relative "value" of the free portion versus the closed-source commercial portion of the product.

10165··on A federal court has denied a pre-trial motion to dismiss a GPL enforcement case
Yes, the "outcome" to which I was referring was in fact the effect of dual-licensing.

With respect to the book chapter, as I interpret it, reciprocity includes asking for the licensee to open source their work. But I leave this to the experts to interpret definitively.

Assuming I am not misunderstanding, if the licensee "reciprocates", then there is no closed source and the "problem" I am alluding to goes away. Because users can now see the source code and theoretically they can determine where it came from.

(The problem being that GPL source code and the value thereof is sometimes "concealed" in closed source products. This is just my personal view. I may care about things that others do not. Opinions may differ.)

10165··on A federal court has denied a pre-trial motion to dismiss a GPL enforcement case
Patching might operate by locating patterns in source files and editing the source files. Either deleting, changing existing text and/or adding new text. The patch files themselves might be considered nothing more than instructions on how to make edits.

It is true the patterns could be excerpts from the GPL work. But they need not be functional or even intelligible as anything other than as part of instructions, e.g., short strings of octal values representing characters, with wildcard characters interspersed.

Patching might even operate by only using line and column numbers. The patch itself in that case need not contain any text from the GPL work. It might be just an index into some file, a list of line numbers and columns and any new text to be inserted.

The point is that the process of patching need not necessarily reveal anything about the original GPL work. The editing could theroretically be done in such a way to make this separation.

Anyway, we have drifted from the original question which was , essentially, why do programmers not distribute instructions on how to modify GPL source code or additional source code that can be linked with GPL source separately from the GPL source code.

The reason I asked is because what I see is that original GPL source code is sometimes "hidden" in commercial products by virtue of being bundled with some "derivative work". To me this obscures the value of the original GPL source code in favor of the closed source derivative work, which may or may not be as valuable. NB The usage of the words value and valuable is purely subjective. Opinions may differ.

I am not sure I understand the comment about BSD licensing. Assume for example that the goal of the license is to require attribution, how does one avoid that requirement without changing the license? The licensor can opt not to enforce the license and may accept payment. But the license still requires what it says.

10165··on A federal court has denied a pre-trial motion to dismiss a GPL enforcement case
Question: Is that what Stallman intended to accomplish with the GPL? Pay a fee for GPL source code and bypass the GPL? (I apologize for my ignorance here.)

It seems like "reciprocity" has an even worse outcome than BSD source code. The origin of the source code can be completely hidden from the user.

Do users deserve to know at least that the original source code was freely available? What happens when users discovers that they are paying for something that others are getting for free? Do they care?

Is this a case of taking something that was free (but valuable), i.e., the original GPL source code, and concealing it as a closed source work in order to generate revenue/profit for some specific person or entity?

Stupid question: If someone fixes or adds something valuable to GPL source code and wants to charge for it, then why not just charge for the patch or the additional code?

(Assume that patches or additional source code files are distributed by themselves without the original GPL source code and that they do not contain any functional portion of the original GPL source code. Assume further that they do not use "interfaces" designed by the GPL source code author. Finally, assume that the end user can compile their own software and no binaries are distributed.)

10165··on A remotely operated vehicle livestreaming the deep sea
"... I use adblock plus and it's not enough all the time..."

Next time this happens it could be useful to make a submission to HN about it.

We might be able to identify and/or solve the problem.

I do not use an ad blocker nor do I use python or youtube-dl yet I never see any ads and I download all videos before watching them. Indeed I access the web for the information not the inconsistent design/feel.

What I posted above illustrates examples of two alternative approaches:

1. Block sources of undesired resources: ads, tracking, etc. The "links" listed are domains used for undesired resources.

2. Only make requests to sources of desired resources: the article and its accompanying images and video. The script extracts only what we want from the html page.

I use approach #2 more than #1.

As far as I know ad blockers use blocking, #1, exclusively. They need to maintain a list of domains to block.

10165··on When Bash scripts bite

    echo ($(ldap-query-for-valid-users)) > /tmp/all-users.sexp
should be something like

    x=$(ldap-query-for-valid-users);
    test ${#x} -gt 0||exec echo no valid users >&2;
    echo \("$x"\) > /tmp/all-users.sexp;
This way they would get the message "no valid users" to stderr and the script would exit. According to the blog post that is what they wanted.

Alternatively,

    x=$(ldap-query-for-valid-users);
    test ${#x} -gt 0||exit 100
    echo \("$x"\) > /tmp/all-users.sexp;
if they prefer a nonzero exit code to a message to stderr.
10165··on Zip Files All the Way Down (2010)
By default the Python binary will try to load a file called "python27.zip" at startup. What if python27.zip was a "zip bomb"?
10165··on Pulling JPEGs out of thin air (2014)
There is one in that list for OpenBSD kernel in 2016. When tmpfs was removed from OpenBSD the reason given was "lack of maintenance". The problem found by afl had nothing to do with the decision?
10165··on A remotely operated vehicle livestreaming the deep sea
If you are serious and you want a script like this for any given page that you want de-crufted and reformatted, let me know. This applies to any HN reader.

I make these for myself all the time.

I do one-offs in sed and if it is something I will reuse I redo it in C using flex.

If you want something generalized to all web pages that removes google analytics, doubleclick, scorecardresearch, etc. of course that is possible too. I am happy to make this for anyone who wants it.

Another solution is to run a proxy on your computer that filters out garbage. Such proxies used to be more popular when advertising began to take over the web, but most of these projects seem to have been abandoned and forgotten (junkbusters, etc.).

Nowadays it seems like people try to accomplish this via Javascript running in the browser.

Turning off Javascript is also highly effective at disabling advertising. But note this may not stop things like img src tags pointing at tracking pixels, malicious iframes, and other elements that graphical browsers will load automatically.

Also, tcp clients do not normally store or send cookies. And even if they try to provide this functionality, e.g., curl or wget, unlike a graphical web browser, cookies are off by default. Consider the case where the user retrieves the page with a tcp client and then views it in a browser.

10165··on A remotely operated vehicle livestreaming the deep sea
Assuming nothing listening on 127.0.0.1, this should fix the problem.

   cat << eof >> /etc/hosts
   127.0.0.1 vice-web-statics-cdn.vice.com
   127.0.0.1 fonts.googleapis.com
   127.0.0.1 www.google-analytics.com
   127.0.0.1 d31qbv1cthcecs.cloudfront.net
   127.0.0.1 d5nxst8fruw4z.cloudfront.net
   127.0.0.1 b.scorecardresearch.com
   127.0.0.1 advice-ads-cdn.vice.com
   127.0.0.1 vice-publishers-cdn.vice.com
   127.0.0.1 vice-sundry-assets-cdn.vice.com
   eof
Alternatively, sed script below will give you just the article html, images, and embedded youtube along with all the json data enclosed in <pre></pre> tags.

   curl https://motherboard.vice.com/en_us/article/this-robot-is-livestreaming-all-the-gnarly-stuff-its-seeing-in-the-deep-sea?utm_source=mbtwitter \
   |sed '
   /window.__PREFETCH_DATA/!d;
   s/window.__PREFETCH_DATA = //;
   s/\"[:,]\"/\
   /g;
   s/,\"/\
   /g;
   s/\":/\
   /g;
   s/.[}{]./\
   /g;
   s/[}{]./\
   /g;
   s/[][]//g;
   s/id/<pre>&/;
   s/body/&<\/pre>/;
   s/\\u003C/</g;
   s/\\u003E/>/g;
   s/\\u002F/\//g;
   s/\\"/\"/g;
   s/url/<pre>&/;
   s/embed_code/&<\/pre>/;
   s/autoplay/<pre>&/;
   s/;/<\/pre>/28;
   '
10165··on Multiple Vulnerabilities in ASUS Routers
Am I the only user who does not want a web interface on a router?
10165··on Things to Use Instead of JSON Web Tokens
"..."algorithm agility" that is a proud part of the specification" (italics mine)

No idea about "JWT" but maybe this is part of the psychology that keeps schemes like SSL/TLS in use. (Part.)

Do you think there are people who are actually proud of achieving complexity in a specification or implementation?

Page 1 of 2Next →