The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,914 other followers

Archive for April 11th, 2017

Having one Raspberry Pi reset another Raspberry Pi through relay or transistor

Posted by jpluimers on 2017/04/11

I’m going to build this later, but as the follow up on shortening the RUN pins of a Raspberry Pi to reset it in The woods and trees of OpenSuSE on single-board computers – image abbreviations – and getting it installed using OS X, I want to see if the below will work for me to have a pair (maybe trio?) of Raspberry Pi devices watch each other and reset any hung one.

The need comes because sometimes a Raspberry Pi either hangs or just won’t finish a reboot sequence:

Basically a Raspberry Pi has GPIO pins that can drive electromechanic (like mechanical relay) or electronic (like transistor+resistors or SSR solid-state relay). Examples:

So basic steps:

  1. Get switching gear (relay+diode, transistor+resistors or solid-state-relay)
  2. On each Pi modify the RUN holes so it has a header
  3. Connect header to switching gear
  4. Write watch-dog code to monitor other Pi and flip GPIO pin
  5. Test, test, test

And since I’m relatively new at electronics:


Read the rest of this entry »

Posted in *nix, Development, Hardware Development, Linux, openSuSE, Power User, Raspberry Pi, SuSE Linux | Leave a Comment »

Getting your local IPv4 addresses, netmasks and CIDRs

Posted by jpluimers on 2017/04/11

In order to scan some local networks for unknown hosts (yes, on some sites you need to perform archeology), I needed the local IPv4 addresses, netmasks and CIDRs on my Mac running OS X.

Part of that is using ifconfig to get local inet information which however uses hexadecimal network masks and delivers no CIDRs.

SoI was a bit premature when I wrote about “This could be done by creating bash functions mask2cdr and cdr2mask, but that’s a bit too convoluted right now” in Getting the IP addresses of gmail MX servers – via Super User – dig isn’t enough.

netmask to CIDR and CIDR to netmask conversion

I need mask2cdr now, so lets start with these two bash functions and their aliases:

Read the rest of this entry »

Posted in *nix, *nix-tools, Apple, bash, Development, Mac OS X / OS X / MacOS, OS X 10.10 Yosemite, OS X 10.11 El Capitan, OS X 10.9 Mavericks, Power User, Scripting, Software Development | Leave a Comment »

%d bloggers like this: