My server for this machine is low memory and the msyql piece craps out all the time. At this point when the site is unresponsive, I don’t even question what the issue will be. One command later and it is running again. After a largely useless legal warning.
Here is the magic command:
systemctl -H prandall@mathcodeprint.com restart mysql
The -H is the magic. This new service controller for system has built in ssh-ing abilities. You will need to provide a password if you have not set up your private keys.
And if I need to check up on the service, same command just with status:
systemctl -H prandall@mathcodeprint.com status mysql
For reference the old process would have been
ssh prandall@mathcodeprint.com
password
service mysql restart
exit
I know it doesn’t seem like a lot but, some of you will understand.
Bare Bones Install Instructions ( It just worked. ) The bare minimum to get a working installation of the Keyboard+Mouse sharing software Barrier. This can also be used from a Windows machine to a Linux machine or Raspberry Pi.
Barrier – A simple Open Source tool that enables sharing a Keyboard and mouse acrros muliple screens.
In this installation the Server is the Linux 19.x machine. The machine with the Keyboard physically attached is the server. Place the screen in the correct position ( Each screen represents the whole PC, not the actual screen count .) The name of the machine must match the hostname on the raspberry pi. This will be shown in “Screen name:” of the client”
Once you have finished configuring the server, click the Apply button an then the Start button. The start button will change to a “Stop” button and the screen will show “Barrier is running” in the bottom left corner.
Configure Client
You will need the IP Address of the Server from the Server’s Main Screen. Uncheck “Auto Config” enter the IP address. Re-Check Autoconfig. As before press Apply and Stop. The client will connect and you will be able to move your mouse across both screens. ( Try re-starting server-side if it doesn’t work )
NOTES:
Your mouse point must be on the screen to which you are typing.
If the client dis-connects first try restarting the server.
In my previous post, I walked through a description of the built-in sharing provided by Jetpack. Jetpack adds sharing directly to the publishing workflow. It also adds some helpful preview features. What it lacks is a large selection of social media sites.
To compensate I have added AddToAny as part of my must-have plugins. AddToAny provides easy to use icons for many Social Sharing websites. In particular, I was looking for a plugin that included MeWe, and AddToAny did not disappoint.
Jetpack automates my most prominent social sites, with AddToAny I need to click on the link and manually share, but add2any makes this a seamless process with only a few clicks.
The setup is very straight forward with a large number of services to choose from. You can activate each service with a single click.
I chose a handful of common services
There are a significant number of display options. I have it set only for posts.
If you are looking to get direct follows from your Website Add2Any includes a follow widget for users of your website to click. The widget includes additional services like Instagram, YouTube, and others:
AddToAny is a very popular add on and a great addition to your arsenal of tools.
Using Jetpack to “echo” your blog post to various platforms like Facebook and Twitter.
As any WordPress user, you have probably been through the routine. Create a post, share to Twitter, share to Facebook, share to a hundred sites to try to improve your traffic. I am here to tell you there is a solution. It is a service offered by WordPress themselves, it is called Jetpack.
Jetpack is sort of a Backend to WordPress that adds a good number of features and services that make it pretty much indispensable. It has a free tier and a paid tier. For most of my sites, I simply use the free tier and fill in the voids with other plugins.
While Social Sharing can be handled by many other plugins I have found the dead-simple integration by Jetpack to hit the mark. I have tested out other plugins only to be frustrated by a cumbersome interface or process or even outcome.
When you connect to Jetpack you will get a new icon in your post properties, it is a little green circle with two triangles:
Selecting the Jetpack icon swaps out the panel and shows the Jetpack panel. The first detail on the panel is the “Share this post.” Section. As you can see this site automatically shares four social sites that are included in the free version of Jetpack.
Once these are set, nothing else needs to be done. All your posts will be automatically shared on all these social sites. There are more available in the paid version.
The next item available is Social Previews. In the past, I played the post/delete/post again game when my post did not appear correctly on the social site. Now I have the habit of checking the preview before I post.
The preview for this post looks like this:
If you have added a post that is more narrowly targeted, you can disable sharing and only include the social sites that are appropriate for that post.
It seems that Jetpack only supports these four platforms, I had hoped for more but I’ll take what I can get.
A first look at running NextCloud in a Docker Container on a Raspberry Pi. The short answer is yes, it is simple. The qualified answer is, it is likely only useful for fun, testing, and one user.
Trying to set up a NextCloud server on a spare Raspberry PI in part of my journey away from the public cloud. An older Raspberry Pi I got stuck on the PHP 7.2 requirement. Spent more than an hour trying to upgrade and felt I wasn’t getting anywhere so I decided to turn to Docker. After all, this is what Docker excels at, package up all the dependencies that each piece of software needs.
So I hit up Docker hub to see if an image was available. Sure enough, there is and it has 500M downloads !!!!
One run command later and I am getting the image onto my aging Raspberry Pi 3 ( let’s see how it handles this. ) I had previously test openhab on this machine, which should explain the name. Eventually, I think I need to rename it to randallcloud or something more clever.
After a bit, I list the containers and boom, NextCloud is running.
It seems the Docker instance of Next Cloud took awhile to settle but after a few minutes ( Raspberry PI3 seems too slow for this. ) I can browse to the login page.
Based on the warning I thinking moving off of SQLLite will be one of the next steps.
So now I just need to add a Admin User name and password, and I think that is all.
The user is created and NextCloud moves on to install the default apps.
In a short time I am presented with a Dashboard, time to test it out!
Next I added an account to be used with my phone and I was able to login. This couldn’t have been easier.
It is a actual sized and designed to pushed on the pins. Inlcuded in this article is a template custom labelled for this project.
Hook-Up Wires
It is easiest to use hookup wire that has one female end and one male end. The female end is easily pushed onto the RaspberryPI pins and the male end is easily inserted into the Breadboard.
1.) Connect One hookup wire from Pin 6 GND on the Raspberry Pi to Column 10 on the Breadboard
2.) Connect One hookup wire from Pin 7 GPIO 4 on the Raspberry Pi to Column 5 on the Breadboard
3. )Place the LED with the Short Lead, the Anode, inserted into Column 10 and the Long Lead, the Cathode into Column 9 on the Breadboard.
Identify LED Parts
The Anode of the LED can be identified in three ways.
It is the Long LEAD/Wire
The Lens will be rounded ( flattened side is cathode )
Looking into the led, the Anode is the “Post” the smaller metal bit.
The Cathode of the LED can also be identified in three ways.
It is the Short Lead/Wire
The Lens will have ( usually ) a small flat spot.
Inside the Lens the wire connects to the “Anvil” or the larger metal piece.
Place the resistor from Column 9 to Column 6 on the Breadboard. The resistor has no polarity, so it can be connected in either direction.
That’s all it takes to hook up the LED.
The resistor is a used to limit the amount of current that goes through the LED, it protects the LED from ever getting to much current and burning out.
To aide with wiring here is a diagram from Fritzing:
Now Let’s Add Code
Log on to your Pi using the Pi Desktop or using SSH to get to a Terminal.
Place the following code into a file named rpi_blink.py ( or whatever name you like ), you just copy this code into your text editor or open your text editor and type it in.
import RPi.GPIO as GPIO
from time import sleep
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(7, GPIO.OUT, initial=GPIO.LOW)
while True:
GPIO.output(7, GPIO.HIGH)
sleep(1)
GPIO.output(7, GPIO.LOW)
sleep(1)
Once you svae the code you can execute the project as follows:
python rpi_blink.py
To stop the code from running press
ctrl-c
Additional Activities
Blink Faster or Slower
To make the LED blink faster you can experiment with different values within the Sleep( ) command.
Try changing the value in Sleep to .1, it should look like this
while True:
GPIO.output(7, GPIO.HIGH)
sleep(.1)
GPIO.output(7, GPIO.LOW)
sleep(.1)
Make sure you change it in both locations/
Blink at different rates
To make the LED stay on for a different amount of time than it stays off change the values in sleep to differnent values.
A quick blink, can look like this:
while True:
GPIO.output(7, GPIO.HIGH)
sleep(.1)
GPIO.output(7, GPIO.LOW)
sleep(1)
It will blink for one tenth of a second then stay off for a full second.
When working with electronics this approach can be used to signal different states.
Experiment with different values to see what you can come up with.
The Fritzing Diagram can be helpful in wiring up the Pi and the LCD, Fristzing contain pin identifications if you hover over the pin.
The Bare Minimum to get a message on Screen
Wire the Components
The Wiring for the Python version of code is the same as the NodeRED version. Follow the wiring section on that post and return here for the code.
Get The Library
$ sudo pip install RPLCD
Coding Python
The beauty of coding for hardware like an LCD on the Raspberry Pi is that the code is already present where it will be executing. There is no need to compile and upload for a Python Script.
If you prefer to code on your desktop it as simple as copying the resulting Python file to your Raspberry Pi.
For this activity we will be coding in the bash shell via an ssh connection.
ssh pi@192.168.13.14 nano pi_lcd.py
Define the pins that will be used
We will use simple variables to define each of the pins connecting the LCD to the Pi. They could be more abbreviated but to help with clarity we will use longer names.
Let’s create any LCD Object using the VAriables we setup above. The RPLCD library does all the hard work all we need to do is import the library and then create an “instance”.
First import the Library
from RPLCD.gpio import CharLCD
Now using the variables we set up earlier we will create the LCD object. The CharLCD class uses keyword args for input. So each argument is a keyword and the value being assigned.
The LCD node requires a string indiacting whcih pins of the LCD are connected to which pins of the pi. The format is shown when you double click the node to configure it.
The “Pins, Type” field will give you the format \: RS, EN, D7, D6, D5, D4, ROW, COL
The pin numbering using Board numbering is 6,5,10,9,8,7,2,16
Add the pin numbering and click done.
Board Numbering: 6,5,10,9,8,7,2,16
GPIO Numbering : 31,29, 26,24,21,19, 2,16
Board numbering is simply sequential with even numbers from 2 on the outer row and odd numbers from 1 on the inner row.
Add an inject node:
Connect the inject node to the LCD node.
Double click the inject node and add a string to,
That’s all there is on the NodeRED end, you can deploy now or wait until after wiring.
If you don’t want to wire up the Flow you can just copy in this:
Let’s wire up our Pi and LCD as follows. Some color coding can help but the colors are not important.
Connect a Wire from “PIN 2” on the RaspberryPI to the Lower rail ( Red ) on your breadboard. This is +5volts and will be used to power the LCD and the LCD Backlight
Connect a second wire from PIN 6 to the Blue Rail on the Breadboard, this will provide the GRound or NEG for the LCD.
Connect the DATA Lines
We can connect the four Data lines from the LCD to any GPIO Pins on the RaspberryPi. In this example, GPIO 7,8,9,10 were selected for visual location and consecutive numbering. As shown we will be using Blue and White wires for the DATA lines but any color can be used.
Connect GPIO10 to the Breadboard directly below the LCD Pin As Shown. It will be the third pin from the left and likely labelled D8, Pin 14 or sometimes DB7.
Connect GPIO 9 to D7 ( DB6 )
Connect GPIO 8 to D6 ( DB5 )
Connect GPIO 7 to D6 ( DB5 )
Connect the Control Lines
There are only two lines that will be used to control the LCD. Enable and Command Mode. The enable line is basically the on/off switch for the LCD connected to the PI and the Command Mode or “Register Select” informs the LCD if it will be receiving a command to act upon or letters to display.
Connect GPIO5 to the Breadboard colum directly beneath the E pin on the LCD.
Connect GPIO6 to the Breadboard colum directly beneath the RS Pin on the LCD
Wire the Contrast Knob
Trimmer/PotentiometerPotentiometer ) to the LCD VO ( Contrast ). Make sure you coonect the “Wiper” the cneter in this case to the column directly beneath the VO
Connect the Dimmer s( Trimmer/Potentiometer ) legs CW and CCW to +5v and Ground, the polarity of these two determine whether the contrast is increased with a Clockwise turn or a Counter-Clockwise turn.
I wanted a tool to quickly show me some of the basic things I needed to work on to harden the security on the various servers I am running. A sort of security checklist. The first tool I have been trying out is the community version of Lynis, and I have enjoyed it so far. With a “Hardeining index” from 1-100, it gives me a great indicator of how I am progressing.
Once installed ( and they have detailed install instructions for many systems ) it is as easy as a single command to get you started:
lynis audit system
you will get a giant ( not too giant ) list of the status of your system and actionable items.
For my scan I fixed a few things moving from 66 to 72 in my first hardening session.
This is a very “Alpha” version of this tool”. It has opportunity for simplification. But is a good starting point. It likely will be more annoying than just doing it by hand. But here it is any way.
Set the length and width of your roof base, include overhang, so it may not be equal to the ceiling, or ceiling plus plates. This can be done in the “Sketch” ( Constraints, Length, and Width )
Place a Clone.
Make a clone of the Joist to place “in situ”, this joist can then be mirrored / copied if necessary.
TODO:
Name the Sketches appropriately
Name Dimensions.
Fix the “Shortening issue”, the basic length from the corners is used making the Joist shorter than it needs to be.
The current Chamfer is equal. So it will be wrong if the Length and Width are not a 2:1 ratio.
Dimension lines don’t move with sketch edges. ( Can set Draft line vertexes to Sketch vertexes … but that is annoying ).
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy
Privacy Overview
This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.