Friday, August 21, 2026

Bread Pudding

Bread Pudding


Oven

350F


Saucepan

Milk - 2 cups
Butter - 2 tablespoons
Vanilla - 1 teaspoon
White Sugar - 1/3 cup
Salt - pinch

Warm up saucepan (not boiling)
Stir


Square baking dish

Butter sides
Bread - tear rough cubes to fill the bottom, maybe 1/2 loaf


Saucepan (add)

Eggs - 2
Whisk to mix
Pour over bread
Push down to coat


Bake

30..40 minutes
look for browned slightly crispy top

Sunday, August 16, 2026

2026.08.016

  • Really great smoothie with blueberries and yogurt.
  • Really great al pastor chicken. The recipe has been perfected. It's all random.
  • Mowing the lawn, small bites, always leave wanting more.


Saturday, June 28, 2025

AutoHotkey 2

 Recently decided to make use of the CAPS LOCK key to avoid having to move my hands to the arrow keys when I needed arrow key stuff. After a bunch of googling came across https://www.autohotkey.com/

My goal here was to have CAPS LOCK function normally if you press and release it, but if you press and hold, it should act as a modifier. I didn't see this as a pre-canned example, and after much questionable AI, decided to just code it from scratch. OK, AI helped a bit, but was really bad at hallucinations.

I decided on using ijkl for the navigation but I'm thinking now that maybe vim navigation is better. I'm having to stretch to get the end key while editing so that's probably a good thing to do as well. Home and end. And maybe that makes more sense with H being home, and ; being end since they are around the navigation. A work in progress I guess.

Here's what I ended up with:



#Requires AutoHotkey v2.0
#Include "C:\Users\nik\Documents\AutoHotkey\TapHoldManager\AHK v2\Lib\TapHoldManager.ahk"
#SingleInstance

capsHeld := false

;
; We got a Caps Lock
; If holding it, just set global flag
; If tapping it, send CapsLock on or off which toggles it
;

CapsLockHandler(isHold, taps, state) {
Global capsHeld
    if isHold {
        if (capsHeld = true) {
            capsHeld := false
        } else {
            capsHeld := true
        }           
    } else {
        Send("{Blind}{CapsLock}")
    }
}

thm := TapHoldManager()
thm.Add("CapsLock", CapsLockHandler)


;
; Handle keypress
;

*j:: {
    if capsHeld {
        Send("{Left}")
    } else {
        Send("{Blind}j")
    }
}

*k:: {
    if capsHeld {
        Send("{Down}")
    } else {
        Send("{Blind}k")
    }
}

*l:: {
    if capsHeld {
        Send("{Right}")
    } else {
        Send("{Blind}l")
    }
}

*i:: {
    if capsHeld {
        Send("{Up}")
    } else {
        Send("{Blind}i")
    }
}


; removeTooltip() {
;    ToolTip
; }
; ToolTip("CapsLock released")
; SetTimer(removeTooltip, -1000)

The ToolTip things being me adding in debugging messages.


Monday, March 31, 2025

Automated Installs, the old fashioned way

 I've used TheForeman and Canonical MaaS (and have heard of Cobbler), and while they can and do work, they can be a bit fiddly to understand, and if something goes wrong everything is so abstracted it can be hard to understand how things should be working and what you need to do to fix things.

So, I decided to take a step back and look at how you would configure automated installs the old fashioned way, by hand. This gives a better understanding on what's going off under the hood and helps debug things if you're having a problem with your pre-packaged bare metal deploy automation.

DHCP

First things, I'm using ISC DHCPD (I guess about time I swapped to something newer), and have a host entry like:

        host rockytest {
          hardware ethernet AB:CD:EF:D4:A2:BB;
          fixed-address 192.168.2.64;
          next-server 192.168.2.1;
          filename "rhel8/redhat/EFI/BOOT/BOOTX64.EFI";
        }

So this identifies my new system by MACADDR (hardware ethernet), gives it an IP address, and then next-server defines the TFTP server and the filename that should be retrieved for booting. I'm using EFI on this system, not legacy BIOS, so I identify the EFI boot file.

Powering on this box results in it doing a TFTP to 192.168.2.1 downloading and running that particular file.

TFTP

The tftp service by default doesn't log actual file transfers which is too bad because seeing these in the logs actually gives you more info on what things are trying, which also show where you have options for configuring things.

So, create a custom local override /etc/systemd/system/tftp.service by doing systemctl edit --full tftp, and add in "-v" to the tftp invocation so that things look like:

[Unit]
Description=Tftp Server
Requires=tftp.socket
Documentation=man:in.tftpd

[Service]
ExecStart=/usr/sbin/in.tftpd -v -s /var/lib/tftpboot
StandardInput=socket

[Install]
Also=tftp.socket

