<![CDATA[Doyle's Blog]]>https://doyleyoung.net/https://doyleyoung.net/favicon.pngDoyle's Bloghttps://doyleyoung.net/Ghost 5.25Fri, 14 Feb 2025 18:55:03 GMT60<![CDATA[Year in Books 2021]]>Like most other things in 2021, my reading output sucked.  So did my blog posting AND my originality in entire posts. But, I did read some excellent books as my goodreads Year in Books shows.  My favorite would have to be Void Star by Zachary Mason.  This

]]>
https://doyleyoung.net/year-in-books-2021/626afda3c6830a0428318260Thu, 28 Apr 2022 21:05:56 GMTLike most other things in 2021, my reading output sucked.  So did my blog posting AND my originality in entire posts. But, I did read some excellent books as my goodreads Year in Books shows.  My favorite would have to be Void Star by Zachary Mason.  This is one of those books that I read because of its genre, age, rating, and the fact that a recommendation algorithm said I would like it.  This time the algorithm got it right and this is one I will probably read, again.  The huge number of Attack on Titan books I read were also excellent, but it's hard to pick a single one to call out.  Finally, they began transforming my favorite novel Dune into a graphic Novel and the results are excellent.

]]>
<![CDATA[Year in Books - 2020]]>Like most other things in 2020, my reading output sucked.  But, I did read some excellent books as my goodreads Year in Books shows.  My favorite would have to be The Stars My Destination by Alfred Bester.  This is one of those books that I read because

]]>
https://doyleyoung.net/year-in-books-2020/5ff33bbd58093b047d71382aMon, 04 Jan 2021 16:14:41 GMTLike most other things in 2020, my reading output sucked.  But, I did read some excellent books as my goodreads Year in Books shows.  My favorite would have to be The Stars My Destination by Alfred Bester.  This is one of those books that I read because of its genre, age, rating, and the fact that a recommendation algorithm said I would like it.  This time the algorithm got it right and this is one I will probably read, again.  The other stand out this year was Dark Age by Pierce Brown, which is not the best book in the Red Rising series, but it is still a solid continuation of an excellent story.

]]>
<![CDATA[C.H.I.P. as a Pi-hole]]>I resurrected a couple C.H.I.Ps a while back and they have just been gathering dust since.  I decided to try out the latest Pi-hole because it has been years since I played with it.  I was digging through my single board computer bag and found

]]>
https://doyleyoung.net/c-h-i-p-as-a-pi-hole/5e9c762133d550048749e603Sun, 19 Apr 2020 16:57:16 GMTI resurrected a couple C.H.I.Ps a while back and they have just been gathering dust since.  I decided to try out the latest Pi-hole because it has been years since I played with it.  I was digging through my single board computer bag and found a C.H.I.P. and decided it should work as well as anything.  I kept digging through my old parts and added some pieces:

  • an ancient TRENDnet USB to ethernet adapter that only supports 10Base-T and USB-1
  • the shortest ethernet cable I own
  • an old phone charger
  • the shortest USB mini cable I own

Most of these things were just taking up space and they were definitely at the end of their usefulness, but they ended up being just what I needed.

The completed hardware!

With the pieces assembled, I fired up the C.H.I.P. (named chip_is_dead) and logged in to install the Pi-hole.  But, good ol' Debian Jessie had some issues updating in the modern world so I had to tweak a couple things:

sudo apt-get install apt-transport-https

Then, I had to update the apt sources.list:

deb http://cdn-fastly.deb.debian.org/debian/ jessie main
deb-src http://cdn-fastly.deb.debian.org/debian/ jessie main

deb http://security.debian.org/ jessie/updates main
deb-src http://security.debian.org/ jessie/updates main

deb http://archive.debian.org/debian jessie-backports main
deb-src http://archive.debian.org/debian jessie-backports main

deb http://chip.jfpossibilities.com/chip/debian/repo jessie main
/etc/apt/sources.list

After a quick update/upgrade, I was finally able to run the lazy/insecure pipe-to-bash installation:

curl -sSL https://install.pi-hole.net | bash

And off it went:

The install is very well automated and only asks a few questions to be sure you get the setup you want.  I opted for using all their blacklist providers and also installed the included web dashboard and management site.  

Pi-hole dashboard

I plugged the finished product into one of the LAN ports on my ISP provided router, and set up a static IP.  Then, I added chip_is_dead as the DNS resolver on my actual, useful, functional router.  Now the whole family is enjoying less ads and they are completely unaware of it.

]]>
<![CDATA[Year in books 2018 and 2019]]>I just realized I haven't posted my year in books for two years.  I read 40 books with a goal of 40 books in 2018, and read 34 books with a goal of 40 books in 2019.

2018 was the year I started reading the Red Rising

]]>
https://doyleyoung.net/year-in-books-2018-and-2019/5e932c0d33d550048749e5b3Mon, 13 Apr 2020 22:00:00 GMTI just realized I haven't posted my year in books for two years.  I read 40 books with a goal of 40 books in 2018, and read 34 books with a goal of 40 books in 2019.

2018 was the year I started reading the Red Rising saga by Pierce Brown.  I think it is really well done and it was definitely my favorite book from that year.  I also finished up Bleach which was a series that I have been reading for a very long time, I will miss it.  My surprise of the year was Night Circus by Erin Morgenstern.  My wife read the book and really liked it and gave it to me.  I read the description and did not think I was going to like it, but I read it anyway.  I am glad I did, it is a great story in a well created world.

