Skip to content

Instantly share code, notes, and snippets.

buxtonpaul /
Created May 14, 2020
Quick'n'dirty python script to create the display variable for use with WSL2
import os
for line in os.popen('ipconfig.exe'):
if not line[0] in [' ', '\n']:
current_section = line
active = False
if 'Link-local IPv6 Address' in line:
active = True
buxtonpaul / qtbase_i686-w64-mingw32.shared.posix.dw2
Created Aug 23, 2019
View qtbase_i686-w64-mingw32.shared.posix.dw2
This file has been truncated, but you can view the full file.
make[1]: Entering directory '/home/paul/src/mxe'
uname -a
Linux paul-gpu 4.15.0-58-generic #64~16.04.1-Ubuntu SMP Wed Aug 7 14:10:35 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
git log --pretty=tformat:"%H - %s [%ar] [%d]" -1
1b81e99cf78df3b0f89173d6f1bc71159cf190ca - Update packages.json & build-matrix.html [2 days ago] [ (HEAD -> master, origin/master, origin/HEAD)]
lsb_release -a 2>/dev/null || sw_vers 2>/dev/null || true
Distributor ID: Ubuntu
Description: Ubuntu 16.04.6 LTS
Release: 16.04
buxtonpaul / for-each.htm
Last active Nov 27, 2018 — forked from bennadel/for-each.htm
Mutating An Array During .forEach() Iteration In JavaScript
View for-each.htm
<!doctype html>
<meta charset="utf-8" />
Mutating An Array During .forEach() Iteration In JavaScript
buxtonpaul / readbinaryfloats.cpp
Created May 1, 2018
Quick function to read a binary file into a vector
View readbinaryfloats.cpp
template <class T>
std::vector<T> readFile(const char *filename)
std::vector<T> results;
std::ifstream fin(filename, std::ios::binary);
T n;
while (<char *>(&n), sizeof(T)))
return results;
buxtonpaul /
Created Jan 9, 2018
Stay alive bash script. Runs until it sees a file ~/aah.txt, checking every 5 secs
# loop checking for a file, if the file exists exit
for (( ; ; ))
if [ -f ~/aah.txt ]; then
#echo "File Found!"
sleep 5
import numpy as np
import matplotlib.pyplot as plt
import scipy.misc
import png
#import pil
import matplotlib.image as mpimg
def write_pgm(image, filename):
from sense_hat import SenseHat
sense = SenseHat()
r = (255, 0, 0)
o = (255, 127, 0)
y = (255, 255, 0)
g = (0, 255, 0)
b = (0, 0, 255)
i = (75, 0, 130)
buxtonpaul /
Created Jun 19, 2017
Bash script to compile the producer code, create the fifo and run the producer and consumer together
#! /usr/bin/bash
gcc producer.c -o producer
mknod myfifo.txt p
python <myfifo.txt &
rm myfifo.txt
buxtonpaul / producer.c
Created Jun 19, 2017
Sample producer for mknod ipc
View producer.c
#include <stdio.h>
#include <unistd.h>
int main(int argc,char*argv)
FILE *fp;
int i;
buxtonpaul /
Created Jun 19, 2017
Sample python fifo consumer
while True:
if not a:
print a[::-1]
if a == "Hello 9":
You can’t perform that action at this time.