Do the usual systemctl daemon-reload and systemctl restart tftp to get things going.

So now after powering on the VM rockytest, we will see in journalctl -f the log entry for retrieving the EFI file:

RRQ from ::ffff:192.168.2.64 filename rhel8/redhat/EFI/BOOT/BOOTX64.EFI

Note, evidently journalctl only logs the successful transfers and not any failed transfer, so you are probably better off looking in /var/log/messages to see what else tftp is logging, particularly with the files that aren't found. Those are interesting since it shows some inner workings, more on that later...

Configs, configs, and more configs.

So now we have to put all the right files into the /var/lib/tftpboot directory. In our DHCP config we specified the EFI file was in the "rhel8" subdirectory, so the layout looks like:

rhel8/redhat/EFI/BOOT:
BOOTX64.EFI  grub.cfg  grubx64.efi  README.md

rhel8/images/pxeboot:
initrd.img  README.md  vmlinuz


For the EFI/BOOT directory, these files were retrieved as per my README.md:
wget https://mirrors.rit.edu/rocky/8/BaseOS/x86_64/kickstart/EFI/BOOT/BOOTX64.EFI
wget https://mirrors.rit.edu/rocky/8/BaseOS/x86_64/kickstart/EFI/BOOT/grubx64.efi
wget https://mirrors.rit.edu/rocky/8/BaseOS/x86_64/kickstart/EFI/BOOT/grub.cfg

So based on the /var/log/messages tftp entries, we can see things being retrieved:

in.tftpd[3400683]: RRQ from ::ffff:192.168.2.64 filename rhel8/redhat/EFI/BOOT/BOOTX64.EFI
in.tftpd[3400683]: Client ::ffff:192.168.2.64 finished rhel8/redhat/EFI/BOOT/BOOTX64.EFI
in.tftpd[3400685]: RRQ from ::ffff:192.168.2.64 filename rhel8/redhat/EFI/BOOT/revocations.efi
in.tftpd[3400685]: Client ::ffff:192.168.2.64 File not found rhel8/redhat/EFI/BOOT/revocations.efi
in.tftpd[3400686]: RRQ from ::ffff:192.168.2.64 filename rhel8/redhat/EFI/BOOT/grubx64.efi
in.tftpd[3400686]: Client ::ffff:192.168.2.64 finished rhel8/redhat/EFI/BOOT/grubx64.efi

So it retrieves the RHEL 8 BOOTX64.EFI, tries for some revocations.efi file, IDK, then downloads grubx64.efi.

Then things get a bit interesting as it looks for the grub.cfg file:
in.tftpd[3400687]: RRQ from ::ffff:192.168.2.64 filename rhel8/redhat/EFI/BOOT/grub.cfg-01-ab-cd-ef-d4-a2-bb
in.tftpd[3400687]: Client ::ffff:192.168.2.64 File not found rhel8/redhat/EFI/BOOT/grub.cfg-01-ab-cd-ef-d4-a2-bb
in.tftpd[3400688]: RRQ from ::ffff:192.168.2.64 filename rhel8/redhat/EFI/BOOT/grub.cfg-C0A80240
in.tftpd[3400688]: Client ::ffff:192.168.2.64 File not found rhel8/redhat/EFI/BOOT/grub.cfg-C0A80240
in.tftpd[3400689]: RRQ from ::ffff:192.168.2.64 filename rhel8/redhat/EFI/BOOT/grub.cfg-C0A8024
in.tftpd[3400689]: Client ::ffff:192.168.2.64 File not found rhel8/redhat/EFI/BOOT/grub.cfg-C0A8024
in.tftpd[3400690]: RRQ from ::ffff:192.168.2.64 filename rhel8/redhat/EFI/BOOT/grub.cfg-C0A802
in.tftpd[3400690]: Client ::ffff:192.168.2.64 File not found rhel8/redhat/EFI/BOOT/grub.cfg-C0A802
in.tftpd[3400691]: RRQ from ::ffff:192.168.2.64 filename rhel8/redhat/EFI/BOOT/grub.cfg-C0A80
in.tftpd[3400691]: Client ::ffff:192.168.2.64 File not found rhel8/redhat/EFI/BOOT/grub.cfg-C0A80
in.tftpd[3400692]: RRQ from ::ffff:192.168.2.64 filename rhel8/redhat/EFI/BOOT/grub.cfg-C0A8
in.tftpd[3400692]: Client ::ffff:192.168.2.64 File not found rhel8/redhat/EFI/BOOT/grub.cfg-C0A8
in.tftpd[3400693]: RRQ from ::ffff:192.168.2.64 filename rhel8/redhat/EFI/BOOT/grub.cfg-C0A
in.tftpd[3400693]: Client ::ffff:192.168.2.64 File not found rhel8/redhat/EFI/BOOT/grub.cfg-C0A
in.tftpd[3400694]: RRQ from ::ffff:192.168.2.64 filename rhel8/redhat/EFI/BOOT/grub.cfg-C0
in.tftpd[3400694]: Client ::ffff:192.168.2.64 File not found rhel8/redhat/EFI/BOOT/grub.cfg-C0
in.tftpd[3400695]: RRQ from ::ffff:192.168.2.64 filename rhel8/redhat/EFI/BOOT/grub.cfg-C
in.tftpd[3400695]: Client ::ffff:192.168.2.64 File not found rhel8/redhat/EFI/BOOT/grub.cfg-C
in.tftpd[3400696]: RRQ from ::ffff:192.168.2.64 filename rhel8/redhat/EFI/BOOT/grub.cfg
in.tftpd[3400696]: Client ::ffff:192.168.2.64 finished rhel8/redhat/EFI/BOOT/grub.cfg