I think 2019 is the first year since I started that I did not reach my reading goal. I really enjoyed The Stand graphic novels, it had been a really long time since I read the original story and the comics reminded me why I have such fond memories of the book.  I also read A Dance with Dragons which I had been holding on to for a couple years because I did not want the Game of Thrones to be over.  It lived up to the hype and just made me, like everyone else, eager for the way too long awaited next installment.

Let's see if I can remember to get this post out sometime in 2021.

]]>
<![CDATA[Nextcloud and Collabora Office]]>I have been trying to reduce my usage of the big 5 tech companies because they've become too creepy with customer tracking and other too-big-for-the-public-good behaviors. I want to host as many of the services I use as possible on my own systems.  I prefer open source,

]]>
https://doyleyoung.net/nextc/5e922d80f4e485052925369fSun, 12 Apr 2020 14:00:00 GMTI have been trying to reduce my usage of the big 5 tech companies because they've become too creepy with customer tracking and other too-big-for-the-public-good behaviors. I want to host as many of the services I use as possible on my own systems.  I prefer open source, free software but will gladly pay for a system from a smaller company that I can self host. This post focuses on my desire to replace my current (Google) file storage, calendar, and online office suite with my own system to remove one more dependency.

I know that there are a number of projects that can take care of a single one of these functions, but I would like to keep maintenance to a minimum.  This means a project that provides all of the features I'm looking to replace would be ideal.  I was aware of Owncloud, but when I began researching Owncloud and similar products I found Nextcloud.  Long story short, Nextcloud is a fork of Owncloud that was taken years back when a large group of core developers did not like the direction of the original project.  I decided to try Nextcloud and selected the manual installation method because the wizard makes a bunch of assumptions that do not match my system.

The installation was simple: unzip the latest version download, create a directory, change some permissions, use

certbot certonly --nginx

to create a Let's Encrypt certificate, tweak a config file. With that done the system came right up.

The base installation comes with a lot of useful functionality and the available enhancement apps should fill almost any remaining gap you have. I found a gem that I wasn't even l0oking for with Talk.  It's very well done, simple, and portable.  I have used it for a number of video calls and meetings and it has handled multiple participants every bit as well as any proprietary system I've used.  It is especially valuable given that everyone is working from home right now and all the existing video conferencing systems are tied to a major corporation or have huge security and privacy issues - *cough*Zoom*cough*.

I also found mobile apps that allow you to use most of the features of Nextcloud on your phone.  Being able to bring up services on your phone in a natural, integrated way makes all the difference. You should pull down the mobile app for your preferred phone flavor and also check out the other associated Nextcloud apps (especially Nextcloud Talk).

After I finished digging into Nextcloud and all it had to offer, there was still one piece that was missing; a self hosted office suite.  After looking through the available solutions, I decided to go with Collabora Office.  I found an excellent post that details the steps necessary to perform a local installation.  This is way simpler than some of the Libre Office solutions that required a lot of manual steps, hand holding, and time.  I'm really excited by just how easy it was to get word processing, spreadsheets, and presentations on my own server and available from my browser.

When I shared my Nextcloud installation with a friend he could not believe just how refined the Nextcloud ecosystem is.  I highly recommend it to anyone with the desire to take back some of their privacy and to reduce usage on corporate giants.

]]>
<![CDATA[End of an era]]>The Linode that I have hosted all my sites on since 2011 was finally just too old to update.  It has been running LTS versions of Ubuntu that have been upgraded in place since it was originally created.  I finally decided to start over when updating a number

]]>
https://doyleyoung.net/end-of-an-era/5e922a4bf4e4850529253658Sat, 11 Apr 2020 20:48:55 GMTThe Linode that I have hosted all my sites on since 2011 was finally just too old to update.  It has been running LTS versions of Ubuntu that have been upgraded in place since it was originally created.  I finally decided to start over when updating a number of tools became much too painful and time consuming.

This blog runs on Ghost and it in particular was painful to update because I had originally installed it before the ghost command line interface existed.  All the little things I had done to make the blog fit my environment did not match well with recommendations or defaults, so I would have to fight my way through every update.

To start the transition, I created a new Ubuntu 18.04 Linode and began moving the sites over one at a time.  For most sites, I added Lets Encrypt certificates and HTTP to HTTPS redirects.  I also switched from Apache httpd to Nginx because it's the default for Ghost.

I saved the email I received when the old Linode was shutdown:

Linode Events Notification - dyoung
Linode Alerts <noreply@linode.com> Mar 24, 2020, 9:00 PM
to me
Hello dyoung! The following activity has recently occurred:

* linode122874 - (193523231) System Shutdown - Completed Wed, 25 Mar 2020 00:53:48 GMT
* linode122874 - (193523232) Inactivate Linode - Completed Wed, 25 Mar 2020 00:54:29 GMT

You were great linode122874, thanks for the years.

]]>
<![CDATA[Avoiding SecurID and AnyConnect]]>I previously wrote about avoiding AnyConnect and that approach still works great if you are on a system that will allow you to run the RSA SecurID application.  However, there is still a problem if you are using Linux and want to connect to VPN using RSA tokens.

