HNHacker News
TopNewBestAskShowJobs

sherincall

202 karma · joined December 16, 2016

submissionscomments
sherincall··on BeGoneAds – A Python script that blocks ads by installing common hosts files
I saw the todo item, but didn't realize it also included providing an executable for Windows and macOS. Thanks!
sherincall··on BeGoneAds – A Python script that blocks ads by installing common hosts files
I get that this is just someone's side project, I'm glad it exists and they're free to write it in their favorite language/environment and all; but the effort to actually run this is equivalent to actually copying the hosts files manually, and I already have all the dependencies installed. I could never get my non-techy parents to run this properly.

If the goal of the project is actual adoption, a native executable without external dependencies would have been a much better option.

sherincall··on I tried creating a web browser, and Google blocked me
Not sure if it's still the case, but it used to be that Firefox on Linux could only stream 720p videos.
sherincall··on U.S. workers hate ‘open’ office spaces
I found that 2 people per office/bullpen works best. That way you're either talking to your colleague or you're working. Even with 3 people, there are situations where the other two are talking while you're trying to get work done.
sherincall··on Show HN: Baxx – Unix-friendly backup service
> Also, in English the currency marker goes to the left of the number.

I always thought this depended on the currency; like $5 vs 5€.

sherincall··on LD_PRELOAD: The Hero We Need and Deserve
I recently gave a small talk about this and listed the applications I had for it in the past few years:

- Test low memory environment

- Add memory tracking

- Ignore double frees (fix broken programs)

- Cache allocations / lookaside lists

- Trace all file operations

- Seamlessly open compressed files with fopen()

- Speed up time() as program sees it

- Offset time() to bypass evaluation periods

- Alternative PRNG

- Intercept/reroute network sockets

- Trace various API calls (useful when debugging graphics APIs)

- Force parameters to some API calls

- Set a custom resolution not supported by program

- Switch between HW and SW cursor rendering

- Framelimiting and FPS reporting

- Replace a library with a different one through a compat layer

- Frame buffer postprocessing (e.g. reshade.me)

- Overlays (e.g. steam)

E: format

sherincall··on Explore ISS on Google Maps
One of my favorite bug reports was a hardware issue on a thinkpad on the ISS. The report had a line like "There are no repro systems on earth".
sherincall··on Building C Programs
This is the first question I ask on an interview (for a C position). People who know this stuff can walk me through it in a few minutes, and then I can focus on actual problems. Fresh college grads usually struggle a bit with the preprocessor and the linker, but the good candidates can usually figure it out with hints in 10-15 minutes.

I find this works better than a fizzbuzz test; there is always a follow-up question that involves reading/modifying some code, but those who struggle with the first question always perform poorly on the second as well.

The OP does a good job of explaining the basics. I'm saving this link to send to the candidates that do poorly on the questions.

sherincall··on If companies interviewed translators the way they interview coders
Easy:

    insert(list, node):
        node.next = list.head;
        list.head = node;
        sleep(list.count++);
Remove the `sleep` in second version, and quote significant speedup. See also http://thedailywtf.com/articles/The-Speedup-Loop
sherincall··on Linux utils that you might not know
The reason shred writes "multiple times with garbage" is due to magnetic disks where even when overwritten, old bit values could still be extracted with advanced tools. This is not the case for SSDs, so a single pass of shred (either random or zero) is enough here. Multiple passes will just kill your SSD faster.

The problem with sector access still stands, so you're not sure it's actually overwritten. You should use sfill(1) in addition to shred. sdmem(1) also, if you don't want to physically power down your machine.

sherincall··on String.intern()
Actually, that's not always correct in C++ (it is in C). It is possible that either type has the operator& overloaded, so instead the proper way to do it is:

    (std::addressof(a) == std::addressof(b))
http://en.cppreference.com/w/cpp/memory/addressof
sherincall··on Keylogger in Hewlett-Packard Audio Driver
I've never seen that particular bug before, but the whole thing sounds totally plausible. Since it only manifests in Fermi, it's likely an arch issue. I'm guessing the workaround in the driver was deemed to messy/expensive compared to the one in the application.

I'll take a cursory glance at the issue, but if you've seen NV devs discuss it externally, it's probably well known internally, like closed as WNF.

I totally see where all sides are coming from, though:

* NV: Why spend resources fixing old architectures when it's easy to workaround at application level.

* Devs: Why spend resources supporting some obscure old HW that doesn't work right.

* Users: Why spend money replacing perfectly good HW, because NV/devs are lazy?

