HN user

radialbrain

95 karma
Posts0
Comments24
View on HN
No posts found.

The solution to that is to use the IdentityFile directive in your ~/.ssh/config with username / hostname expansion. I use:

    Host *
        # Disable SSHv1
        RSAAuthentication no

        # Only use a key explicitely provided by an IdentityFile directive
        IdentitiesOnly yes

        # %h expands to the hostname, and %u to the username
        IdentityFile ~/.ssh/%h/%u.key
This ensures that at most one key is used, and prevents me from having to modify my config every time I generate a key for a new host.

You can have a static route to any local device, this is essentially what subnet membership does.

For example, if I have IP 192.168.0.2/24 assigned to eth0, my routing table will have:

  192.168.0.2/24 dev eth0 proto static scope link
I'm free to add a local route to a device outside 192.168.0.2/24 though:
  192.168.10.1 dev eth0 proto static scope link
This just indicates that I should be able to resolve the MAC address associated with 192.168.10.1 through an ARP query, same as other devices on my subnet.

Slightly related question:

They mention segregating their customers into separate /24s, and consequently having to assign an IP from every one of these subnets to the router for use by the customer as a gateway.

Is there any reason why they couldn't get rid of these by having customers set up a static route to the "primary" IP of the router (migration / configuration issues aside)?

I think he meant dual booting as in installing two operating systems side by side, and running one at a time on bar metal - not virtualizing anything.

Completely agree with you here - there should never be the need to hardcode file names in a makefile or repeat a rule multiple times - just use pattern rules.

I can't say I share your love for make's built in rules. I find using them often just makes the build system harder to understand and debug. I usually disable all of the built in ones using:

  # Disable built in suffix rules
  .SUFFIXES:

  # Disable builtin pattern rules
  MAKEFLAGS+=-r

To anyone implementing the automatic dependency generation mentioned in this article, you can actually make things even simpler by combining the compiling and dependency steps.

This works because if you add a new dependency to a file, that information will only be needed for the next build - the current file will already be considered out of date seeing as it was edited to add the #include.

  gcc -MD -MP foo.c -o foo.o
Will compile foo.c into foo.o, and also generate foo.d (-MD). Foo.d will contains make style dependencies, and also a phony target for every dependency (-MP). This allows you to delete dependant files, as make considers the target of a rule that has no perquisites or commands to be up to date if said target does not exist.