These

]]>
https://doyleyoung.net/avoiding-securid-and-anyconnect/5e75314c74f5680332b94667Thu, 07 Mar 2019 16:17:35 GMTI previously wrote about avoiding AnyConnect and that approach still works great if you are on a system that will allow you to run the RSA SecurID application.  However, there is still a problem if you are using Linux and want to connect to VPN using RSA tokens.

These instructions are written for Debian, but everything here is generally available and most requirements are probably already packaged for your distribution.  First, you will need OpenConnect and stoken:

OpenConnect

sudo apt install openconnect vpnc-scripts ocserv network-manager-openconnect

stoken

sudo apt install libgtk-3-dev libtomcrypt-dev libxml2-dev autoconf automake libtool build-essential
wget https://github.com/cernekee/stoken/archive/master.zip
unzip master.zip
cd stoken-master
./autogen.sh
./configure
make
make check
sudo make install

There are a few ways to set up stoken (see the stoken import documentation on the web or man page), I used an sdtid file.

stoken import --file afile.sdtid

Once you have the token string imported you can use either the command line or gui version of stoken.  I will be using the gui version. The rest of the details are in my previous post and in my osx_openconnect GitHub repo.  I made one change for Linux that makes life simpler, I modified the start_vpn script to look like:

#!/bin/bash

/usr/local/bin/stoken-gui >& /dev/null &
sudo /usr/sbin/openconnect -b --config /path/to/config/vpn.conf *your.server.name*

I pipe the stoken-gui output to /dev/null to avoid an irritating warning, it may not be necessary for you.

]]>
<![CDATA[PiCam site]]>I finished my PiCam project, and after it was live for a few days, I was bothered by what a pain it is to view images and video.  This little system already has a lot going on, so I wanted to create a simple, nearly static website to view

]]>
https://doyleyoung.net/picam_site/5e75314c74f5680332b94666Tue, 02 Oct 2018 00:52:35 GMTI finished my PiCam project, and after it was live for a few days, I was bothered by what a pain it is to view images and video.  This little system already has a lot going on, so I wanted to create a simple, nearly static website to view images and video.  I decided to go with mustache templates because they make creating static sites easy.  I also decided I should use one of the languages already installed, so I had my choice of C, C++, Ruby, Python, or Perl.  Nothing beats Perl when it comes to creating something quick, so it was my choice.  I decided to go against my own experience, and common wisdom, and use the system Perl.  I was able to install a couple libraries I needed via apt, but there we some I was going to have to install via CPAN.  And, again, went against my own experience and decided to use the already installed cpan executable.  I ran into an issue I never had, though:

cpan failing with 'Cannot allocate memory'

I found that this is a common problem on low powered systems thanks to an answer on stackoverflow.  The answer recommended installing cpanm, which is what I would usually just do in the first place.  You can do that (admittedly unsafely) with:

curl -L https://cpanmin.us | perl - --sudo App::cpanminus
cpanm --sudo Template::Mustache

Once you fire that off, just go eat a sandwich.  There's really no point in waiting.  After cpanm was installed, I was able to install all my dependencies in a single go.

Once I had all my dependencies, I started writing the code that would scan the directory containing the images and video.  I needed to match images and video of the same event and pull a bunch of details out of the file names so I could take actions in the web templates using them.  The primary work is done in a single loop that looks through each file in the motion capture directory, uses a regular expression to pull the file name apart, and organizes everything in a hash for later use:

my %motion_capture;
my $capture_path = path($capture_dir);
my $split_re = qr/^((?:.*?\/)+)(\d+)-(\d+)(?:-\d+)?\.(\w+)$/;
foreach my $occurrence ($capture_path->children) {
    # skip directories and dot files
    next if !-f $occurrence || $occurrence =~ /^\./;

    my ($dir_path, $capture_num, $timestamp, $extension) = ($occurrence =~ $split_re);

    if ($extension eq 'jpg') {
        $motion_capture{$capture_num}{image}{file} = $occurrence;
        $motion_capture{$capture_num}{image}{timestamp} = $timestamp;
    } else {
        $motion_capture{$capture_num}{video}{file} = $occurrence;
        $motion_capture{$capture_num}{video}{timestamp} = $timestamp;
    }
}

I created a very simple HTML only site that leans on the power of the HTML5 video element to make magic.  The highlighted motion detection image is used as the poster for the video, and the video itself is setup to use the built in controls:

<video controls width="640" height="480" type="video/mp4" poster="{{pic}}" src="{{vid}}"></video>

This gave me exactly what I needed to interact with all the videos I am capturing.

I tried this on a couple browsers, but for some reason it would only work on Chrome.  This didn't make any sense because all that's there is HTML, well HTML and video.  When I set up Motion, I accepted the configured default of mkv for video.  This video format does not have good, cross-browser support.  Mozilla web docs had me covered, as always, with an excellent summary of media format support across browsers.  I decided to switch to mpeg4 because it has excellent cross browser support, including mobile browsers.

Finally, I needed to find a lightweight web server.  The lighttpd project seems to fit the bill, so I gave it a shot.  I've never used this server before, but setup was standard.  I installed via apt, made a few changes to the config (/etc/lighttpd/lighttpd.conf), dropped my generated HTML in the base directory (/var/www/html), and restarted the server (sudo systemctl restart lighttpd.service).  It has handled my requests flawlessly and isn't eating nearly any system resources:

