Skip to content

Instantly share code, notes, and snippets.

View thisismyrobot's full-sized avatar
🤖

Robert Wallhead thisismyrobot

🤖
View GitHub Profile
@thisismyrobot
thisismyrobot / hello.py
Created October 16, 2022 22:43
Example of talking to a EM5820 thermal printer
import serial
def hello(port='COM5', baud=9600):
with serial.Serial(port, baud) as conn:
conn.write('Hello, World!\n\n\n')
if __name__ == '__main__':
hello()
@thisismyrobot
thisismyrobot / EICAR.txt
Created February 1, 2019 02:07
EICAR test if you want to see if your web content filtering is working
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
param([String]$url="http://localhost", [String]$successOuput="SUCCESS", [Int32]$totalWaitMinutes=10)
$elapsed = [System.Diagnostics.Stopwatch]::StartNew()
$statusUrl = ($url + "/appstatus")
Write-Warning ("Attempt to start Sitefinity up: " + $statusUrl)
$retryCount = 0;
try
{
@thisismyrobot
thisismyrobot / switch_network.sh
Last active May 12, 2020 08:50
Temporarily switching Wi-Fi networks from the command line on a Raspberry Pi
#!/bin/bash
# Worked example of temporarily switching from a configured network in
# wpa_supplicant.conf to a new network to perform an operation, then returning
# to the original network. An example of this configuration would
# be:
# https://learn.adafruit.com/pi-wifi-radio/raspberry-pi-setup-1-of-3#configure-wireless-networking
#
# Assumes that running `wpa_cli list_networks` will return a single network at
# index 0, the one you want to always be connected to at boot up.
@thisismyrobot
thisismyrobot / dfrobot lcd.py
Last active December 26, 2015 08:00
Very basic test code for controlling DFRobot 3-wire LCD with a Raspberry Pi
# For Raspberry Pi.
# Code based on: http://www.dfrobot.com/wiki/index.php?title=SPI_LED_Module_(SKU:DFR0090)#Sample_Code
import re
import spidev
# 0-9
NUMS = (0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90)
# a-z
@thisismyrobot
thisismyrobot / gist:f7c1836c7b3a7f1dc06d
Created December 26, 2015 04:43
Setting up basic WPA auth on Debian (mainly for Raspberry Pi).
# From https://learn.adafruit.com/adafruits-raspberry-pi-lesson-3-network-setup/setting-up-wifi-with-occidentalis
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
@thisismyrobot
thisismyrobot / init_response.json
Created October 17, 2015 23:06
Parrot Jumping Sumo example initialisation response
{
"status": 0,
"c2d_port": 54321,
"arstream_fragment_size": 65000,
"arstream_fragment_maximum_number": 4,
"arstream_max_ack_interval": -1,
"c2d_update_port": 51,
"c2d_user_port": 21
}
@thisismyrobot
thisismyrobot / socketserver_example.py
Created October 17, 2015 23:00
Configuring SocketServer.UDPServer to receive Parrot Jumping Sumo UDP video packets
import SocketServer
if __name__ == '__main__':
server = SocketServer.UDPServer((HOST, PORT), UDPHandler)
server.max_packet_size = 65000