HN user

oddlama

206 karma
Posts1
Comments33
View on HN

This is great if you only have a single disk, but if you have multiple encrypted disks that are unlocked in the initrd this way, then if you can gain control flow by faking data on the last decrypted disk you can still gain access to all the previously unlocked partitions.

Of course you cannot unseal the secret from the TPM anymore.

I can think of plenty real world usecases. Take for example a network interface that can send or receive predefined packet structs.

Imagine each packet requires a size header. When you want to send multiple packets at once, you now want to optimize that and only write a single initial header to the interface, preceding the data.

With variadic generics, you can enable a syntax like `interface.write_packets(packet1, packet2, packet3, /* ... */);` which writes the packets in the desired optimized way. It can internally construct a serializable data tuple from the variadic generics and add the correct header only to the beginning.

Without variadic generics a similar syntax is only possible with macros, which means that it cannot be implemented as a reusable trait.

It would seem to me, you're just skipping the part where you give your tuple a name, but is that even a good idea to do?

Sometimes you explicitly don't want to require naming the tuple for flexibility, like in the example above.

Not parent, but I'm doing the same thing and I have had 5 leaks out of (currently) 387 accounts over the past 4 years (which is when I started doing this).

Oh and none of the involved entities ever acknowledged the leaks. I'd also be highly interested in the rates other people encounter.

I haven't looked at the project but would assume that several people generated their wallets by using this tool. The attackers were thus able to generate keys for existing wallets by simply bruteforcing the measly 31 bits that were used in the tool's random initialization.

Just a battery would be the simplest option. Just measure time until empty.

If you want higher time resolution, there are several fully integrated hall effect current measurement ICs out there, like for example the ACS723.

If you need even better accuracy or resolution and you can spare 100 bucks, just buy one of the Nordic Power Profiler Kits.

If anyone wants to learn about GPS from the ground up, there's an excellent website with interactive explanations by Bartosz Ciechanowski that I can wholeheartedly recommend [1].

His blog also covers other topics in a similar style - it's a real treasure trove.

[1] https://ciechanow.ski/gps/

How do I exit Vim? 4 years ago

esc esc esc :qa!<cr> (8 strokes)

This is the shortest I can think of right now, 3 esc to exit Ctrl-v, Ctrl-r and insert mode, then :qa! to quit even if there are splits or modified background buffers.

If ^C is considered one keystroke I'd replace all esc by ^C to prevent vim from hanging forever in the following starting situation: 999999999asometext^R^V<exit sequence>

With esc it would try to insert a lot of text after the last esc, which will make vim unresponsive for days at least.

Not sure if you want to count this one: alt+sysrq+k (1 stroke or 3 strokes depending on how you count)

Yes, and it's quite comfortable. If you don't want to use external media, many boards also come with a builtin UEFI shell which is quite powerful. From there you can simply execute the kernel with the desired cmdline. (like ./vmlinuz root=...)

I'm not your parent comments OP, but I don't like to use -e for similar reasons, and I do have public bash scripts written with explicit error handling [1].

I've tried using -e on multiple occasions, but always had to disable it again because it lead to even worse classes of errors. It hurt me more than it helped, but I also consider my explicit error handling quite pedantic and probably not the norm.

I feel that instead of fixing the problem it just shifts it around, because an exit code != 0 does not generally indicate an error:

* `((i++))` must now be written as `((i++)) || true` or it will probably kill your script, and short hand conditions become foot-guns:

* Statements such as `[[ $i -gt 3 ]] && continue` must now be written in long form in their own ifs, or `|| true` must be appended.

* Want to save the return code? Guess you have to use `command && ret=$? || ret=$?` now.

* Subshells with errors may exit independently and won't notify you of the error at all, because ylur parent is still alive afterwards.

The list goes on and on. Lots of strange edge cases appear. I recommend reading http://mywiki.wooledge.org/BashFAQ/105 which highlights some of them.

In the end, set -e requires you to think just as much as not using it to not randomly crash your program. It just shifts the problem to other statements. I already learned to handle errors in normal bash, and the only thing set -e requires me to do is to change my error handling style in those cases, which to me generally seem more obscure.

If I still have to use set -e, I always use something like the following snippet, so that I at least get a message:

``` set -e function eerr() { echo "error: $0:$1: command failed but status was never checked!" }; trap 'eerr "$LINENO"' ERR``` ```

[1] https://github.com/oddlama/gentoo-install/blob/develop/scrip...

The older neo keyboard layout and its newer variants like bone (https://neo-layout.org/Layouts/bone) follow a similar approach to provide more symbols, and they're additionally optimized for typing.

These layouts provide several additional layers which give easy access to ASCII special characters, greek letters and frequently used math symbols.

Also there is layer 4, which is pure gold in itself. It provides cursor movement keys, backspace, enter and a numpad close to your home position. I personally couldn't go back once I had tried it.

(Beware that these layouts include the umlauts äöüß as they were designed for german writing, and make use of the additional key for '<' in the lower left corner of german keyboards)

“Compared to non-users, regular cannabis users were more likely to engage in high-risk alcohol consumption, smoke tobacco, use other illicit drugs and not be in a relationship at age 35,” Dr Chan said. [...] They were also at higher risk of depression and less likely to have a paid job.

“Overall, regular use of cannabis [...] was found to have harmful consequences, regardless of the age people began using it.”

I am skeptical that this study is actually representative of the effects of cannabis, and does not instead depend on other, highly correlated effects, which are then presented as the reason. From my general (non-user) perspective, I would assume that there is probably a bias towards groups of people who have a higher chance to use substances in general, or live in a comparatively poor environment.

For example: Children of smokers often become smokers themselves (as numerous credible studies show). If they now start with cannabis, they would be included as the victims of cannabis in the discussed study. However, the causality is probably reversed here.