pi@picam:~/picam_site $ ps aux --sort -rss
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
...
www-data  2711  0.0  1.2   9376  4600 ?        Ss   Sep27   0:34 /usr/sbin/lighttpd -D -f /etc/light

The Raspberry Pi Zero W that it is running on has 512 MB of RAM, so that's a whopping 6MB of RAM for lighttpd.  Seems pretty light to me.

]]>
<![CDATA[C.H.I.P. resurrection]]>I got a couple C.H.I.P. computers during their Kickstarter campaign.  I also got one of their HDMI "DIPs".  I did a few things on these little guys, but never built a project out of them.  They were living in my pile of

]]>
https://doyleyoung.net/c-h-i-p-resurrection/5e75314c74f5680332b9465eTue, 25 Sep 2018 00:52:54 GMTI got a couple C.H.I.P. computers during their Kickstarter campaign.  I also got one of their HDMI "DIPs".  I did a few things on these little guys, but never built a project out of them.  They were living in my pile of SBCs, so they needed some love.

My first hurdle with getting these systems back online was that they didn't seem to be connecting to WiFi automatically.  I know this was set up in the past, but they were not connecting.  So, I slapped on the handy HDMI DIP, a keyboard, and a mouse and I used the GUI to get the little guys connected to WiFi.  Now, I use nmap or my router management interface to find them and manage them via SSH.  Easiest is just scanning for SSH using nmap:

nmap -p 22 --open -sV 192.168.1.0/24

When I went to update to the latest release, I discovered  that Next Thing Co. is dead.  This is really unfortunate because I liked their quirky approach to computing.  They made a huge splash with their Kickstarter and the world's first $9 computer, but I guess it's always difficult to maintain a business on such small margins.  Fortunately, a number of community members were resourceful enough to mirror most of the content and to create a community site.  Using the resources here, I was able to get OS updated on these two systems.  The care and feeding guide had most of what I needed, primarily updating the apt sources and the locales.

After all the updates were applied I realized that both of these systems still had their default system names.  So, to honor the fallen, I renamed them "chip_is_dead" and "long_live_chip".  Now, when they are both on the network, I will be able to tell them apart.

I don't expect these systems to run connected to a monitor, so I installed blink.  This allows me to know that the system is up and hopefully responsive after it has been sitting unattended for a while.  For the time being, I'm not sure what project I'm going to use these two systems for.  But, I have them modernized and ready to drop into anything that will run on a 32 bit system.

]]>
<![CDATA[BeagleBone Black and Quake 3]]>In my quest to make use of all my single board computers, there was one project that just needed a bit of modernization.  Back in 2014, I created a Quake 3 server using a BeagleBone Black (BBB).  This little machine traveled with me for quite a while, but

]]>
https://doyleyoung.net/beaglebone-black-2/5e75314c74f5680332b9465fTue, 18 Sep 2018 21:02:38 GMTIn my quest to make use of all my single board computers, there was one project that just needed a bit of modernization.  Back in 2014, I created a Quake 3 server using a BeagleBone Black (BBB).  This little machine traveled with me for quite a while, but it was taking up extra space in my already stuffed backpack and so it got added to the pile of SBCs in my closet.

I began by making an rsync backup of the existing eMMC drive to another system.  I then downloaded the latest Stretch IoT version and burned it to a micro SD card using Etcher.  Then, I consulted a few different sources to get the new image flashed to the eMMC correctly.  Contrary to the documentation, after following the flashing procedure and waiting a long time, my system had all four LEDs off.  I left it untouched for a very long time in the hope that they would come on, but they never did.  I didn't have much hope for success, but when I removed the SD card, and pushed the reset button it booted right up.  I checked that I didn't still have the previous version, but this was definitely the latest.

cat /etc/debian_version
9.5

I skipped the usual boot-with-the-USB-plugged-into-a-computer-and-go-to-the-webpage procedure and just powered up the system and used SSH to connect.  It took me a while to figure out the default username and password because there are different values documented.  Turns out they were "debian" and "temppwd", respectively.  I changed the debian user password, disabled root SSH logins, and created a new account for myself  with sudo rights so I didn't have to use either default account.

Since the BBB is described as

a low-cost,  community-supported development platform for developers and hobbyists. Boot  Linux in under 10 seconds and get started on development in less than 5 minutes  with just a single USB cable.

There are a lot of services enabled by default, and I need as much space as possible of the available 4GB eMMC for Quake 3.  So, I disabled a bunch of services and removed a bunch of pre-installed packages and files:

sudo systemctl disable bonescript.socket
sudo systemctl disable bonescript.service
sudo systemctl stop bonescript.socket
sudo systemctl stop bonescript.service
sudo systemctl disable bonescript-autorun.service
sudo systemctl stop bonescript-autorun.service
sudo systemctl disable cloud9.service
sudo systemctl stop cloud9.service
sudo apt remove bone101 bonescript c9-core-installer doc-beaglebone-getting-started

Moved Apache back to port 80:

sudo vi /etc/apache2/ports.conf
sudo vi /etc/apache2/sites-enabled/000-default.conf

Disable USB mounting and network:

sudo vi /etc/default/bb-boot
(Uncomment the following)
USB_IMAGE_FILE_DISABLED=yes
USB_NETWORK_DISABLED=yes

