Jun 082019
 

Quite a while ago, I “borrowed” some inscrutable zsh magic to automatically add the contents of ~/.ssh/known_hosts to a known_hostsi variable and used that variable to perform host name completion for certain commands. Once ssh started hashing the known_hosts file, this broke and I was busy at the time and stopped using it.

Ages later, I’ve fixed it and enhanced it a bit (and arguably made it a bit simpler). Not only does it pick up host names from the known_hosts file but also adds a list from lxc-ls and adds a few static host names (with one exception, not shown). This is done by adding the following to .zshrc :-

knownhosts=( $(sudo -b lxc-ls) )
#       Pick up a list of hosts from lxc-ls
knownhosts+="localhost"
#       Add static hostnames
for x in $(grep -v "|" ~/.ssh/known_hosts | awk '{print $1}' | awk -F, '{printf "%s ", $1}')
do
  knownhosts+=$x
done
#       Pull a list of hosts out of ~/.ssh/known_hosts excluding the Hashed hosts.
zstyle ':completion:*:(ssh|scp|sftp|ping|nmap):*' hosts $knownhosts
#       Commands to use a list of known hosts with

That probably is not the most efficient code, but does have the advantage that it is relatively easy to follow.

One addition is to add the option HashKnownHosts no to ~/.ssh/config.

There is of course a risk associated with disabling the hashing of host names within the known_hosts file. If your host becomes compromised, malicious code can use that file to obtain a list of hosts with which there is a trust relationship making it easier for an attacker to pivot through your network.

Jun 052019
 

On previous occasions (yes that does mean more than once) I have messed around with the network configuration of containers to get :-

  1. A consistent behaviour.
  2. A fixed IPv4 address with no DHCP configuration (this one is easy).
  3. A fixed IPv6 address with no autoconfigured global addresses (this one has been tricky)

This turns out to be relatively easy providing that you configure the addresses within the container rather than within the container configuration. At least it looks good to go so far (I’ve been mistaken in the past).

The container configuration is quite simple :-

lxc.net.0.type = veth
lxc.net.0.flags = down
lxc.net.0.link = br0

Note that the bridge interface (br0) may be different. Also note that there is no lxc.net.0.ipv4.address, lxc.net.0.ipv4.gateway, lxc.net.0.ipv6.address, or lxc.net.0.ipv6.gateway.

The configuration within the container is dependent on what userland you are running, but for Debian (and Ubuntu if you’re not using Netplan) :-

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
    address 10.0.0.34/16
    gateway 10.0.0.1

iface eth0 inet6 static
    address 2001:0db8:cafe:dead:0000:0000:0000:3eb/64
    scope global
    gateway 2001:0db8:cafe:dead:0000:0000:0000:0001
    privext 0
    accept_ra 0
    autoconf 0

Not sure quite which options are required but having all of “privext 0”, “accept_ra 0” and “autoconf 0” does mean no additional autoconfigured IPv6 addresses.

(And no the part number of this post isn’t anything more than a joke)

May 282019
 

The European election results in the UK are being commonly classified as an enormous victory for the Brexit Party. Which is regrettably true, but not quite the whole truth.

If you were to take a list of the numbers of MEPs each party got :-

PartyMEPs
The Brexit Party
29
Liberal Democrat16
Labour10
Green7

You can see that if the next three parties were to hold a pact, they could outvote the Brexiteers every day and twice on every Sunday. Interestingly enough, whilst the Brexit party got 5,248,533 votes, the petition to revoke Article 50 got 6,085,584.

Which seems to indicate that whilst Brexit is the largest ‘party’ in the European elections, the remainers have actually got a slim majority!

May 242019
 

Everyone else does a list of photography tips, so why shouldn’t I? No reason at all, so here goes :-

#0: Do It Slower

Digital photography makes making an image so quick and easy that it is too tempting to just shoot and worry about what is good later. Not much room for carefully planning and taking your time.

A good half of the bad images I make are because I didn’t slow down.

#1: Rules Are There For A Reason

“Rules are made to be broken” goes the facile saying. And there’s an element of truth to it, but the rules of composition are there for a reason.

For tens of thousands of years, artists have been coming up the rules of composition – the rule of thirds, the golden ratio, leading lines and curves, negative space, etc. There’s a reason why they exist – they work.

And don’t imagine that because photography is different that the rules don’t apply – it isn’t that different.

That is not to say rules should not be broken, but that every time you break the rules, you should be able to say why. And preferably with something better than “just because”.

#2: Gear is Good; Gear is Bad

There is a kind of photographer who buys the very latest gear all of the time; there is a kind of photographer who sticks to the camera they bought 10 years ago.

Neither is right nor wrong. New gear can make technical improvements to the produced image but will never improve the artistic quality.

#3: Shoot RAW

There is of course a temptation to just shoot jpeg especially as that is how all our images end up; why not let the camera do all the hard work? But there are a whole rafter of reasons why you should shoot raw :-

You can change your mind with raw – I mostly shoot black and white, and I can’t add colour back in afterwards. You can “fix” the exposure far more with raw than with jpeg.

Because the process of developing raw into jpeg takes time, you are free to spend extra time improving the final image. That time often makes the difference between a casual snapshot and something that goes beyond that.

#4: Criticism Is Good And Bad

We often seek confirmation that some of our images are good and that we aren’t wasting our time. Nothing wrong with that, and any constructive criticism can be good.

But we need to be wary of what is being judged, because it is rarely purely about whether an image is good or bad. For example, I often upload my better images to EyeEm where there are essentially two different “criticisms” :-

  1. Likes. People click that like button because they like the image; a lack of likes doesn’t necessarily show that an image is bad. Popular photographers get more likes than unpopular photographers, but that doesn’t necessarily mean their images are better.
  2. Being added to the market. That means your picture is sell-able not that it is good. And if an image doesn’t get added, it means that it isn’t sell-able. Just that.

In the end, an image is only good if it sings to you. And if it sings to you, then it doesn’t matter what anybody else thinks.

The Railings

Unless of course you are not aiming for “good” but “sell-able” or “likeable”.

#5: Practice

Musicians practice every day for hours; and photographers have to practice too. Learning the technical aspect of the camera is the least of it.

Practice with the camera; practice without it – practice looking for images on your daily commute. Get your eye into the habit of looking for compositions even in the most boring sights that you see every day.

WP2FB Auto Publish Powered By : XYZScripts.com

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close