So what's interesting here is it first tries a grub.cfg with 01-MACADDR, so we can have a custom grub.cfg for our specific system. If that's not found, it tries grub.cfg-IPADDRINHEX to get a specific config for the IP (listed in HEX), and then walks back on the filename to allow you to set up grub.cfg files for various network ranges.

In my case, experimenting, I just have a single grub.cfg, but ultimately, you're likely to want to have a grub.cfg per system.

The grub.cfg for the EFI looks like:

set default="1"

function load_video {
  insmod efi_gop
  insmod efi_uga
  insmod video_bochs
  insmod video_cirrus
  insmod all_video
}

load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2

set timeout=60
### END /etc/grub.d/00_header ###

search --no-floppy --set=root -l 'Rocky-8-10-x86_64-dvd'

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Install Rocky Linux 8.10' --class fedora --class gnu-linux --class gnu --class os {
        linuxefi rhel8/images/pxeboot/vmlinuz inst.repo=http://mirrors.rit.edu/rocky/8/BaseOS/x86_64/kickstart/
        initrdefi rhel8/images/pxeboot/initrd.img
}


I've trimmed this file down and changed from the default grub.cfg that was downloaded as per my README.md, but the interesting parts are the linuxefi and initrdefi entries:

        linuxefi rhel8/images/pxeboot/vmlinuz inst.repo=http://mirrors.rit.edu/rocky/8/BaseOS/x86_64/kickstart/
        initrdefi rhel8/images/pxeboot/initrd.img

Here we define where the vmlinuz and initrd.img files are coming from, so basically our TFTP directory, this time in rhel8/images/pxeboot/, where we downloaded the images as per note in my README.md:
wget https://mirrors.rit.edu/rocky/8/BaseOS/x86_64/kickstart/images/pxeboot/initrd.img
wget https://mirrors.rit.edu/rocky/8/BaseOS/x86_64/kickstart/images/pxeboot/vmlinuz

So after we choose menu entry 1 from the install screen, this results in TFTP activity:

in.tftpd[3400704]: RRQ from ::ffff:192.168.2.64 filename rhel8/images/pxeboot/vmlinuz
in.tftpd[3400704]: Client ::ffff:192.168.2.64 finished rhel8/images/pxeboot/vmlinuz
in.tftpd[3400706]: RRQ from ::ffff:192.168.2.64 filename rhel8/images/pxeboot/initrd.img
in.tftpd[3400706]: Client ::ffff:192.168.2.64 finished rhel8/images/pxeboot/initrd.img

So now the PXE/EFI installer has the vmlinuz kernel image and the initialrd disk image loaded, it passes control to the installer. Note that I updated the linuxefi line to specify inst.repo, which means that all the packages and other installer stuff is going to come from http://mirrors.rit.edu.

If we were fully automating this install, the grub.cfg would probably be custom for our IP address, and besides specifying inst.repo, it would also specify inst.ks=http://[whatever] so that we get a custom kickstart config for our particular system install that would specify defaults needed, etc.

Note also that ROCKY8 and ROCKY9 systems can use cloud-init for configuring rather than kickstart configs.

iPXE

So that's all cool for a FEDORA based system, and is all logical. What if you just wanted to boot some random ISO, like the ProxMox installer? This is where iPXE (https://ipxe.org) comes in to play. It provides a more enhanced PXE firmware that you can boot into, and optionally boot an ISO image using sanboot http://[whatever]/stuff.iso


Sunday, March 30, 2025

Verizon FIOS and IPv6

tl;dr - if you want to run IPv6 on an internal network with an internal router behind a FIOS G1100 router, you must carve up a different /64 network from the /64 the FIOS gives you on the LAN interface, and then also update the FIOS G1100 route table to have a static route to this different /64 network, passing it to the "WAN" interface of your internal router which is really just connected to the LAN interface of the FIOS G1100 router.