Also gathering dust in my closet was a ChronoDot, which I bought years ago to give the BBB a real time clock that didn't reset to 1970 whenever the system was shutdown.  I primarily followed directions in a post by Lemoneer to get the clock recognized and setup.  There were a few differences between the article and the process I had to follow.  First, I had to run i2cdetect on a different bus number:

i2cdetect -y -r 2

Then, I had to change the i2c devices echo similarly:

echo ds3231 0x68 > /sys/bus/i2c/devices/i2c-2/new_device

I also had to configure locale and add a timezone to get the clock offset correct:

ln -s /usr/share/zoneinfo/America/New_York localtime

Then, I had to solder the ChronoDot in to the case.  I had done all the test wiring with a Beagle Bone Proto, but I didn't want to solder directly to the Proto in case I need it in the future.  Also, the ChronoDot was too tall to fit in my case when it was sitting on top of the Proto cape.  So, I just decided to mount the ChronoDot on top of the case and wire it directly to a few header pins so I could wire to pins 1,3 and 19,20 as pairs.  I drilled a hole for each leg of the ChronoDot and soldered wires to the pins.  I was having a hard time with getting wires soldered to the pins and found this excellent YouTube video with a technique I had not seen before.  Now the BBB can be shut off and will have the correct time on restart.

The idea behind this server is that I can bring it anywhere I want to go, plug it in to an ethernet port, power it up, and play Quake 3.  I have always been worried about disk corruption when I pull the power plug.  The BBB has a power and reset button, but they are hidden inside the case.  I noticed in the pin diagram that there is a power output at pin 9, and I had a push button switch in my pile.  There were already a few holes in my case, what's one more?  I wired up the shutdown switch and tested that it will stop and start the BBB.  I like that it is recessed and you have to use a pen or similar to access it.  I was concerned that it was just cutting power, but system logs indicate it is actually performing a clean shutdown:

root@beaglebone:~# last -x | grep shutdown
...
shutdown system down  4.14.67-ti-r73   Mon Sep 17 17:15 - 19:00 (-6834+-21:-15)
...

Finally, I did the Quake 3 server installation, but there's already an blog entry about that.

Now, I'm back to a modernized, portable Quake 3 server with a couple extra bells and whistles.  I can take with me when I want to play some Quake 3 with friends.  This particular system does have one last wrinkle in my SBC project, though.  I want to be able to mount all of these devices in a way that includes a power source, and now I need to add an network switch with ethernet ports to the installation.

]]>
<![CDATA[Raspberry Pi Zero motion capture camera]]>When the Raspberry Pi Zero v1.3 announced they were going to have a camera port I immediately bought one along with a camera.  I got the pieces, put it together, took a few pictures and forgot about it for a while.  Then, The PiHut came out with

]]>
https://doyleyoung.net/raspberry-pi-zero-motion-capture-camera/5e75314c74f5680332b9465dSun, 16 Sep 2018 14:49:29 GMTWhen the Raspberry Pi Zero v1.3 announced they were going to have a camera port I immediately bought one along with a camera.  I got the pieces, put it together, took a few pictures and forgot about it for a while.  Then, The PiHut came out with their ZeroView and I got a new idea for the camera.

I had been having a problem with our mailman throwing packages, literally.  I work from home and my office is in the front of the house.  I noticed that whenever the USPS mailman was delivering a package he would walk across my yard, to the edge of my front walk and throw packages across the sidewalk and up my stairs at my door.  There was only one guy doing it and everyone else was doing their job correctly, but his delivery method was very irritating.

I put the system together, got the video recording, attached it to my front window, and got a couple videos of the mailman in action.  But, this setup had a lot of pain points.  First, it was difficult to get power to the system.  There are no plugs that are close to my front door.  Second, there was no WiFi on the Zero v1.3, so it was a pain to transfer the video to another system.  Needless to say, this project didn't stay attached to my front window long and it was added to the pile of SBCs.

After I pulled all my SBCs out of my closet, this was one of the first projects I decided needed to be updated and finished.  Earlier this year, I had bought a JuiceBox Zero when it Kickstarted.  I also had a battery just sitting there, so I added them to the parts for the build.  I also remember what a pain it was to transfer files, so I picked up a Raspberry Pi Zero W, which has WiFi, to replace the v1.3 from the original build.  The complete system now looks like this:

I added the latest version of Rasbian Stretch Lite to the microSD card and off we went.

I only want to record picture and video when there was something happening.  There are a ton of articles, projects, custom OS images, etc returned when you search for "raspberry pi camera detect motion".  After reading through a number of builds, I decided the Motion project met all of my needs.

I installed Motion using the latest .deb provided by the project and started with a copy of the installed config file (/etc/motion/motion.conf).  I opted to run Motion as the "pi" user and used one of the standard locations for my config file: ~/.motion/motion.conf.  I want to capture still images with the area of motion highlighted and video of the motion with a few extra seconds added.  Motion has a ton of configuration options.  I ended up using most of the defaults, but here are a few key settings:

daemon on
logfile /var/log/motion/motion.log
norm 1
width 640
height 480
mmalcam_name vc.ril.camera
event_gap 5
locate_motion_mode preview
locate_motion_style redbox
target_dir /home/pi/MotionCaptures

Next, I copied their example systemd service file over and made it a user service:

