Author: Chris Carey

  • PurpleAir Raspberry Pi

    Purple Raspberry Pi

    With all the fires in California, I found myself checking PurpleAir multiple times per day to track what the air is like outside – waiting for a moment when the AQI improves so we can open some windows or take a walk.

    I have a bunch of Raspberry Pi boards handy, and two with the Pimoroni Unicorn Hat 64 RGB light array on them. This would work perfectly as a display for current air quality conditions.

    In addition I have a few of the Blink(1) USB lights. This will add even more color.

    There is example code provided in python for both the Unicorn Hat and the blink(1) light, so that would be easiest to throw something together in python.

    The basic premise is quite simple:

    • Fetch PurpleAir data from the website
    • Display colors on the Pi

    The script got a little more complicated in that I want it to:

    • Only hit PurpleAir once every x seconds
    • Update the colors on the Unicorn Hat slowly so we can more easily see when we are transitioning from one color to another
    • Show some indication that the script is still running
    • Handle HTTP errors gracefully

    I posted the code over on GitHub. Right now it’s pretty specific to my setup but will make it a bit more generic to work with more hardware options going forward.

    Code on GitHub

  • Time Machine Encryption Slow Takes Too Long

    Time Machine encryption can take literally days to complete. How do you speed this up?

    The problem is here: It is common and logical to follow the pattern:

    • Format a drive “Mac OS Extended (Journaled)”
    • Select that disk in Time Machine and select “Encrypt backups”.

    Time Machine will perform the first backup (unencrypted) on the drive, then after it finishes, it will begin this long process of encrypting the drive. This is the routine that can take multiple days, even if your first backup was only a few gigabytes. This sucks.

    The faster technique is in Disk Utility to:

    • Format the drive “Mac OS Extended (Journaled, Encrypted)” (which only takes a few seconds)
    • Select that disk in Time Machine and select “Encrypt backups”.

    Time machine will perform the backup on the encrypted disk and will be done immediately after.

    Hope this saves you some time!

  • Geist Los Gatos

    In the Amazon show “Homecoming” there are some products with the address for Geist Emergent Group
    17 Fluxus Circle, Los Gatos, California 95030

    https://chriscarey.com/geist/

  • NagiosTV for Nagios 4 October 2018 update

     I’m happy to share another great update for NagiosTV for Nagios 4

    NagiosTV showing some Host and Service problems

    NagiosTV is an alternate user interface (UI) for the Nagios open source monitoring system.

    This UI is designed to be viewed on a TV or on your desktop to quickly see if all your services are up or down. This is not meant to be a replacement for the entire Nagios web interface, but an alternate way to look at the “what’s down?” part.

    This version adds Flynn, the character from the game Doom. This is just a bit of added fun to bring some emotion to server monitoring. The more services are down, the more angry Flynn gets.

    With this version, you just unzip the release into the built-in Nagios web user interface folder, and it runs alongside the built-in Nagios user interface. That’s it!

    Please give it a shot, and let me know how it works for you!

    Releases, installation instructions, and the source code can be found on GitHub at https://github.com/chriscareycode/nagiostv-react

    Some History

    Each time this project evolves it gets a little better and more easy to install. The original NagiosTV was essentially a database driven app that required MySQL, ndoutils package that would push the Nagios updates into the database, and the JavaScript frontend and PHP code to display the data. Needless to say there was a lot of stuff to set up to get this working.

    Nagios Core 4.0.7 and newer comes with new JSON CGI’s https://labs.nagios.com/2014/06/19/exploring-the-new-json-cgis-in-nagios-core-4-0-7-part-1/ out of the box which is a game changer for tapping into the Nagios data from a web application. No more need for ndoutils writing out to a database. No more installing 3rd party tools like status-json and MK livestatus to tap into Nagios data.

  • The disk “your disk” wasn’t ejected because one or more programs may be using it

    trying to safely eject any hard drive

    This error message has come up on a number of occasions and I’m sure many people have wondered what is the best way to deal with this. This is for macOS, OSX, Macintosh operating system. These instructions are the same for Mavericks, Yosemite, Sierra, High Sierra, Mojave, Catalina, Big Sur, Monterey.

    I have found a few main things that cause this error…

    1) There is an application you launched with a file open on that disk. Double check you have no applications running with files open on the disk. You can try quitting applications that opened files on the removable disk.

    2) There is a terminal open, and you have changed directory onto the disk path in terminal. Check any open terminal windows and change directory

    cd

    to go back to your home folder, or

    exit

    to close them.

    3) There is some other application, maybe an operating system application and not one you explicitly launched, holding a file on the disk open.

    There is an application called “What’s keeping me” that can help you find which process is keeping your disk from ejecting http://www.hamsoftengineering.com/products/wkm/wkm.html . EDIT: This link is now broken as of 2022

    I found QuickLookUIService will often hold on to the disk. QuickLookUIService is used to preview document, photos, or videos and will not properly let go of those files sometimes. In this case it will need to be Force Quit. Open Activity Monitor, sort by name, or search for QuickLookUIService, and click the x button and Force Quit! Or you can do it on the terminal with

    killall -9 QuickLookUIService

    Good luck ejecting your disks!

  • The Twitter animation

    I like the Twitter animation that you see right when launching the iPhone app.

    When you click the Twitter icon, the logo moves to the center of the screen and seamlessly transitions into the splash screen. Then the icon backs off a bit and shoots forward to fill the screen with white as the app fades in.

    Very slick.

    My version:
    https://chriscarey.com/practice/twitter-intro/

  • NagiosTV for Nagios 4

    NagiosTV showing one service down in the CRITICAL state

    NagiosTV is an alternate user interface (UI) for the Nagios open source monitoring system.

    This UI is designed to be viewed on a TV or on your desktop to quickly see if all your services are up or down. This is not meant to be a replacement for the Nagios web interface.

    This version adds Flynn, the character from the game Doom. This is just a bit of added fun to bring some emotion to server monitoring. The more services are down, the more angry Flynn gets.
    When I walk into my office in the morning, I take a look over at Flynn and see if he is happy or angry. If he is angry then you can fix whatever needs fixing to make him happy again.

    Included is a Node.js server which can be used to serve the NagiosTV web interface, and to optionally proxy connections to your Nagios server.

    Open Source on GitHub: https://github.com/chriscareycode/nagiostv-react

  • iPhone interface with React

    After reading about the new CSS backdrop-filter I decided to see how much work would be involved to create an iPhone like interface using HTML, CSS, and React.

    (more…)

  • Raspberry Pi Zero OTG mode

    Configuring a Raspberry Pi Zero for the first time just got a lot easier.

    (more…)

  • Achieving high frame rate with a Raspberry Pi camera system

    When you read about using Raspberry Pi cameras as part of your home security system, most of the information you will find will point you in the direction of running motion which is the de-facto standard for doing video motion detection on Linux. There are also variants of motion such as MotionEye or motionEyeOS which provide a nicer UI on top of motion.

    Motion requires some horsepower to handle the video processing to detect motion, and also to run the web server and other features. On the modest hardware on the Raspberry Pi, I was only able to reliably achieve 4-10 frames-per-second at 800×600, depending on the Raspberry Pi model in use.

    Using this technique below, my camera system is now able to get closer to the full resolution for each Raspberry Pi camera which is 1920×1080 at 30 frames per second – and reliably running for years without issue.

    (more…)