IPv6, it's been around for a while. Verizon supports it and if I look at my Verizon Fios-G1100 router, I can also turn on IPv6:



and Verizon gives me a /56 network. Fun Fact! That /56 network gives me 4,722,366,482,869,645,213,696 possible IP addresses. The number is four sextillion, seven hundred and twenty-two quintillion, three hundred and sixty-six quadrillion, four hundred and eighty-two trillion, eight hundred and sixty-nine billion, six hundred and forty-five million, two hundred and thirteen thousand and six hundred and ninety-six. That's a lot of IP addresses.

What's interesting is the Fios-G1100 is configured to act as a DHCP server and so gives out a /64 address on the LAN:


This /64 turns gives me 18,446,744,073,709,551,616 IP addresses which is only eighteen quintillion, four hundred forty-six quadrillion, seven hundred forty-four trillion, seventy-three billion, seven hundred nine million, five hundred fifty-one thousand, six hundred and sixteen.

So I have a singular Linux router behind my Fios-G1100 so I can have more options with experimenting with stuff, and on the Linux router on my public interface, I see:

3: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 1c:1b:0d:03:bb:ec brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.2/24 brd 192.168.1.255 scope global noprefixroute enp0s31f6
       valid_lft forever preferred_lft forever
    inet6 2600:1234:5678:abcd:1e1b:dff:fe03:bbec/64 scope global
       valid_lft 1258sec preferred_lft 1258sec
    inet6 fe80::1e1b:dff:fe03:bbec/64 scope link
       valid_lft forever preferred_lft forever

So it gives me out a singular /64, which is fine here. A bit strange that to Verizon I have a singular machine on my network. With the IPv4, I'm running NAT so get 192.168.1.2 here, with the Verizon router being 192.168.1.1. With IPv6, I get a public IP on the /64 network carved out from the /56 network. So that's one /64 network out of 255 possible in the /56. What was the challenge for me was that internally I wanted to have the /64 network available to all my boxes being my Linux router. That didn't work as I wanted to have the same 2600:1234:5678:abcd::/64 network on my LAN side of the Linux router that was the same as the /64 network on the WAN side of my Linux router, using the same /64 network assigned on the LAN side of the FIOS router. That confused routing of various things on the Linux side after setting up IP forwarding.

Here's how I was trying to define the LAN interface, which is wrong:

2: enp8s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 1c:1b:0d:03:bb:ee brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.1/24 brd 192.168.2.255 scope global noprefixroute enp8s0
       valid_lft forever preferred_lft forever
    inet6 2600:1234:5678:abcd:1e1b:dff:fe03:bbee/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::1e1b:dff:fe03:bbee/64 scope link
       valid_lft forever preferred_lft forever

After a fruitless week of googling, AI assistance, and generally learning about IPv6 and routing, getting all sorts of advice ranging from this should be just working, to I can turn off the majority of functionality in my FIOS router which should then enable a hidden "bridge mode" on the router which would in effect give the entire /56 to my Linux router WAN interface which would then let it carve that /56 into a /64 on the LAN interface. This may have worked, but then I would lose functionality of the FIOS router, including any out of the box firewall protection that I'm not yet confident enough I would be able to do in my Linux router.

The solution, as I stumbled across it, is to actually carve up a different /64 network for my internal Linux router LAN address and then configure the FIOS router to have a static route to that network:

2: enp8s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 1c:1b:0d:03:bb:ee brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.1/24 brd 192.168.2.255 scope global noprefixroute enp8s0
       valid_lft forever preferred_lft forever
    inet6 2600:1234:5678:abce:1e1b:dff:fe03:bbee/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::1e1b:dff:fe03:bbee/64 scope link
       valid_lft forever preferred_lft forever

The subtle part in there being my Linux router WAN interface (defined automatically by the FIOS router LAN side) is 2600:1234:5678:abcd:1e1b:dff:fe03:bbec/64, but my carve out for the internal LAN is 2600:1234:5678:abce:1e1b:dff:fe03:bbee/64. The notable difference being the "abcd" on the WAN side and the "abce" on the LAN side, so one address range higher in my /56 range given out by Verizon.

Then on the FIOS router, under the routing table:



I add a route entry with a Destination network of 2600:1234:5678:abce::/64 being sent to the Gateway of 2600:1234:5678:abcd::/64, which is the Verizon FIOS assigned LAN address that I am using for the WAN address on my Linux router. This makes sure that any packets that I have sent out that get returned to the FIOS router, it knows to just pass them off to my Linux router, which can then send them to my devices on my local IPv6 network.

