mhw

Joined 17 years ago

Karma
1,794
Submissions
356
Member since
Nov 17
Building things on the internet since the early nineties.

https://dangerous-techniques.com/

View on Hacker News

Recent submissions

Comment · 6 months ago
Comment · 6 months ago
I’ve been using Ctrl-s for years. Nothing else uses it because it’s historically been used for terminal flow control, but that doesn’t really have much use in a graphical terminal with history and scrollbars and so I’ve never missed it. Has similar two-finger ergonomics to the Ctrl-a bind as well.

edit: oh, and I think Ctrl-space is the keystroke to get a nul character, and vi uses that character to insert the last entered piece of text in insert mode. It looks like Ctrl-@ does the same things, but tmux might not be able to tell the difference either.

Comment · 11 months ago
Yeah, you need to rebase the tip of the feature branch stack. git will then update all the refs that point to ancestor commits that are moved. So in this case

    $ git rebase --update-refs main feature-2
Comment · 1 year ago
Comment · 1 year ago
I think pax was more of a POSIX replacement for cpio and tar. While those three and ar all could be used to bundle files together into a single file, only ar had the special affinity with the linker as a way of bundling object files together into libraries. The others were more aimed at backing up directories to a tape drive, as the example on the pax man page shows.
Comment · 1 year ago
The fabulous blazer gem includes a feature for #2: https://github.com/ankane/blazer?tab=readme-ov-file#checks - it’s limited to checks that can be expressed as SQL queries, but that can get you quite a way
Comment · 1 year ago
Unlikely. This kind of wireless thermostat has two parts: the thermostat itself, and a separate receiver box that's directly connected to the boiler. There's usually a pairing process that you can go through where the two parts negotiate a shared value used in the protocol; this prevents one thermostat unintentionally controlling other boilers. You can see this described in the Installation Guide for the thermostat linked from the article (it's called 'binding' in the guide).
Comment · 1 year ago
My reading is that the first two CVEs are with rsync daemon, but the others are more general - I think "rsync server" is meaning the remote rsync process that is started when you use ssh to connect to the remote. Some of them suggest the rsync client (running on your machine) can be coerced to write to unexpected locations by a malicious rsync server specifically crafted to exploit these CVEs. One suggests a malicious rsync server might be able to reconstruct the contents of arbitrary files on the client using requests sent via the rsync protocol.

I guess the main takeaway is to be careful using rsync connections to machines that you don't trust.

Comment · 2 years ago
It’s really handy to have a composable API for building SQL queries where different elements are contributed by different parts of the code. From example, having your authorisation code apply restrictions to queries through where clauses, joins, etc. to ensure a user only sees the records they are allowed to see.

I currently spend a large proportion of my time working in a Java code base that uses JDBC directly. There are many places where the complexity of the work to be done means code is being used to assemble the final SQL query based on conditionals and then the same conditional structure must be used to bind parameter values. Yes, in some places there are entire SQL statements as String literals, but that only really works for simple scenarios. There are also many bits of code that wrap up common query patterns, reimplementing some of what an ORM might bring.

I recently implemented soft deletion for one of the main entities in the system, and having to review every query for the table involved to see whether it needed the deleted_at field adding to the where clause took a significant amount of time. I think better architecture supported by a more structured query builder would have made this much easier. For me that’s the main benefit of an ORM.

Comment · 2 years ago
I’ve been looking at codemod tools recently, just as a way to extend my editing toolbox. I came across https://ast-grep.github.io/, which looks like it might address part of this problem. My initial test case was to locate all calls to a method where a specific argument was ‘true’, and it handled that well - that’s the kind of thing an IDE seems to struggle with. I’m not yet sure whether it could handle renaming a variable though.

I guess what I’m looking for is something that

* can carry out the kind of refactorings usually reserved for an IDE

* has a concise language for representing the refactorings so new ones can be built quite easily

* can apply the same refactoring in multiple places, with some kind of search language (addressing the task of renaming a test parameter in multiple methods)

* ideally does this across multiple programming languages

Comment · 2 years ago
I tracked down more explanation in this message on the mailing list: https://mail.openjdk.org/pipermail/amber-spec-observers/2024...

It sounds like they are intending to rethink the design and that it may return in a different form in the future, but won't be in JDK 23.

Comment · 2 years ago

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton