Skip to content

Instantly share code, notes, and snippets.

View miketrebilcock's full-sized avatar

Mike Trebilcock miketrebilcock

View GitHub Profile
@miketrebilcock
miketrebilcock / PasswordResetService.cs
Last active August 14, 2022 21:16
Password Resetting in Servicestack
using CORE.Kernel.ExtensionMethods;
using CORE.Models;
using ServiceStack.Common;
using ServiceStack.Common.Web;
using ServiceStack.FluentValidation;
using ServiceStack.ServiceHost;
using ServiceStack.ServiceInterface;
using ServiceStack.ServiceInterface.Auth;
using ServiceStack.ServiceInterface.ServiceModel;
using ServiceStack.ServiceInterface.Validation;
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install --cask google-chrome
brew install --cask vscodium
brew install --cask postman
brew install --cask zoom
brew install --cask microsoft-teams
brew install --cask android-studio
brew install --cask flutter
brew install --cask fork
brew install git-lfs
@miketrebilcock
miketrebilcock / install.sh
Last active August 24, 2020 20:39
OrangePi Install Script
apt update
apt upgrade
curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -
sudo apt -y install nodejs
## https://diyprojects.io/orange-pi-review-opi-gpio-package-node-red-node-red-contrib-opi-gpio/#.X0QkspNKjmE
@miketrebilcock
miketrebilcock / download.sh
Created October 1, 2018 17:00
Download for cubs
git clone https://github.com/miketrebilcock/scouts-digital-maker-stage1.git
sudo apt-get -y update
sudo apt-get -y dist-upgrade
sudo apt-get -y install rpi-update
sudo rpi-update
sudo apt-get -y install python-software-properties
sudo apt-add-repository ppa:remmina-ppa-team/remmina-next
sudo apt-get -y install remmina freerdp-x11 remmina-plugin-rdp
sudo apt-get -y install iceweasel
sudo apt-get -y update
sudo apt-get -y upgrade
@miketrebilcock
miketrebilcock / traffic_light_demo.py
Created August 31, 2016 19:04
Raspberry Pi Traffic Lights Demo
from gpiozero import LED
from time import sleep
green = LED(22)
amber = LED(27)
red = LED(17)
def all_off():
green.off()
i=1; while true; do fn=$(printf "%05d" $i); if [[ ! -e "img_$fn.jpeg" ]]; then echo "File not found: $fn"; fi ; i=$(expr $i + 1); done | less
import smbus
from gpiozero import Button
import time
class joystick:
def __init__(self, button_pin):
self.i2cbus = smbus.SMBus(1)
self.i2cbus.write_byte(0x48,0)
self.button = Button(button_pin)
@miketrebilcock
miketrebilcock / CustomApplicationStore
Created September 21, 2013 18:30
CustomApplicationStore for use with Servicestack when running self-hosted. Need to include DotNetOpenAuth in project.
using DotNetOpenAuth.Configuration;
using DotNetOpenAuth.Messaging.Bindings;
using DotNetOpenAuth.OpenId;
using ServiceStack.Logging;
using ServiceStack.Redis;
using System;
using System.Collections.Generic;
using System.Linq;
namespace CORE.STS
@miketrebilcock
miketrebilcock / main.cs
Created July 2, 2013 19:10
Using TopShelf to Host Service Stack
public static void Main(string[] args)
{
var appSettings = new AppSettings();
AppConfig config = new AppConfig(appSettings);
HostFactory.Run(x =>
{
x.UseLog4Net();
x.Service<AppHost>(s =>
{