This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
from gpiozero import LED | |
from time import sleep | |
from random import randint | |
led1 = LED(21) | |
led2 = LED(20) | |
led3 = LED(16) | |
led4 = LED(12) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
from gpiozero import Button, LED | |
from signal import pause | |
from time import sleep | |
from os import system | |
button = Button(21, hold_time=3) | |
led = LED(20) | |
def shutdown_pi(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Desktop Entry] | |
Version=1.0 | |
Name=Chromium Web Browser - Auto Proxy | |
Name[ast]=Restolador web Chromium | |
Name[bg]=Уеб четец Chromium | |
Name[bn]=ক্রোমিয়াম ওয়েব ব্রাউজার | |
Name[bs]=Chromium web preglednik | |
Name[ca]=Navegador web Chromium | |
Name[ca@valencia]=Navegador web Chromium | |
Name[da]=Chromium netbrowser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo cp /boot/cmdline.txt /boot/cmdline.txt.orig | |
#add init=/usr/lib/raspi-config/init_resize.sh to end of cmdline.txt | |
##sudo wget -qO /boot/cmdline.txt https://github.com/RPi-Distro/pi-gen/raw/dev/stage1/00-boot-files/files/cmdline.txt | |
##wget -qO - https://github.com/RPi-Distro/pi-gen/raw/dev/stage2/01-sys-tweaks/00-patches/07-resize-init.diff | sudo patch -p3 -d /boot | |
sudo wget -qO /etc/init.d/resize2fs_once https://github.com/RPi-Distro/pi-gen/raw/dev/stage2/01-sys-tweaks/files/resize2fs_once | |
sudo chmod +x /etc/init.d/resize2fs_once | |
sudo systemctl enable resize2fs_once |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
from bluedot import BlueDot | |
from gpiozero import CamJamKitRobot, LED | |
from signal import pause | |
bd = BlueDot() | |
robot = CamJamKitRobot() | |
blue = LED(24) | |
red = LED(23) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Connect to MineCraft | |
from mcpi.minecraft import Minecraft | |
mc = Minecraft.create() | |
# Get our current position | |
x, y, z = mc.player.getPos() | |
# define our blocks we will be using | |
stone = 1 | |
brick = 45 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir /home/pi/Documents/SpaceInvaders | |
mkdir /home/pi/Documents/SpaceInvaders/images | |
cd /home/pi/Documents/SpaceInvaders/images | |
wget https://github.com/jonwitts/PygameZero-Space/raw/master/images/alien.png | |
wget https://github.com/jonwitts/PygameZero-Space/raw/master/images/laser.png | |
wget https://github.com/jonwitts/PygameZero-Space/raw/master/images/rocket.png | |
cd /home/pi/mu_code/sounds | |
wget https://pygame-zero.readthedocs.io/en/stable/_static/eep.wav |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import the panda module - install https://pandas.pydata.org/docs/getting_started/install.html#installing-from-pypi | |
import pandas as pd | |
# read the webpage into python | |
url = r'https://en.wikipedia.org/wiki/FTSE_100_Index?fbclid=IwAR2V6kJA4d6mNqJaouVZ3ule6nuV4YS8tKtJutW98M_wmtQblHtcZOgmmVI' | |
tables = pd.read_html(url) # Returns list of all tables on page | |
ftse = (tables[2]) # the third table in the webpage (zero indexed lists in python) | |
print(ftse) # check we have the data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- SQL Script to get the latest student photos out of iSAMS | |
SELECT txtEmailAddress, | |
(SELECT TOP (1) txtPath FROM TblPupilManagementPictures | |
WHERE (txtSchoolID = TblPupilManagementPupils.txtSchoolID) | |
ORDER BY intOrder DESC) AS txtPupilPicturePath | |
FROM TblPupilManagementPupils | |
WHERE (intSystemStatus = '1') AND | |
((SELECT TOP (1) txtPath | |
FROM TblPupilManagementPictures AS TblPupilManagementPictures_1 | |
WHERE (txtSchoolID = TblPupilManagementPupils.txtSchoolID) |