None of this was obvious to me, and I suspect not many people are running their own custom Linux router behind the FIOS router and so don't need to do this additional route. I suspect people who are smart enough to run their own Linux router just inherently understand this route on the FIOS router thing, and so don't need guides on how to set it up. I am in this between world where I do need the guide, but also have the custom stuff internally that I sort of (?) understand. So here we are, me writing down this note since it took a week of figuring out and I wanted to immortalize the solution.


Thursday, July 4, 2024

Cloud-init and the curse of the YAML (and a potential solution! or at least idea)

 I recently took up cloud-init professionally as part of exploring modern(?) alternatives to kickstart for the on-premises private cloud. All worked fine, is all viable, after I actually figured out where to put the config entries...

Cloud-init has a couple of config files:

metadata:

#cloud-config
instance-id: test
hostname: test.localhost
network:
  version: 2
  ethernets:
    eth0:
      match:
        name: eth*
etc. etc. etc.

user-data:

users:
  - name: cloud-user
    ssh_authorized_keys:
      - ssh-rsa [our public key] root@our-bastion.localhost
    sudo: ALL=(ALL)     NOPASSWD:ALL
etc. etc. etc.

All looks good, looks reasonable. The challenge in getting this far was that in reading the docs it was not apparent at the time what config entries go in which file. For example, if I put things for the network in the user-data file it was parsed correctly and I could see the YAML was loaded correctly into the various python dictionaries in the code, but then later on it was just ignored. The docs note in vague ways that the metadata is for the environment and the user-data is specifics for this particular system. Which was what got me into trouble initially putting the network information in the user-data, IDK.

Looking at the code, using YAML for configuration and the easy way it's parsed and loaded into a dictionary is very powerful for adding configuration information to your software. The downside is if you name something slightly wrong or if you put something not quite in the right location, things will just be silently ignored. 

There are a couple of schools of thought here, and I've seen both professionally. One is that you should code things explicitly to look for the commands / statements and if there is something not explicitly recognized then you flag as an error. This style of coding is a bit of a challenge to modify, and in one particular case I've needed to extend multiple code locations so that a new argument/statement is a) parsed correctly (in one module), b) consumed correctly (in a different module), and then c) acted upon in a third module. A lot of work for just adding a similar statement, but it does mean if there's something not quite right, we will notice it right away. At the expense of making the code harder to work with and extend.

The second school of thought is that as configuration information is consumed, you only look for and act upon things you know you are looking for and acting on. This code is trivial to extend, you just add something to the "act upon" section and consume whatever it is you're looking for. The downside here is that if you add some configuration that's not quite right, likely it will just be ignored since nothing is looking for it.

This is the approach that cloud-init takes, and for good reason as there are multiple / modularized consumers all looking at the same dictionary and so any extension should be able to just consume whatever configuration it thinks it needs.

So this left me thinking, is there a way that we can have a central YAML file that is loaded into a python dictionary and that some overseer can look at the end and make sure that everything you specified was actually used? I think YES, based on a quick subclass of dict:

class NewDict(dict):
    def __init__(self, *args, **kwargs):
        super(NewDict, self).__init__(*args, **kwargs)
        self._used_flags = {key: False for key in self.keys()}


    def set_used(self, key, used_arg = True):
        # print(f"(Setting used flag for {key} to {used_arg})")
        if key in self:
            self._used_flags[key] = used_arg
   
    def is_used(self, key):
        _used_flags = self._used_flags.get(key,False)
        # print(f"(Getting used flag for {key} - it is {_used_flags})")
        return(_used_flags)

This NewDict provides all the same stuff for dict, but adds a set_used(), and an is_used() method where you can indicate if a dictionary config item has been used/consumed or not.

To use then you would do something like:

import yaml

with open('stuff.yaml', 'r') as file:
    data = yaml.load(file, Loader=yaml.FullLoader)

nd = NewDict
# Copy the yaml into our NewDict
for key in data:
    nd[key] = copy.deepcopy(data[key])

# Indicate some keys are being used.
nd.set_used('Stuff1')
nd.set_used('Stuff3')

# Report on keys not being used
for key in nd:
    if (not nd.is_used(key)):
        print(f"WARNING, {key} is actually unused you know.")

This way various modules can go through and consume (or re-consume!) whatever configuration is needed, and then at the end something could go through the dictionary and note when some key had actually not been used. Bonus points and cloud-init can also name the modules that were called so you get a sense of what modules you're actually using, and what config entries are actually needed.


Time to start blogging again.

 After a brief vacation, time to start brain dumping on this blog again. Who knows maybe I will tweet again too.

Thursday, January 16, 2020

Lost In Translation

Uniqlo Jeans Innovation Center notes:



Great, sustainable denim, I'm all in!





Special waterless washing.  Awesome.  (Hopefully they are not washing in gasoline or something like that.)