cd /etc/systemd/system
cp /usr/share/motion/examples/motion.service motion@.service

Change a couple lines with your favorite editor (- means remove line, + means add line):

 After=local-fs.target network.target

 [Service]
-PIDFile=/var/run/motion.pid
+User=%i
 ExecStart=/usr/bin/motion -n
 Type=simple
 StandardError=null

Then enable and start the service (as pi user):

systemctl enable motion@pi.service
systemctl start motion@pi.service

Now, motion runs as pi with your local configuration:

pi@picam:~/.motion $ systemctl status motion@pi.service
● motion@pi.service - Motion daemon
   Loaded: loaded (/etc/systemd/system/motion@.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2018-09-14 20:52:50 EDT; 14h ago
 Main PID: 321 (motion)
   CGroup: /system.slice/system-motion.slice/motion@pi.service
           └─321 /usr/bin/motion -n

Sep 14 20:52:50 picam systemd[1]: Started Motion daemon.
Sep 14 20:53:03 picam motion[321]: [26342936:motion] [NTC] [ALL] conf_load: Processing thread 0 - co
Sep 14 20:53:03 picam motion[321]: [26342936:motion] [NTC] [ALL] motion_startup: Motion 4.1.1 Starte
Sep 14 20:53:03 picam motion[321]: [26342936:motion] [NTC] [ALL] motion_startup: Logging to file (/v
pi@picam:~/.motion $ ps -ef | grep [m]otion
pi         321     1  5 Sep14 ?        00:38:58 /usr/bin/motion -n

The final pain point was being able to get the files off the Pi to a system with a monitor.  I decided to use syncthing which I use for a number of other file synchronization tasks.  It is available in the regular apt repos and installs as usual.  I closely followed the excellent docs for configuration and setting up the systemd service.  It is set up very similar to Motion as above.

pi@picam:~ $ systemctl status syncthing@pi.service
● syncthing@pi.service - Syncthing - Open Source Continuous File Synchronization for pi
   Loaded: loaded (/lib/systemd/system/syncthing@.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2018-09-14 20:52:50 EDT; 14h ago
     Docs: man:syncthing(1)
 Main PID: 324 (syncthing)
   CGroup: /system.slice/system-syncthing.slice/syncthing@pi.service
           └─324 /usr/bin/syncthing -no-browser -no-restart -logflags=0

pi@picam:~ $ ps -ef | grep [s]yncthing
pi         324     1  1 Sep14 ?        00:07:29 /usr/bin/syncthing -no-browser -no-restart -logflags=0

After syncthing was setup, I added one of my home systems as a remote device.  The system I chose has cloud backup in case I need a file later.  I then set up synchronization on /home/pi/MotionCaptures which is configured (see above) to be the target directory for all Motion images and video.  Again, see the syncthing docs for the remote device and synchronization setup.

Finally, I tested the JuiceBox Zero to see how long this system could run on battery.  It turns out it is only about 10 hours with the battery I purchased, so I think this is going to be a power backup solution for now.  Just in case I do have an extended outage, I wanted to be sure my filesystem doesn't get corrupted by a hard shutdown.  I installed the LowBatteryShutdown script provided by JuiceBox Zero using their directions.  After I installed the script, I noticed that the system was being a lot less responsive.  There was definitely something going on with the shutdown script:

pi@picam:~ $ top
top - 08:38:10 up 3 min,  2 users,  load average: 1.41, 1.41, 0.66
Tasks:  99 total,   2 running,  67 sleeping,   0 stopped,   1 zombie
%Cpu(s): 98.7 us,  1.3 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem :   378904 total,    50872 free,   120048 used,   207984 buff/cache
KiB Swap:   102396 total,   102396 free,        0 used.   203500 avail Mem

  PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND
  309 root      20   0   17376   5036   3348 R 90.1  1.3   2:33.96 python

pi@picam:~ $ ps -ef | grep 309
root       309   294 55 08:34 ?        00:01:13 python /home/pi/LowBatteryShutdown/LowBatteryShutdown.py

Once you look at the code, the culprit is pretty obvious:

...
# Now we wait here for something amazing to happen
while True:
    # Do Nothing
    pass

This busy wait is VERY busy.  So, I fixed the problem and sent a pull request.

This little system will be living on the window of my office, and will be incorporated into the design of my final SBC mounting solution.

]]>
<![CDATA[Do something will all these SBCs]]>I recently needed to set up a temporary network to test some ideas around microservices and proxies.  I didn't want to run any of these tests on systems I use regularly because they were truly experimental hacks.  I decided I could run them on Raspberry Pis

]]>
https://doyleyoung.net/do-something-will-all-these-sbcs/5e75314c74f5680332b9465cSat, 15 Sep 2018 13:43:50 GMTI recently needed to set up a temporary network to test some ideas around microservices and proxies.  I didn't want to run any of these tests on systems I use regularly because they were truly experimental hacks.  I decided I could run them on Raspberry Pis and just use throwaway Raspbian images.  I was looking through the closet in my 0ffice for systems to test on and realized I have a lot of Single Board Computers.  I bought most of them when they were new technology, played with them a bit, then added them to the pile.  After my original testing was complete, I decided that I had to do something with each of them.

