HN user

mhw

1,794 karma

Building things on the internet since the early nineties.

https://dangerous-techniques.com/

Posts91
Comments258
View on HN
byroot.github.io 1y ago

Database Protocols Are Underwhelming – byroot's blog

mhw
4pts0
errorprone.info 1y ago

How to Think About Time

mhw
3pts0
www.outseta.com 2y ago

Global Sales Tax Compliance and Remittance

mhw
1pts0
github.com 4y ago

Lean Branching – a Git branching model to keep clean history

mhw
2pts1
adambird.com 4y ago

Back to EU

mhw
145pts104
boringrails.com 6y ago

Writing Better Stimulus Controllers

mhw
1pts0
ankane.org 6y ago

New ML Gems for Ruby

mhw
1pts0
support.google.com 6y ago

My Google Calendar Has Suddenly Disappeared Completely from My Mac Book Pro

mhw
2pts0
www.speirs.org 6y ago

On Switching from iPad to Chromebook in School

mhw
8pts0
mjtsai.com 7y ago

Why Do Web Browsers Allow Access to the Local Network?

mhw
2pts0
robots.thoughtbot.com 7y ago

Announcing: Our Online Learning Platform Upcase Is Now Free

mhw
19pts3
babeljs.io 7y ago

Removing Babel's Stage Presets – Babel

mhw
2pts0
blog.sonos.com 8y ago

An Update on Speaker Support for AirPlay 2 – Sonos Blog

mhw
2pts0
usn.ubuntu.com 8y ago

USN-3531-1: Intel Microcode Update – Ubuntu

mhw
4pts0
dangerousprototypes.com 9y ago

DIRTY CABLES: Cheap custom cables available now

mhw
2pts0
blog.whatwg.org 9y ago

The WHATWG Blog – The Developer’s Edition of HTML Makes a Comeback

mhw
1pts0
railscasts.com 9y ago

RailsCasts Pro episodes are now free

mhw
10pts0
popbitch.com 9y ago

For Whom Libel Tolls

mhw
1pts0
www.theguardian.com 9y ago

The 50 best podcasts of 2016

mhw
1pts0
www.computerworld.com 9y ago

Apple’s new MacBook Pro may be the world’s fastest stock laptop

mhw
2pts4
www.bbc.co.uk 9y ago

It's the data, stupid

mhw
2pts0
www.theguardian.com 9y ago

Many car brands emit more pollution than Volkswagen, report finds

mhw
3pts0
github.com 9y ago

Segment Sources for MySQL, PostgreSQL and MongoDB

mhw
2pts0
www.zerotier.com 9y ago

The ZeroTier Rules Engine: Capability-Based Security for Virtual Networks

mhw
3pts0
medium.com 9y ago

Design Better Data Tables

mhw
3pts0
github.com 10y ago

ZeroTier SDK and User-Space Networking Stack

mhw
4pts4
www.brightbox.com 10y ago

Official Ubuntu images and trademarks

mhw
3pts0
www.techdirt.com 10y ago

Lavabit Founder Reveals Non-Secret That Feds Were After Ed Snowden's Emails

mhw
3pts0
www.brendangregg.com 10y ago

Ubuntu Xenial bcc/BPF

mhw
3pts1
m.signalvnoise.com 10y ago

Why we need paid family leave in the U.S

mhw
1pts0

I've worked with git using the mega-merge approach, and one thing I found is that git-absorb won't merge commits into anything that precedes a merge. It works fine for absorbing changes into earlier commits on a feature branch, but not from the WIP branch back into the multiple feature branches that are the parents of the mega-merge. jj handles this with no problems.

From this comment on the git-absorb issue tracker I wouldn't expect it to be fixed soon either: https://github.com/tummychow/git-absorb/issues/134#issuecomm...

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.

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

A related tool that I've found useful over the years is Unison [1]. Think of it as rsync where you can interactively adjust the reconciliation algorithm between the two sides of the sync connection. It stores a hash of the file contents from the previous run for each file, so it can work out whether each side has changed since the last run. It then presents you with a GUI (or TUI) to review and adjust the reconciliation.