The more time passes, the less likely the first two are to do anything about it; and in time the number of users with those cards drops below epsilon. The easiest option is to just get HW that works with the SW you need - like you did.

sherincall··on Keylogger in Hewlett-Packard Audio Driver
Are you talking about the geforce 500 series[0]? They are still supported. Assuming the HW is still good, all drivers should still work. You can try with the NVIDIA driver included with the distribution (Ubuntu, Mint, etc), or download the one from nvidia.com

If it doesn't work, you can file a bug (see/use nvidia-bug-report.sh).

[0]: https://en.wikipedia.org/wiki/GeForce_500_series

sherincall··on Keylogger in Hewlett-Packard Audio Driver
So you're talking about Tesla and earlier chips. Those are indeed only supported for the security fixes. The 34x.xx driver supports those chips, and they are indeed getting security updates.

I have personally fixed a couple of these issues[0], including for those "EOL'd" cards. The most recent posted drivers for these chips I'm seeing are 342.01 from 2016-12-14 for Windows and 340.102 from 2017-02-14 for Linux. That seems like it would check the "provide security fixes" box, no?

>has to support their hardware up to the moment they release open specifications for it.

I'd tend to agree, but as you can imagine this is quite a complex issue for us, so no comments here :)

[0]: http://www.nvidia.com/object/product-security.html

sherincall··on Keylogger in Hewlett-Packard Audio Driver
> (NVidia loves to cease support for older GPU chips).

As someone who deals with old GPU support daily, I challenge this! The most recent drivers still support Fermi chips (GT400 series) that were released over 7 years ago.

I'm not sure how long you expect a chip to be supported?

sherincall··on Volta: Advanced Data Center GPU
GeForce Now[0] - a VM you connect to from your PC, install games and stream.

GeForce Now for SHIELD[1] - Different model, more like "netflix for games"

[0]: http://www.geforce.com/geforce-now [1]: https://www.nvidia.com/en-us/shield/games/geforce-now/

sherincall··on Open-source chip RISC-V to take on closed x86, ARM CPUs
- https://riscv.org/wp-content/uploads/2016/07/Tue1100_Nvidia_...

- https://www.phoronix.com/scan.php?page=news_item&px=NVIDIA-R...

sherincall··on Nvidia's “Open-Source Guy” Has Left the Company
(NVIDIA Engineer)

If you compare the whole driver stack, KMD+UMDs (OGL,DX,CUDA,Vulkan) to just the kernel part of Linux, sounds about right. The KMD alone is definitely smaller than Linux kernel.

sherincall··on Revisiting 64-bit-ness in Visual Studio and elsewhere (2015)
I really wish MSFT would support the x32 ABI[0]. While having a single amd64 ABI, compared to 6-7 active in the x86 days, has its advantages, MSFT already threw it away with vectorcall. And x32 is arguable more useful than vectorcall.

[0]: https://en.wikipedia.org/wiki/X32_ABI

sherincall··on Windows 10 Tip: Turn Off File Explorer Advertising
I wholeheartedly recommend Total Commander[0]. Been using it for 20 years, literally the best program I've ever used. The only one I miss since switching to Linux, the copies don't come close.

[0]: http://ghisler.com/index.htm

sherincall··on Nvidia GeForce GTX 1080 Ti
Sorry, not sure exactly how SLI bridges work - it may or may not be possible to selectively sync only parts of video memory.

In cases where you want faster cross-card transfers and are willing to mess with HW configurations, there's NVLINK.

Wiki: https://en.wikipedia.org/wiki/NVLink

PR piece: https://blogs.nvidia.com/blog/2014/11/14/what-is-nvlink/

sherincall··on Nvidia GeForce GTX 1080 Ti
[NVIDIA Employee disclaimer]

Not in SLI, no. SLI is a technology to have two GPUs act as one, by syncing among themselves. When you have two GPUs in SLI, your CPU program will generally see them as a single GPU with (almost) twice as many cores and twice as much bandwidth, but the same amount of memory.

For this to work, the GPUs need to be very similar (i.e. you can't SLI a TitanX and a 1080).

You can, however, put many[1] different GPUs in the same system, and then the onus is on the CPU program to properly manage and send work to each one separately. This is not SLI.

Generally, SLI is useful for games where the program assumes "a GPU" and sends work to it, and you want to have more performance than your single card can provide. For compute/ML, you're much better off just using each card directly.

[1]: Don't quote me on this, but I believe up to 8x is supported, above that is uncharted territory.

sherincall··on Microsoft Launching $10/month Xbox Game Pass
Additionally confusing since NVIDIA offers two different products with the "Geforce NOW" brand.

The "Netflix for games" version is here:

https://www.nvidia.com/en-us/shield/games/geforce-now/

Some explanations at the FAQ: http://www.geforce.com/geforce-now/faq

sherincall··on Attacking the Windows Nvidia Driver
Disclaimer: NVIDIA employee.

First of all, if your CPU has an integrated GPU, and you don't need more monitors than it supports (usually it's 3x1080p), that will be more than enough.

