The Wiert Corner – irregular stream of stuff

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

  • My work

  • My badges

  • Twitter Updates

    • G+ Na also, unnützes Wissen ist doch für was gut: "Sie haben mehr Punkte erreicht als 96% der Teilnehmer... 2 hours ago
    • G+ Unpopular opinion: You should NOT be buying phones that do not ship with the latest version of Android... 2 hours ago
    • G+ Welch herzallerliebste Naivität. Natürlich stimmt einiges, was sie schreibt, aber sie ist definitiv ... 2 hours ago
    • @matijn @twelphcom Wat een leuke protegé heb je! Zo'n dag is toch heel wat anders dan de annegriep die ik dacht. Sorry voor dat. 3 hours ago
    • RT @CodeWisdom: "Computers are good at following instructions, but not at reading your mind." - Donald Knuth 3 hours ago
  • My Flickr Stream

  • Pages

  • All categories

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

    Join 1,843 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, OS X, OS X El Capitan, OS X Maverick, OSX Yosemite, Power User, Scripting, Software Development | Leave a Comment »

%d bloggers like this: