HNHacker News
TopNewBestAskShowJobs

brewmarche

517 karma · joined August 5, 2018

submissionscomments
brewmarche··on What Is Date:Italy?
Without HTTPS someone could alter the content, spread false information, inject ads, malware, and other stuff, redirect to some other site, …

(This is a general remark, but it goes for a blog post like this as well.)

brewmarche··on Maybe you shouldn't install new software for a bit
I thought that podman uses jails under the hood on FreeBSD, but it is a guess. The podman code seems to reference jails: <https://github.com/search?q=repo%3Acontainers%2Fpodman%20fre...>

But jails of course are older and can be used on their own, I didn’t want to imply they’re the same thing

brewmarche··on Maybe you shouldn't install new software for a bit
My experiences from dabbling with it a few months ago:

In general everything needs to be compiled for FreeBSD, but the ports collection is quite extensive. For example you will find Firefox, wayland, GNOME, KDE, xfce, … even dotnet was on there.

Problems arise with properietary stuff like Spotify, Widevine DRM etc. However, FreeBSD has a Linux emulation layer (providing syscalls), dubbed ‘Linuxulator’. I managed to run the Spotify Linux desktop client but the Spotify website wouldn’t let me log in, didn’t research further. AFAIK the emulator is limited though, not implementing all syscalls.

There is also podman for FreeBSD and in addition to running FreeBSD containers (using Jails under the hood I guess?) it can run Linux containers as well (using the Linuxulator in addition then?).

It also comes with a hypervisor called bhyve if you want to run VMs

There is a handbook on their website describing how to set up a system (including desktop environment) if you want to give it a go.

brewmarche··on IBM didn't want Microsoft to use the Tab key to move between dialog fields
Also, some layouts use shift lock (so actually turning 1 into !) instead of caps lock
brewmarche··on 10 years ago, someone wrote a test for Servo that included an expiry in 2026
This sounds like the idea behind mutation testing
brewmarche··on Make tmux pretty and usable (2024)
Maybe give terminal windows in vim a try? vim is not a terminal multiplexer, but if all you need is multiple terminals windows:

:term to open a terminal in a new vim window (or :vert term)

Standard window movements apply (by default the window prefix is Ctrl-W), most important are: Ctrl-W,{hjkl} to switch between windows, Ctrl-W,{<>+-} to resize windows, Ctrl-W,{HJKL} to move windows to edges, Ctrl-W,{qc} to (force) close windows

Enter normal mode of a terminal buffer with Ctrl-W,N: now you can perform vim motions and scroll the output

Enter insert mode with i and you can type into the terminal again

In insert mode: Ctrl-W "x to paste register x, Ctrl-W . to send a literal Ctrl-W. If too annoying, you can change the window prefix of vim

This goes for vim, neovim also has a terminal mode but it works differently I think

brewmarche··on Migrating to the EU
I think on the sending side, being able to send from others’ addresses is fixed by now: https://userforum-en.mailbox.org/topic/anti-spoofing-for-cus...

But it definitely used to be possible, I tried once with success.

Anti spoofing for incoming mails was not perfect the last time I checked either, but is a different issue.

brewmarche··on A most elegant TCP hole punching algorithm
Yes, you are right, quite literally, as RFC 6296 is marked ‘experimental.’
brewmarche··on A most elegant TCP hole punching algorithm
IPv6 still allows proper NAT (prefix translation), but even then finding your global address wouldn’t need TURN, just STUN, actually not even that, just a service like “What’s My IP.”
brewmarche··on A most elegant TCP hole punching algorithm
I thought TURN is for symmetrical PAT, not for proper NAT (which just needs STUN for address determination) or full/restricted cone PAT (which need STUN for address and port determination, and then performs a hole punch).

Standard-conforming IPv6 at most allows prefix translation (i.e., proper NAT, not PAT), which wouldn’t need it.

brewmarche··on A most elegant TCP hole punching algorithm
That’s true we won’t get rid of hole-punching with IPv6. But at least it will get rid of TURN.
brewmarche··on San Francisco Graffiti
If value was the price no trade would be possible. The seller needs to value the cash more than the good and vice versa.
brewmarche··on iPhone 5s Gets New Software Update 13 Years After Launch
Still using it, it’s fine performance wise, maybe needs another new battery in a year or so. Apple Pay, authenticators and messaging apps are working.

Was hoping for the new iPhone Fold (with Touch ID even) to be small but looks like it’s going to be a really weird ratio when folded.

Of course there are caveats: - Spotify not getting app updates anymore (but still playing fine)

- some websites do not support the Safari version, e.g. GitHub

- most banking apps are not supported