I have a couple C.H.I.P.s, a Tritium H5, a few Raspberry Pi Zeros, and a few Raspberry Pis.  I am going to write an entry about what I did with each.  The goal is to dust them off, install the lastest OS updates, finish old projects, or use these little machines for some purpose as part of my home network.  My immediate plans are to finish my Raspberry Pi Zero based motion capture camera, resurrect my Quake 3 server, finish my RetroPie, decide upon a network interface for all the older boards that didn't include WiFi, and find a way to mount them all.

]]>
<![CDATA[My Year in Books 2017]]>

Time for the yearly book parade! Here is my 2017 Year in Books from goodreads. The summary:

  • 88 books
  • 21,633 pages
  • Average length 246 pages

This year I set my goal at 40 books, but ended up reading 88. I did "cheat" a bit because most of

]]>
https://doyleyoung.net/year_in_book_2017/5e75314c74f5680332b9465bThu, 25 Jan 2018 17:00:43 GMT

Time for the yearly book parade! Here is my 2017 Year in Books from goodreads. The summary:

  • 88 books
  • 21,633 pages
  • Average length 246 pages

This year I set my goal at 40 books, but ended up reading 88. I did "cheat" a bit because most of what I read was Bleach, but I also read a number of excellent novels and tech books.

I started reading A Game of Thrones series this year and it has lived up to its reputation as a must read. As great as the books are, there's only one character I like. There are plenty I hope they don't die, but it's hard to imagine a world more full of cut-throat fiends. I only have a couple more to go, but I'm excited to see what direction the story goes (I haven't watched the HBO version).

I should really give a larger range of ratings to my books. I research almost everything I read and I will stop reading books I don't enjoy, but my average rating is 4.7 and that's definitely too high.

If you would like to see what I read, you can email me or send me a goodreads friend request, this is me.

]]>
<![CDATA[Java One 2017]]>

I attended Java One from October 1st - 5th. This year the conference was dominated by the announcement of Java 9, the new 6 month cadence for Java releases, and the synchronization between the Oracle and OpenJDK implementations. There were also a number of new open source projects released by

]]>
https://doyleyoung.net/java-one-2017/5e75314c74f5680332b9465aMon, 08 Jan 2018 19:29:57 GMT

I attended Java One from October 1st - 5th. This year the conference was dominated by the announcement of Java 9, the new 6 month cadence for Java releases, and the synchronization between the Oracle and OpenJDK implementations. There were also a number of new open source projects released by Oracle. My favorites were JShell (part of Java 9) and Fn. The keynotes were the typical mix of announcements and commercials but I did get a lot of useful information from them.

I attended the following sessions and have added links to any slides, videos, or other resources I have found.

A Practical Guide to Cloud-Native Java Apps and Continuous Delivery
Ilya Dmitrichenko
slides
gitops via flux

kubernetes - manages containers as pods, configuration via API, GCE makes kubernetes cluster deployment simple
prometheus - monitoring service, time series database, alerts for anything, human readable format

gitops - any dev/ops can use git, anyone can commit to git, all changes ares stoded, audited, validated in git and it's already most people's standard work flow
config is code, code/config must be version controlled, CD tools that dont record changes in git are harmful
code and config in separate repos, deploy automator pulls from image repo, applies config and deploys (*** get image ***)
git is source of truth, infrastructure changes are reviewed

http://github.com/errordeveloper/prom-java-demo

draft - open source project to make deploying to Kubernetes easier
Java experimental flag that improves docker integration (*) - in demo Dockerfile

prometheus micrometer - not sure necessary with spring boot 2