> Why should I move from just VGA, that is, get just a VGA card and not even get a graphics card?

I don't quite understand what you mean by VGA card. You mean something that has a VGA adapter and framebuffer(s), but the rendering is done on the CPU?

I wasn't aware those still exist outside some niche markets. I'd guess it'd cost about as much as an entry level GPU, which will take the load off your CPU.

My advice, if you don't have any iGPU on your CPU, is to just get the lowest tier graphics card. Those are <$100 new for the latest generation. You don't need latest, and probably don't need new.

When it comes to web browsing and watching videos, any remotely recent card will work fine. You may have issues with some fancy WebGL pages (i.e. browser games) but that hardly counts as everyday browsing.

Be sure to read a review of the card before purchasing!

sherincall··on Attacking the Windows Nvidia Driver
Some specific numbers:

The patches from Tuesday fixed a total of 16 CVEs. 11 are Windows only, 4 are Windows+Unix[1], 1 is Unix only. 3 of those (Windows) CVEs were reported externally.

http://nvidia.custhelp.com/app/answers/detail/a_id/4398

Older bulletins: http://www.nvidia.com/object/product-security.html

[1]: Unix in NVIDIA-speak generally means Linux+Solaris+FreeBSD

sherincall··on Attacking the Windows Nvidia Driver
It is very similar to an ioctl on Unix (DeviceIoControl on Windows), just specific to the Display/Video driver here. It is a way to send arbitrary data from usermode into kernelmode, for whatever reason.

You can imagine the usermode interface as:

    void escape(int command, void *param);
And then the kernelmode implementation would look something like:

    void escape(int command, void *param)
    {
        switch (command)
        {
            case COMMAND_FOO:
                do_foo((foo_param_t *)param);
                return;
            case COMMAND_BAR:
                do_bar((bar_param_t *)param);
                return;
        }
    }
The driver defines the params and what FOO and BAR are. This can be used to issue special commands that don't have an interface provided by MSFT. It is also used by any drivers that run in usermode (e.g. OpenGL, CUDA, etc) that communicate directly with the kernelmode ones. These interfaces are generally not public. The project zero researcher has disassembled the kernelmode driver and reverse engineered their format.

Does that help?

sherincall··on Attacking the Windows Nvidia Driver
That is pretty weird. Safemode boot should still work if the installation was botched.

You can try to remove all the NV kernelmode driver files manually, at which point it should just fallback on the default VGA driver. Then you can use the DDU[1] tool to cleanup any remaining files, and do a clean install with a driver from nvidia.com.

Do you perhaps remember what the bugcheck code was, and which driver was listed as the offender? If you have a kernel minidump still available, that'd be helpful as well.

[1]: http://www.guru3d.com/files-details/display-driver-uninstall...

sherincall··on Ask HN: What are your favorite algorithms?
It was tongue-in-cheek (see the smiley face), your critiques are all spot on, but there is one thing where it is objectively better:

Tortoise and hare can only detect that a cycle exists. This hack will tell you exactly which node the cycle starts on. That means that if you want to e.g. repair a list, you can just cut that last link and set it to either null or root. Granted, this wasn't the original problem.

sherincall··on Ask HN: What are your favorite algorithms?
I like my solution better:

The list node contains a pointer and some data, most likely another pointer, or a primitive type, or a struct of primitive types. Which means, that on all modern systems, a list node is aligned to at least 16 bits, much more likely 32 bits. That means that the pointer to the node always has the last bit set to zero. So:

    bool containsCycle(node_t *root)
    {
        node_t *p = root;
        bool ret = false;
        if (!root) return false; // Empty list

        while (p->next && !ret)
        {
            if ((uintptr_t)p->next & 1)
            {
                ret = true;
                break;
            }
            node_t *q = p->next;
            p->next = (uintptr_t)p->next | 1;
            p = q;
        }
    
        // Reset all pointers
        p = root;
        while (p->next && ((uintptr_t)p->next & 1))
        {
            p->next = (uintptr_t)p->next & ~1;
            p = p->next;
        }
        return ret;
    }
:)
← PreviousPage 2 of 2