brewmarche··on Television is 100 years old today
I only knew about SECAM, where it’s even part of the name (Système Électronique Couleur Avec Mémoire)
brewmarche··on How problematic is resampling audio from 44.1 to 48 kHz?
That would mean that higher sampling rates (which add more inaudible frequencies) could cause similar problems. OK xiphmont actually mentions that, sorry, I had only watched the video when I replied.
brewmarche··on How problematic is resampling audio from 44.1 to 48 kHz?
Someone else wrote that it was chosen to best match PAL and NTSC. IIRC there is also a Technology Connections video about those early PCM adaptor devices that would record to VHS tape.

<https://en.wikipedia.org/w/index.php?title=44,100_Hz&oldid=1...>

Take it with a grain of salt, I’m not really knowledgeable about this.

E: also note the section about prime number squares below

brewmarche··on How problematic is resampling audio from 44.1 to 48 kHz?
> Now you could play it back wrong by emitting a sharp pulse f_s times per second with the indicated level. This will have a lot of frequency content above 20kHz and, in fact, above f_s/2. It will sounds all kinds of nasty.

Wouldn’t the additional frequencies be inaudible with the original frequencies still present? Why would that sound nasty?

brewmarche··on How problematic is resampling audio from 44.1 to 48 kHz?
This is a nice video. But I’m wondering: do we even need to get back the original signal from the samples? The zero-order hold output actually contains the same audible frequencies doesn’t it? If we only want to listen to it, the stepped wave would be enough then
brewmarche··on Microsoft May Have Created the Slowest Windows in 25 Years with Windows 11
I think I had to disable spellcheck to fix the ignored keystrokes, it happened even after disabling formatting
brewmarche··on The PGP problem (2019)
> git/GitHub/gitlab/codeberge

Is this about commit signing? Git and all of the mentioned forges (by uploading the public key in the settings) support SSH keys for that afaik.

git configuration:

gpg.format = ssh

user.signingkey = /path/to/key.pub

If you need local verification of commit signatures you need gpg.ssh.allowedSignersFile too to list the known keys (including yours). ssh-add can remember credentials. Security keys are supported too.

brewmarche··on IPv6 just turned 30 and still hasn't taken over the world
I’m wondering, wouldn’t a default deny inbound firewall still need hole punching with IPv6? You wouldn’t need STUN to find your global address but if you use varying ports you’d need to communicate the port first, and you’d also need to time the simultaneous open. So a coordinating party is still needed somewhere. Getting rid of TURN relays (if you’re affected by symmetric NATs) is of course a huge plus.
brewmarche··on IPv6 just turned 30 and still hasn't taken over the world
You should use unique local addresses (ULAs, fc00::/7) not link-local addresses (fe80::/10) for this. Choose a random prefix and advertise it in your network (you can use some website like https://www.unique-local-ipv6.com if you want).

This prevents clashing subnets when using VPN like it sometimes happens with IPv4.

brewmarche··on Bluetooth Headphone Jacking: A Key to Your Phone [video]
There’s a difference between the European version of the Apple dongle and other regions. The European version maxes out at 0.5 Vrms instead of 1 Vrms.
brewmarche··on C++ says “We have try... finally at home”
Usage at call site:

    using (var result = foo.GetSomethingIfLucky())
    {
        if (result.IfHappy is {} success)
        {
            // do something
        }
    }
brewmarche··on C++ says “We have try... finally at home”
You have to write a disposable wrapper to return. Return it in error case too.

    readonly record struct Result<TResult, TDisposable>(TResult? IfHappy, TDisposable? Disposable): IDisposable where TDisposable : IDisposable
    {
        public void Dispose() => Disposable?.Dispose();
    }
brewmarche··on C++ says “We have try... finally at home”
You can move the burden of disposing to the caller (return the disposable object and let the caller put it in a using statement).

In addition, if the caller itself is a long-lived object it can remember the object and implement dispose itself by delegating. Then the user of the long-lived object can manage it.

brewmarche··on C++ says “We have try... finally at home”
In C# the closest analogue to a C++ destructor would probably be a `using` block. You’d have to remember to write `using` in front of it, but there are static analysers for this. It gets translated to a `try`–`finally` block under the hood, which calls `Dispose` in `finally`.

    using (var foo = new Foo())
    {
    }
    // foo.Dispose() gets called here, even if there is an exception
Or, to avoid nesting:

    using var foo = new Foo(); // same but scoped to closest current scope
These also is `await using` in case the cleanup is async (`await foo.DisposeAsync()`)

I think Java has something similar called try with resources.

brewmarche··on TCP, the workhorse of the internet
I agree, although I am a bit surprised to see that we’ve used more than half of the protocol numbers already
brewmarche··on TCP, the workhorse of the internet
I guess most people mean NAPT/PAT when they say NAT
brewmarche··on TCP, the workhorse of the internet
What if extension headers made it better? We could come up with a protocol consisting solely of a larger Next Header field and chain this pseudo header with the actual payload whenever the protocol number is > 255. The same idea could also be used in IPv4.
← PreviousPage 3 of 9Next →