Hmm, hold on, if this is waterless, why does the water need to be recycled?  There is no water, what's to recycle?





Natural drying, air drying, I get it, nice.  But, why are these being dried if they are not even wet due to being waterless.

I think what might be going on here is it's "water" "less", as in using less water.  Maybe that's OK with water, but can you imagine meatless hamburgers?  There's still meat in them, but less meat so that means more vegan.  Meat-"less".  Or how about homeless?  You're not without a house, you just downsized to a smaller house, less house, less home, homeless.

We're onto you marketing people!

Wednesday, December 25, 2019

Bash batch. Converting .avi to .mp4 for import to Davinci Resolve

Bash makes things so easy for doing batch operations on a bunch of files.  I have a bunch of .AVI files from my old camera that Davinci Resolve won't handle.  ffmpeg converts well enough to .mp4 for import.  Since I have a bunch of clips, conversion is just a bunch of command lines:


$ for filename in *.AVI; do filepart=${filename%%.AVI}; if [ ! -e ${filepart}.mp4 ] ; then echo ffmpeg -i ${filepart}.avi ${filepart}.mp4; fi;  done | sh -x
 Formatting and readability is a bit fugly on the command line but this does it nicely.  As a bonus it sees if things are converted already and don't do a conversion.

Wednesday, November 27, 2019

Telephones

Quick article about how the US senate almost banned rotary phones - https://www.senate.gov/artandhistory/history/minute/Senate_Considers_Banning_Dial_Phones.htm

An old boss of mine had an amusing anecdote about somebody years ago saying that with the enormous growth of telephones in the US everybody would be employed as a telephone operator.  The amusing part of my boss' anecdote was that this person was actually right.  Since we type in phone numbers when we want to talk to somebody, we are in effect working as a phone operator.

Of course in good old 2019, we pretty much have contact apps universally available so we aren't likely to have to type in phone numbers any more.  Unless it's from the menu of the new restaurant that opened and we want to get takeout.

Friday, November 1, 2019

Statistics, lies, whatever.

Every now and then I hear the oft repeated $verylarge% of drivers consider themselves to be above average.  Ha ha, stupid drivers, you suck, you are really bad drivers, you just don't know it or worse don't want to admit it.  After all, being bad is one thing, but being unaware that you are bad, that means you are a general moron as well.

But, if we have a sample of drivers, one rates at a 2, three rate at a 10, the average rating is 3.2.  This would mean that the three scoring at 10, or 75% of the drivers are above average.  Waaaaay above average.

What am I missing here?

On Poverty

Interesting post - https://www.irishtimes.com/culture/why-do-so-many-americans-hate-the-welfare-state-1.4057860

US culture based on Protestant ethics.  European roots were later changed by various world wars to be more supportive of welfare whereas US was largely unaffected by those wars so the ethics lived on.

Professor Elizabeth Anderson notes:

“You know,” she says, “America was so dominantly Protestant for such a long time. We have a substantial number of Catholics but the culture was really shaped by Protestants – in term of their total cultural domination of the United States at its founding, and really continuing.”
One aspect of this, she highlights, is the adoption of a Protestant work ethic as a core value in society. This has a positive side – in honouring human labour – but it also has a negative side.
“There is a profound suspicion of anyone who is poor, and a consequent raising to the highest priority imposing incredibly humiliating, harsh conditions on access to welfare benefits on the assumption you’re some kind of grifter, or you’re trying to cheat the system.
“There is no appreciation for the existence of structural poverty, poverty that is not the fault of your own but because the economy maybe is in recession or, in a notorious Irish case, the potato crop fails.”

Saturday, October 12, 2019

Energy

Energy, here on earth, is apparently finite.  We power things with oil and natural gas which is a finite resource held within the bounds of the sphere that we live on.  In the world of the future though, we anticipate getting this energy from the sun, a large glowing sphere nearby.  You could imagine though that solar energy is also finite in the sense that the earth has a finite surface area with which to capture the solar energy.  Could it be in the future that our resource demands are so great that we would admonish people who were wasting solar energy?  Why isn't that square meter being used to capture solar energy or being used to power the photosynthesis for plant xyz?  What a waste, such a shame!

Say what?

Great article from Paul Graham - http://www.paulgraham.com/say.html.  It's from 2004.  It's timeless.  The man is a genius.  Or maybe he is totally wrong and I just agree with him.  Read the article.

Edit:  Interesting somewhat related article I was directed to.  https://slatestarcodex.com/2017/06/21/against-murderism/

Friday, October 11, 2019

Maintenance?

Now this is an interesting read.  http://themaintainers.org/blog/2019/7/30/why-do-people-neglect-maintenance.  I often see a sort of tension between maintaining something and ignoring it and replacing it after a period of time.  It's almost as if we think that one strategy is universally better than the other.  Really we should be thinking about characteristics that make it a better choice in some cases.

