Skip to content

Instantly share code, notes, and snippets.

View PJTewkesbury's full-sized avatar

Peter T PJTewkesbury

View GitHub Profile
@PJTewkesbury
PJTewkesbury / Lsyncd Technical Session.md
Created November 20, 2022 15:33 — forked from mralexjuarez/Lsyncd Technical Session.md
Quick Tutorial on Using Lsyncd

Lsyncd Technical Session

So what is lsyncd?

Lsyncd is a tool used to keep a source directory in sync with other local or remote directories. It is a solution suited keeping directories in sync by batch processing changes over to the synced directories.

When would we use lsyncd?

So the generic use case is to keep a source directory in sync with one or more local and remote directories.

Install raspbian, set up your users however you would like, so long as you have sudo access on the user you are running this with. You probably want to resize the image so it fills the SD card as well.

  1. Copy this entire gist to your raspberry pi
  2. Do chmod +x step1.sh step2.sh iptables.sh in the gist folder (so that
  3. Run step1.sh a) This script does a few things - it first updates your raspberry pi, then it installs a few needed utilities, then it upgrades the firmware on your raspberry pi
#include <wiringPi.h>
#include <wiringPiSPI.h>
#include <iostream>
#include <stdint.h>
int main() {
wiringPiSetup();
if(wiringPiSPISetup(0, 6000000) < 0) {
std::cerr << "wiringPiSPISetup failed" << std::endl;
}
@PJTewkesbury
PJTewkesbury / SolarInfo.cs
Last active April 29, 2016 14:53 — forked from cstrahan/SolarInfo.cs
A sunrise/sunset calculator.
// http://www.esrl.noaa.gov/gmd/grad/solcalc/calcdetails.html
// http://www.esrl.noaa.gov/gmd/grad/solcalc/index.html
using System;
using System.Diagnostics;
namespace SunriseCalculator
{
public class SolarInfo