Skip to content

Instantly share code, notes, and snippets.

View cpjobling's full-sized avatar

Chris P. Jobling cpjobling

View GitHub Profile
@cpjobling
cpjobling / smoke-test.sh
Created June 29, 2023 15:00 — forked from elijahmanor/smoke-test.sh
Font Smoke Test
#/bin/bash
echo "Normal"
echo "\033[1mBold\033[22m"
echo "\033[3mItalic\033[23m"
echo "\033[3;1mBold Italic\033[0m"
echo "\033[4mUnderline\033[24m"
echo "== === !== >= <= =>"
echo "契     勒 鈴 "
@cpjobling
cpjobling / counter1.ino
Last active October 26, 2023 09:37
Experiment 1: Basic counter
// the setup function runs once when you press reset or power the board
byte counter1 = 0; // we need to define the variable counter1
void setup()
{
// initialize Port C pins 0-5 as outputs.
DDRC = 0b00111111; // the prefix &ldquo;0b&rdquo; qualifies the number as binary
PORTC = 0; // so all the LEDs are off initially
}
@cpjobling
cpjobling / ldr_test.c
Last active November 27, 2020 14:09
Micro Mouse motor simulation programme for Arduino Nano. Written by Dr Timothy Davies for EG-151 Microcontrollers, (c) Swansea University 2020.
// the setup function runs once when you press reset or power the board
void setup()
{
Serial.begin(9600);
Serial.println();
Serial.println("Line sensor test programme");
}
// the loop function runs over and over again forever
#! /bin/bash
# I need to source conda
source ~/anaconda3/bin/activate base
# Find the interesting output in stderr
mycmd='jupyter notebook --no-browser'
exec 3< <($mycmd 2>&1)
a=$(grep -o -m1 'http://localhost.*' <&3)
echo $a
@cpjobling
cpjobling / eg-252-shuffle.py
Last active November 15, 2019 16:31
Random shuffle a list of EG-252 groups for assessment, tec
import random
teams = ["alpha","bravo","charlie","delta","echo",
"foxtrot","golf","hotel","india","juliet",
"kilo","lima","mike","november","oscar"]
random.shuffle(teams)
print(teams)
@cpjobling
cpjobling / brew-dart-caveat.txt
Created June 15, 2015 07:46
brew dart caveat
brew tap dart-lang/dart
Warning: Already tapped!
➜ ~ brew install dart --with-content-shell --with-dartium
==> Upgrading dart-lang/dart/dartium
==> Downloading https://storage.googleapis.com/dart-archive/channels/stable/rele
######################################################################## 100.0%
==> Downloading https://storage.googleapis.com/dart-archive/channels/stable/rele
######################################################################## 100.0%
==> Caveats
DEPRECATED
@cpjobling
cpjobling / ren.sh
Last active August 29, 2015 14:21
Rename BB Gradbook files
GB_NAME="Submission of Lab Work Portfolio"
mmv -r $GB_NAME'_*_attempt_*.*' '#1.#3'
@cpjobling
cpjobling / README
Last active August 29, 2015 14:09
Errors in your push requestEG-252 Git Exercise =================== An assessed exercise which demonstrates that you have achieved basic competence in using Git for version control. See Lab 4 on Blackboard for the accompanying instructions. <<<<<<< HEAD **This work was submitted for assessment by name (number) on date** ======= **This work was su…
EG-252 Git Exercise
===================
An assessed exercise which demonstrates that you have achieved basic competence in using Git for version control.
See Lab 4 on Blackboard for the accompanying instructions.
<<<<<<< HEAD
**This work was submitted for assessment by name (number) on date**
=======
**This work was submitted for assessment by Omar Khalil (713626) on 18th Nov 2014**
#!/bin/sh
# Remove old images from Ubuntu and clean up /boot and grub.
#
# Original Source: [Ubuntu Cleanup: How to Remove All Unused Linux Kernel Headers, Images and Modules](http://ubuntugenius.wordpress.com/2011/01/08/ubuntu-cleanup-how-to-remove-all-unused-linux-kernel-headers-images-and-modules/)
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
@cpjobling
cpjobling / gist:5501081
Created May 2, 2013 09:06
Brew Install PostgresQL
# Build Notes
If builds of PostgreSQL 9 are failing and you have version 8.x installed,
you may need to remove the previous version first. See:
https://github.com/mxcl/homebrew/issues/issue/2510
To build plpython against a specific Python, set PYTHON prior to brewing:
PYTHON=/usr/local/bin/python brew install postgresql
See:
http://www.postgresql.org/docs/9.2/static/install-procedure.html