Thursday, October 10, 2019

Smart coral polyps?

From https://phys.org/news/2019-10-dead-corals-regrow-fatal.html

But the researchers found that in 38 percent of the impacted colonies, the polyps had devised a survival strategy: shrinking their dimensions, partly abandoning their original skeleton, and gradually, over a period of several years, growing back and starting a new skeleton.

Should I actually read that as the polyps that did not shrink died off whereas those that were able to shrink survived and were  able to survive and grow back over a period of years?  Some polyps shrink due to the problems, some just die off?  Guess which ones we see around after a longer period of time?

This is just like the cats that died when exposed to sunlight.  Those all died off and were not able to reproduce and we are not aware of them at all since all we have left are cats that are OK with sunlight.

Friday, September 27, 2019

Never good at lisp

Back in the day when I was learning lisp, I would have a hard time understanding constructs that were just too nested.  I would see things like:

something(somethingelse(trythis(internalpart(updateothers(runstuff)))))

I can see a similar thing happening sometimes with Python where it's easy to keep wrapping object calls together and you end up with hard to decipher code:

something(parameter).object(otherthing(innerpart).state(optionalrewind))

There are some people who talk in similar ways at work and use parenthetical sub clauses before getting to the actual point and I have a hard time following what the actual point is:
We need to figure out, and not necessarily now, but at some point in the near future perhaps when we can get a consensus or when the time is right but not just because we want to be opportunistic agnostic, what, or perhaps even first why or maybe the rationale behind this and related activities that you and according to at least a couple of other people although this is just third party because I haven't heard directly from them but I have been able to glean by reading between the lines of interactions, our next steps should be.

Parsing that out, the real meat of the sentence is (in bold):
We need to figure out, and not necessarily now, but at some point in the near future perhaps when we can get a consensus or when the time is right but not just because we want to be opportunistic agnostic, what, or perhaps even first why or maybe the rationale behind this and related activities that you and according to at least a couple of other people although this is just third party because I haven't heard directly from them but I have been able to glean by reading between the lines of interactions, our next steps should be.

I think as a consumer or target of the conversation I would like to hear the bold part first and can then get the rest of the sentence after.  Or perhaps the rest of the sentence is background and I should get that first.  But I have a heck of a time trying to keep the idea in my head when it's at the beginning, middle, and end, of a bunch of parenthetical remarks.