IntelliJ IDEA Tips and Tricks
Anton Arhipov
[slides](https://static.rainfocus.com/oracle/oow17/sess/1493551139638001sm7Y/PF/JavaOne\ SF\ 2017\ -\ IntelliJ\ IDEA\ Tips\ &\ Tricks_1507185203444001RnNG.pdf)
@antonarhipov
slideshare
rebellabs.org

7 habits for effective text editing 2.0

layout setup & navigation
typing & refactoring (while you type)
"Batteries"
shortcuts

shift-shift - search everywhere
cmd shift a - execute action
cmd 1 - open/close project window
cmd cmd - open/close bottom icons
gutter icons/line numbers on left can be turned off
run/debug commands
project navigation and add/delete with popup nav menu
if you clean the screen you are forced to learn keyboard shortcuts
cmd e - recent files
cmd shift e - recently edited
Help -> Productivity guide

cmd j - list of live templates
cmd shift space - smart completion
cmd option f - declare final
in variable declaration -> shift tab - change type
smart autocompletion twice can provide context sensitive
cmd shift enter - completion
F2 - jump to error/issue then alt enter to fix
keyword and static completion (?) looks up all possibilities of keyword

select line, shift shift, live template -> create live template from selected text
cmd option p - introduce parameter
alt enter - inject language (select what you want), enter your text, press down and it will complete (example in xml with expansion)
alt enter - edit fragment, formats in sourcecode
cmd option x - presents options for xpath in xml sub editor
emmet - write structured documents faster
html example
table.mycss#mytable>tr3>td3 -> expand

funnel in debugger - visualize data in debugger - plugin (stream debugger)

Apache Kafka: Scalable Message Processing and More
Guido Schmutz
slides
@gschmutz
blog
slideshare

unix analogy slide is awesome (7th slide)
partitions guarantee order
producer using key always hashes to same partition
consumers track their own offset (can replay, rewind, fast forward, etc)
can consume since a timestamp
data retention completely independent of consumers
MQTT as a gateway to kafka, example is IOT
kafka connect allows you to read and write from/to multiple sources
single message transforms (mask CC, etc)
kafka streams - library on top of kafka, DSL based
ksql - stream processing without coding, still in dev preview, treats streams and tables as first class citizen
stream = data in motion
table = collected state of a stream
join stream and table

Modular Development with JDK 9
Alex Buckley
video

A module is a set of packages designed for reuse.
allowed to limit accessibility based on export rules

The unit of reuse is the unit of release
export packages
import modules
module hello.world {
exports com.example.Hello;
requires java.base;
}

slidedeck for migration
jdeps tool
requires java.base; is implicit and doesn't need to be in module declaration
automatic modules allow you to turn existing jars into modules

Going Reactive with Spring 5 and Project Reactor
Mark Heckler & Josh Long
@mkheck & @starbuxman

Spring 5 - first to support Reactor
The source code related to the presentation:
https://github.com/mkheck/flux-flix-intro
https://github.com/joshlong/flux-flix-service

Build, Debug, and Deploy Your First Chatbot
Arun Gupta
@arungupta

Arun put most of the content of his presentation on GitHub

Java LangSec: New Security Enhancements in Java 9
Jim Manico
@manicode
Get slide deck
Java Secure Development Guidelines
JSON parsing

Asynchronous by Default, Synchronous When Necessary
Tomasz Nurkiewicz
@tnurkiewicz
blog

Distributed systems & event sourcing

Kafka Streams + TensorFlow + H2O.ai = Highly Scalable Deep Learning
Kai Waehner
slides

Language translation, picture analysis, speech and video generation, intelligent decision making
seconds - fraud detection, price optimization
minutes - transportation rerouting, customer service
hours - inventory management, predictive maintenance
http://playground.tensorflow.org
H2O Deepwater

JShell: An Interactive Shell for the Java Platform
Robert Field
slides
JShell - REPL
API for use within other applications
Custom JShell that wraps HTS provider interface for easy, tok/detok on command line

jshell --start DEFAULT --start PRINTING
/set
(lists what's there)

shift tab i (import class from current line)
shift tab v (create variable from current line)

Designing for Modularity with Java 9
Authors of OReilly Java 9 Modularity
Paul Bakker - @pbakker
Sander Mak - @Sander_Mak

*slidedeck

Lazy Java
Mario Fusco
slides

Key quote:

Strictness is about doing things,
Laziness is about noting things to do

Amazon Alexa Skills Versus Google Home Actions: The Big Java VUI Face-off
Viktor Gamov
Baruch Sadogursky
video

GitHub project that scraped Oracle pages for links

]]>
<![CDATA[Ionic and Ionic Native]]>

At $work we have started a project using Ionic and Ionic Native. I didn't have any experience with it so I decided to make something fun and simple. I often play little song snippets during meetings so I decided to make a soundboard. There's a project

]]>
https://doyleyoung.net/ionic-and-ionic-native/5e75314c74f5680332b94658Wed, 11 Oct 2017 01:29:28 GMT

At $work we have started a project using Ionic and Ionic Native. I didn't have any experience with it so I decided to make something fun and simple. I often play little song snippets during meetings so I decided to make a soundboard. There's a project on Github that was pretty similar to what I wanted so I took a couple key pieces from it and started creating a little app.

Initially I was thinking I would have to utilize native file access and that would require platform detection. After a few experiments, I found that getting the sound files to open on multiple platforms using the native file access would require a lot of specific setup and paths that ruined the simplicity I was hoping for. Then, I looked into bundling assets as you would on the web and found a stackoverflow answer that pointed me in the right direction. If you put your resources in src/assets/ they will be bundled and easily accessible with a simple path, for example:

assets/sound/blah.mp3

I'm using the Typescript Audio wrapper for HTMLAudioElement, so with your assets in place, it is simple to play a clip:

this.media = new Audio('assets/sound/blah.mp3');
this.media.load();
this.media.play();

I tested with both mp3 and wav files and they both worked across platforms. Building and testing on the web was simple, Android was very simple, but iOS required a bit of work to get right. The ionic deployment guide was close, but I still needed a couple tweaks to get it up and running.

Once I had the basics, I needed some content and I decided to create a bunch of clips that were inside jokes so it would be fun to play with at $work. There is an extremely simple, open-source tool for building mp3 clips called mp3cut. For example, to create a two second clip starting at 29 and finishing at 31 seconds from input.mp3 written to output.mp3:

mp3cut -o output.mp3 -t 00:00:29+000-00:00:31+000 input.mp3

There were also a few phrases I wanted to add that weren't related to songs. If you work on MacOS, you can also use the say command to make witty clips, like so:

say -v Daniel "Witty" -o witty.wav --data-format=LEF32@8000

The output sounds great even though all the fun voices (who doesn't want Trinoids?) have been removed from the default install and have to be downloaded. If you want more voices head to Accessibility > Speech > System Voice > Customize and select all those you want.

Ionic is easier and more productive than any cross platform app development framework I've used in the past. My initial experiment with it went well and I think it is a viable choice for simple apps. I still believe hybrid or native apps should be used as complexity increases, but will keep Ionic in mind for future app projects.

]]>