Program to raise blinds - up.py

# up.py  python3 program to raise blinds

import time
import RPi.GPIO as GPIO
import sys
import shutil
from os.path import exists

channel1 = 17   # motor left
channel2 = 27   # motor right
channel3 = 22   # power switch
traveltime = 86

upfile = '/home/pi/shade/up.status'        # existance of this files means blinds are currently up
downfile = '/home/pi/shade/down.status'    # existance of this files means blinds are currently down
raisefile = '/home/pi/shade/raise.status'  # existance of this files means blinds were partly raised
lowerfile = '/home/pi/shade/lower.status'  # existance of this files means blinds were partly lowered
stopfile = '/home/pi/shade/stop.status'    # existance of this files means disable movement of blinds (windy)

stopfile_exists = exists(stopfile)
upfile_exists = exists(upfile)
downfile_exists = exists(downfile)

# if on vacation or windy a stopfile prevents program running
if ( stopfile_exists):
    sys.exit('Warning cannot raise blind because of stopfile at: /home/pi/shade/stop.status')

if (not downfile_exists):
    sys.exit('Error cannot raise blind that is up: /home/pi/shade/down.status')

shutil.move(downfile, raisefile)
sys.stdout.write ('raise ')

#GPIO setup
GPIO.setmode(GPIO.BCM)
GPIO.setup(channel1, GPIO.OUT)
GPIO.setup(channel2, GPIO.OUT)
GPIO.setup(channel3, GPIO.OUT)

def motor_off(pin):
    GPIO.output(pin, GPIO.HIGH)  # Turn on

Program to lower Blind - Down.py



# Program down.py
# python3 down.py
import time
import RPi.GPIO as GPIO
import sys
import shutil
from os.path import exists

channel1 = 17   # motor left 
channel2 = 27   # motor right 
channel3 = 22   # power switch 
traveltime = 86 # number of seconds to move blind

upfile = '/home/pi/shade/up.status'        # existance means blinds are currently up 
downfile = '/home/pi/shade/down.status'    # existance means blinds are currently down 
raisefile = '/home/pi/shade/raise.status'  # existance means blinds were partly raised 
lowerfile = '/home/pi/shade/lower.status'  # existance means blinds were partly lowered 
stopfile = '/home/pi/shade/stop.status'    # existance means disable movement of blinds (windy)

stopfile_exists = exists(stopfile)
upfile_exists = exists(upfile)
downfile_exists = exists(downfile)

if ( stopfile_exists):
        sys.exit('Warning cannot lower blind because of stopfile at: /home/pi/shade/stop.status')

if (not upfile_exists):
    sys.exit('Error cannot lower blind that is not up: /home/pi/shade/up.status')

sys.stdout.write ('lower ')
shutil.move(upfile, lowerfile )

#GPIO setup
GPIO.setmode(GPIO.BCM)
GPIO.setup(channel1, GPIO.OUT)
GPIO.setup(channel2, GPIO.OUT)
GPIO.setup(channel3, GPIO.OUT)

def motor_off(pin):
    GPIO.output(pin, GPIO.HIGH)  # Turn on
    print ("off")

def motor_on(pin):
    GPIO.output(pin, GPIO.LOW)  # Turn off
    print 

Ubuntu - The following packages have unmet dependencies:  nvidia-driver-515 : Depends:

Cura gives Could not probe OpenGL. This program rquires OpenGL 2.0 or higher.

 

I just dealt with the same issue on Ubuntu 22.04 when trying to install

$ sudo ubuntu-drivers autoinstall
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

Linux Commands with examples

cp

Copy file1 to file2 preserving the mode, ownership and timestamp.

  $ cp -p file1 file2

mv

Rename file1 to file2. if file2 exists prompt for confirmation before overwritting it.

  $ mv -i file1 file2

rm

get confirmation before removing the file.

  $ rm -i file*

cd

change directory.

  $ cd path

change back to previous directory

  $ cd -

pwd

Print working directory, shows the path of the current directory

  $ pwd

more

Echo the contents of the file to the screen one page at a time, see also less and cat

  $ more /opt/example/file.txt

ls

Display filesize in human readable format (e.g. KB, MB etc.,)

Financial planning - Automatic Millionaire

Book summaryautomatic millionaire cover

The Automatic Millionaire starts with the powerful story of an average American couple—he’s a low-level manager, she’s a beautician—whose joint income never exceeds $55,000 a year, yet who somehow manage to own two homes debt-free, put two kids through college, and retire at 55 with more than $1 million in savings. Through their story you’ll learn the surprising fact that you cannot get rich with a budget! You have to have a plan to pay yourself first that is totally automatic, a plan that will automatically secure your future and pay for your present.
 
What makes The Automatic Millionaire unique:
 
·        You don’t need a budget
·        You don’t need willpower
·        You don’t need to make a lot of money
·        You don’t need to be that interested in money
·        You can set up the plan in an hour
 

Ambulance down in the valley

by Joseph Malins (1895)

-a poem about prevention -

 

'Twas a dangerous cliff, as they freely confessed,

though to walk near its crest was so pleasant;

but over its terrible edge there had slipped

a duke and full many a peasant.

 

So the people said something would have to be done,

but their projects did not at all tally;

some said, 'Put a fence 'round the edge of the cliff, '

some, 'An ambulance down in the valley.'

 

But the cry for the ambulance carried the day,

for it spread through the neighboring city;

a fence may be useful or not, it is true,

but each heart became full of pity

for those who slipped over the dangerous cliff;

 

And the dwellers in highway and alley

gave pounds and gave pence, not to put up a fence,

but an ambulance down in the valley.

 

'For the cliff is all right, if your careful, ' they said,

'and if folks even slip and are dropping,

it isn't the slipping that hurts them so much

as the shock down below when they're stopping.'

 

So day after day, as these mishaps occurred,

quick forth would those rescuers sally

to pick up the victims who fell off the cliff,

with their ambulance down in the valley.

James Lawrence, the “Iron Cowboy" spreads hope

Iron CowboyJames Lawrence, best known as the “Iron Cowboy", was born in Calgary, Alberta, Canada. Married to Sunny who is the partner in their journey, is also a proud father of five wonderful kids: his daughters, Lucy, Lily, Daisy and Dolly, and his son, Quinn. On June 6, 2015, James attempted to complete 50 Ironman Triathlons in 50 consecutive days across all 50 U.S. States.

He trained knowing that he and his family would be moving from state to state and race to race in an RV, with little time to pick up or prepare meals along the way so he had to be sure his body was prepared to get through each race on “regular” food. He invited people in every state to join him on the last leg of the marathon, and most dinners and bike sandwiches were supplied by coordinators in each city. Lawrence didn’t have the luxury of relying on a highly specialized diet when so much of what he ate was out of his hands.

EdgeMax EdgeRouter X hairpin configuration with GUI 1.7 screen shots

Hairpinning (or NAT loopback) is where a machine on the LAN is able to access another machine on the LAN via the external IP address of the LAN/router (with port forwarding set up on the router to direct requests to the appropriate machine on the LAN).

How to setup hairpin on the EdgeRouter X model ER-X running EdgeOS v1.7

Sample Network

EdgeRouter ER-X Dashboard v1.7

Interfaces

Interface details for eth0 – WAN

eth0-WAN

Interface details for switch0

switch0

Interface details for eth2 WLAN

eth2 WLAN

Hairpin DNAT Rule Part1

DNAT Part1