My point of this whole post (irony, I'm only getting to it now), is that I have a heck of a time reading and understanding news headlines that seem to string together everything into one sentence

[something...] according to police reports via court order leaked by the assistant to the then deputy director who had been allegedly deposed by the now acting associate vice president under executive approval as reported to news personnel by an anonymous tip said the ex chief after hearing reports of this on Thursday from his staff.

What is there some sort of rationing on periods and capital letters that we could not break this up in to digestible sentences?

Saturday, September 14, 2019

Well done!

I'm starting to look a bit more into neural networks.  More to come on that later, but in the deeper parts there are matrices and various calculations.  I noticed that the creators of the numpy package did a really great job in making sure that things are displayed in a nice way that makes it easier to see what is going off.  For example, if we create a matrix with:

(python) x=np.array([[1,2,3],[4,5,6],[7,8,9],[10,11,12],[13,14,15]])

when you go to print it out you see:

(python) x
array([[ 1,  2,  3],
       [ 4,  5,  6],
       [ 7,  8,  9],
       [10, 11, 12],
       [13, 14, 15]])

What is really great here is that as the numbers increase in length, the output is shifted so all the columns line up.  Yes, this isn't rocket science genius, but it goes a long way to making things readable and understandable.  In the "computer" world often we just print things out and leave it up to the person to mentally align and figure things out.  I find that people who often do that sort of messy output are people I have to remind that the computer actually works for us, not the other way around.  If we take 10 minutes to make the computer do a bit more work (ex. line up the columns) then it has made things (in this case comprehension) easier for us.  Let the tool do the work for you!

Friday, September 6, 2019

Jumping to conclusions, part 1

Just started reading American Overdose, the Opioid Tragedy in Three Acts.  I'm on the first page, Introduction: An Epidemic Foretold.  It starts out:
Karen Jennings had once been a manager at McDonalds.  Walking home a little the worse for drink, she fell into a creek and broke her back.  The doctor prescribed painkillers to ease her through the pain of recovery.
and then goes on to talk about the spiral of addiction.

So, leaping to conclusions here, it's almost like that second sentence, "the little worse for drink", which is perhaps just glossed over as accidental, could actual be contributing to the condition, namely that Ms. Jennings might have other issues contributing to addiction.

We will see how the book progresses, but I've always wondered why some individuals can apparently safely take opioids and not spiral into addiction.  What percentage of the patients is that, do 50% not become addicted?  75%, 90%?

Another article I have read in the past was related to a study of rats where in a controlled environment rats could self medicate by pressing a button to receive something (cocaine, opioids?) and they rapidly became addicted.  However, the article continued, the rats were in a cage with nothing but the button.  Other rats in a similar experiment were in a cage with rich rat entertainment, wheels, things to play with, etc.  They found those rats occasionally pressed the button to medicate, but not to the level of addiction that the isolated rats did.  The premise of the article was that addiction isn't fully the chemical itself but also the environment.  They drew parallels with the Vietnam war where there was a lot of drug use when in Vietnam due to needing to mentally escape the horrific situation, however when those soldiers returned back to the US, the drug use mostly dried up since they were back in a normal environment.

In Ms. Jenning's case when she was walking home "the little worse for drink" (kudos for not driving BTW) I have to wonder if she was also not in a bad place to start with that also "fed" into the addiction.

Anyway, good read so far, on page 1.  We will see where the book goes.

[Edit *2019-05-14*]
Became curious about why some people become addicted to alcohol and not others.  Google was challenging because a lot of the answers were about dangers of addiction and how to detect, why it is bad, etc.  But I was looking for scientific reasons...

Found this - https://www.healthline.com/health-news/lateral-habenula-responsible-for-alcholism-040814#3

which incidentally had this gem:

“Whether one is going to use drugs or not is a choice based on what the alternative reinforcers are,” he said. “If you have nothing else to do and life is not very pleasant, if you are a social creature—for example, a rat, and you are solo-housed in a boring environment as rats are generally housed for experiments, in that setting it is very easy to get animals to self-administer drugs. If one has them in an enriched environment in which they can socialize, have sex, groom, all those things that rats like to do, then it’s much more difficult to get them to self-administer drugs. It’s much more difficult to induce something that looks like an animal model of addiction.”It’s a fair bet that if humans were forced to live in the same conditions as the rats in Taha’s experiment—alone, in a tiny cage, with nothing to do—and given unlimited access to drugs, they might pass the time by using drugs, too.
They note that genetics may be involved namely that the inability of the lateral habenula region to respond to negative outcomes (painful stimulus for example) prevents us from avoiding those actions in the future.  In rat simulations they artificially damaged the lateral habenula in some rats and noticed that they did not avoid actions which later had negative outcomes.

Alcohol use is interesting as 'small' use has small euphoric effects and a small (non-existent?) negative effect, so continued/occasional use (which we note as not being an alcoholic) is not an issue.  If occasional 'large' use has a large negative effect but this negative effect does not cause us to avoid these large use activities in the future then this pattern could be repeated (also necessitating larger use due to tolerances increasing) then this is what we are calling alcoholism.

It's quite interesting that even in this "modern age"(!!!) we cannot have these conversations without dragging in stigma or perceptions of mental weakness.  "Why isn't he trying harder, he's just giving up too easy, he is too weak" type observations.

Go and read the healthline article, it's really good.

On the American Overdose book thread, unfortunately it's just a continuation of stories of addiction, how lives were ruined, how bad corporations took advantage of the situation to make lots of money.  There are occasional glimpses of questions as to why only certain regions were being hit by this (which may play into the conditions paragraph as noted by the Healthline article).  But otherwise it's just a "this is terrible and unacceptable" type book.  As with people with similar attitudes (serial complainers) I often find this tiresome.  Slightly less worse are people who try to do something about it but unfortunately have not taken the time to really understand the issue and so solutions are just random and amount almost to a cargo cult type response.

Monday, March 4, 2019

Disk Performance

Recently got a Synology DS1819+ and did some performance benchmarks.

Looked around at a bunch of perf benchmark tools and settled on CrystalDiskMark 6.0.1 (although I downloaded and installed from the Microsoft Store - quick/easy install (free)).

Ran on the old Synology DS215J and on the new Synology DS1819+

Results from a CIFS mount of a folder.

DS215J:




DS1819+:



OK, so way better caching on the random reads and writes.  The sequential is about 30% better.

Disks behind the test are:

DS215J    - 2 WD30EFRX-68EUZN0 - 3TB 5400RPM WD Red disks
DS1819+ - 2 WD40EFRX-68N32N0 - 4TB 5400RPM WD Red disks


Interesting to note the WD30EFRX has 147MB/s interface speeds, the WD40EFRX has 150MB.  The 2GB model WD20EFAX has 180MB/s interface speed and 256MB cache whereas the other models have 64GB cache.  Strange difference, 2GB model seems to be much better.

There are no real specs of I/O perf of these models but the assumption is newer ones have higher areal density so better (faster) I/O.