For the periods of my career where I've lived the two computer life (desktop and laptop), I've used Unison to keep substantial parts of my home directory in sync between the two machines.

[1] https://github.com/bcpierce00/unison

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.

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).

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.

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.

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

Tiling left / right etc? Doesn't exist

Sure it does - long press on the green maximise button and you get a little drop down. For me it includes "Enter full screen", "Tile Window to Left of Screen" and "Tile Window to Left of Screen". Tiling is like full screen but with two apps side-by-side rather than one.

If you want to maximise a window instead of going full screen (that is, make it as big as possible but not overlap the menu bar or dock), Option+Click on the green button or double click the title bar. macOS calls this "Zoom". Safari is atypical in that maximising it only changes the window's vertical height, but pretty much everything else maximises height and width.

All these options are on the 'Window' menu as well.

I’m designing a piece of user interface at the moment, and one thing I’ve been puzzled by is whether keyboard shortcuts should affect the focussed element. I’d love to find out if there are best practices in this area, and particularly if there are accessibility concerns I may not spot.

As an example, consider a page that primarily contains a list of items. I set each item up to be a focus target so tabbing through the targets will select each list element in turn.

If I add keyboard shortcuts to navigate the list (e.g. up/down cursor to select previous/next element), should my JavaScript drive focus to the selected element, or should I use an independent mechanism (adding a class, say) to mark the active element? Driving focus feels like the more ‘native’ approach, but I don’t know if there are downsides to potentially taking focus away from other elements on the page (for example).

Standard Ruby 1.0 5 years ago

If you want to use standard’s defaults, but add your own tweaks:

  # .rubocop.yml
  inherit_from:
    - https://raw.githubusercontent.com/testdouble/standard/master/config/base.yml
  
  Style/TrailingCommaInArrayLiteral:
    Enabled: true
    EnforcedStyleForMultiline: consistent_comma
  
  Style/TrailingCommaInHashLiteral:
    Enabled: true
    EnforcedStyleForMultiline: consistent_comma
  
  # add further tweaks as needed
and just use rubocop’s CLI

I just flashed Tasmota on to three Sonoff S26’s without any soldering. I did need a USB to serial adapter to connect to the serial and power pins - I got one that included an ESP-01 so I knew it should work [0]. I also needed some bits of wire and crocodile clips, but that's all. The S20 is easier by all accounts, but I didn't know that until I'd already got the S26's. Having three to flash, I was motivated to figure out a solution that didn't involve soldering.

[0] https://www.amazon.co.uk/gp/aw/d/B07KF119YB

This really should be titled "How Ruby on Rails Could Be Much Better for Shared Hosting", as that's where the issue really was for Dreamhost at the time. In a shared hosting environment back then:

* You didn't get root shell access. Dreamhost were (and still are) one of the good platforms in that they allowed shell access at all. Many shared hosting platforms didn't even do that, requiring you to upload files using FTP.

* The services provided were generally ones where a single server process (or processes) could serve a large number of shared hosting tennants: a web server with many virtual hosts, PHP applications running within that shared web server, jabber services, mail services, etc.

* All web server configuration was either through the control panel or .htaccess files, because you were sharing the web server instance with everyone else on your shared server.

* The economics of shared hosting meant you couldn't keep processes running for each individual hosting user for an extended period of time: memory was just too expensive to dedicate that way.

Rails didn't really fit this model: a production Rails app loads all the code in to memory and then expects to run for a number of hours serving requests. Shared hosting required these processes to shut down when there was no traffic to the site, and then start up on demand when a new request for the app came in. So the fundamental problem was not "Ruby on Rails needs to be a helluva lot faster", it was "Rails is too slow to start up to serve a single HTTP request and then be shut down again".

I did run a production Rails app on Dreamhost shared hosting for a while: it seemed to receive just enough traffic not to get killed, but not so much that it became an issue. But as soon as virtual server hosting became cheap enough to make the jump, we moved.

Microsoft are allowed to do so in this case because they are the owners of the software - they can license the software they own under any terms they want. In this case though, I'm sure there will be terms that prevent you from offering the VMs as a service to others for a fee.

Microsoft are definitely not 'someone' in the sense OP intended.