Reverse SSH Tunneling with Raspberry Pi zero

This is a classic "Phone Home" design. Because the NAT firewall blocks incoming connections to your Raspberry Pi, the Pi must be the one to initiate the conversation.

The Design Overview: Reverse SSH Tunneling

Think of this like a two-way bridge.

  1. The Raspberry Pi (the client) initiates an outgoing connection to web3us.com (the relay).

  2. Within that connection, the Pi tells the CentOS server: "Any traffic you receive on your local Port 2222, please forward it back through this tunnel to my Port 22."

  3. When you want to access the Pi, you SSH into web3us.com and then SSH into that "forwarded" port.

SSH tunnel diagram

Step 1: Set up Passwordless Login (Pi to CentOS)

For a tunnel to stay up automatically, the Pi must be able to log into your CentOS server without you typing a password every time.

Check for IP Address changes on my Raspberry Pi

Script that is called from Cron

cat /home/pi/send_ip.sh

#!/bin/bash
echo -n "$(date '+%Y-%m-%d %H:%M') "
hostname -I | awk '{for(i=1;i<=NF;i++) if ($i ~ /^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/) printf "%s ", $i; print ""}'

Run this in Cron

$ crontab -e
# +---------------- minute (0 - 59)
# |  +------------- hour (0 - 23)
# |  |  +---------- day of month (1 - 31)
# |  |  |  +------- month (1 - 12)
# |  |  |  |  +---- day of week (0 - 6) (Sunday=0)
# |  |  |  |  |
# *  *  *  *  *  command to be executed
#  0 8  *  *  * /opt/scripts/down.sh >> /home/pi/log/shade.log 2>&1
#  0 11  *  *  * /opt/scripts/up.sh >> /home/pi/log/shade.log 2>&1
1 7 * * * /home/pi/send_ip.sh | ssh shade@server "cat >> /home/shade/log/shade.log" 2>> /home/pi/cron_debug.log

Show the file on the server that logs the IP address each day

ls -l /home/shade/log
total 4
-rw-rw-rw- 1 shade shade 2519 Sep 19 07:40 shade.log

Show the contents of the shade.log file

$ cat shade.log

# log file for host IP of shade Raspberry Pi  Started out as 192.168.1.118 Jun 9, 2025

2026-02-11 08:21 | Int_IP: 192.168.86.52  | Public IP: 136.26.7.34
2026-02-11 16:05 | Int_IP: 192.168.86.52  | Public IP: 136.26.7.34
2026-02-11 17:21 | Int_IP: 192.168.104.227  | Public IP: 75.25.171.132
2026-02-11 18:05 | Int_IP: 192.168.104.227  | Public IP: 75.25.171.132

Get Internal and External IP and date and time

Kids Infographics

It appears that AI wants a table with either 24 or 25 cells and AI will get lost trying fill the table. With a smaller set like 6 letters is does not get lost and can be accurate, See my last example on this page

Niccolò Machiavelli

Niccolò MachiavelliNiccolò Machiavelli famously stated,

“It must be remembered that there is nothing more difficult to plan, more doubtful of success, nor more dangerous to manage than a new system. For the initiator has the enmity of all who would profit by the preservation of the old institution and merely lukewarm defenders in those who gain by the new ones. ”

He also stated: 

Everyone sees what you seem to be, few know what you really are; and those few do not dare take a stand against the general opinion.

“It ought to be remembered that there is nothing more difficult to take in hand, more perilous to conduct, or more uncertain in its success, than to take the lead in the introduction of a new order of things. Because the innovator has for enemies all those who have done well under the old conditions, and lukewarm defenders in those who may do well under the new. This coolness arises partly from fear of the opponents, who have the laws on their side, and partly from the incredulity of men, who do not readily believe in new things until they have had a long experience of them.”

The Prince, which was published posthumously in 1513

Summary - On Grief and Grieving - The Five Stages of Loss

On Grief and GrievingOn Grief and Grieving - Finding the Meaning of Grief Through the Five Stages of Loss
By Elisabeth Kübler-Ross and David Kessler

On Grief and Grieving applies the stages: denial, anger, bargaining, depression, and acceptance to the grieving process and weaves together theory, inspiration, and practical advice. 

Do the five stages happen in order?

The five stages – denial, anger, bargaining, depression and acceptance – are often talked about as if they happen in order, moving from one stage to the other. You might hear people say things like ‘Oh I’ve moved on from denial and now I think I’m entering the angry stage’. But this isn’t often the case.

In fact Kübler-Ross, in her writing, makes it clear that the stages are non-linear – people can experience these aspects of grief at different times and they do not happen in one particular order. You might not experience all of the stages, and you might find feelings are quite different with different bereavements.

Summary - Thinking in Bets

Thinking in Bets: Making Smarter Decisions When You Don't Have All the Facts

Poker champion turned business consultant Annie Duke teaches you how to get comfortable with uncertainty and make better decisions as a result in “the ultimate guide to thinking about risk” (Charles Duhigg, author of The Power of Habit).

Even the best decision doesn't yield the best outcome every time. There's always an element of luck that you can't control, and there is always information that is hidden from view. So the key to long-term success (and avoiding worrying yourself to death) is to think in bets: How sure am I? What are the possible ways things could turn out? What decision has the highest odds of success? Did I land in the unlucky 10% on the strategy that works 90% of the time? Or is my success attributable to dumb luck rather than great decision making?

Annie Duke, a former World Series of Poker champion turned business consultant, draws on examples from business, sports, politics, and (of course) poker to share tools anyone can use to embrace uncertainty and make better decisions. For most people, it's difficult to say "I'm not sure" in a world that values and, even, rewards the appearance of certainty. But professional poker players are comfortable with the fact that great decisions don't always lead to great outcomes and bad decisions don't always lead to bad outcomes.

By shifting your thinking from a need for certainty to a goal of accurately assessing what you know and what you don't, you'll be less vulnerable to reactive emotions, knee-jerk biases, and destructive habits in your decision making. You'll become more confident, calm, compassionate and successful in the long run.

The Mormon Battalion in the Mexican War

Source: Ol' Buffalo Mormon Battalion Page, Copyright © 2001, 2021 by Blaine S Nay, Cedar City, Utah, USA

In July 1846, under the authority of U.S. Army Captain James Allen and with the encouragement of Mormon leader Brigham Young, the Mormon Battalion was mustered in at Council Bluffs, Iowa Territory. The battalion was the direct result of Brigham Young's correspondence on 26 January 1846 to Jesse C. Little, presiding elder over the New England and Middle States Mission. Young instructed Little to meet with national leaders in Washington, D.C., and to seek aid for the migrating Latter-day Saints, the majority of whom were then in the Iowa Territory. In response to Young's letter, Little journeyed to Washington, arriving on 21 May 1846, just eight days after Congress had declared war on Mexico.

Little met with President James K. Polk on 5 June 1846 and urged him to aid migrating Mormon pioneers by employing them to fortify and defend the West. The president offered to aid the pioneers by permitting them to raise a battalion of five hundred men, who were to join Colonel Stephen W. Kearny, Commander of the Army of the West, and fight for the United States in the Mexican War. Little accepted this offer.

Colonel Kearny designated Captain James Allen, later promoted to Lieutenant Colonel, to raise five companies of volunteer soldiers from the able-bodied men between the ages of eighteen and forty-five in the Mormon encampments in Iowa. On 26 June 1846 Allen arrived at the encampment of Mt. Pisgah. He was treated with suspicion as many believed that the raising of a battalion was a plot to bring trouble to the migrating Saints.