Skip to content

Instantly share code, notes, and snippets.

View supaplextor's full-sized avatar

Scott Edwards supaplextor

  • United States
View GitHub Profile
qemu-system-amd64 -accel kvm -m 8000 \
-cpu kvm64 \
-drive file=ubuntu-24.04.2-desktop-amd64.hda,format=raw \
-cdrom ubuntu-24.04.2-desktop-amd64.iso
QEMU 8.2.2 monitor - type 'help' for more information
(qemu) help
announce_self [interfaces] [id] -- Trigger GARP/RARP announcements
balloon target -- request VM to change its memory allocation (in MB)
block_job_cancel [-f] device -- stop an active background block operation (use -f
if you want to abort the operation immediately
instead of keep running until data is in sync)
block_job_complete device -- stop an active background block operation
block_job_pause device -- pause an active background block operation
block_job_resume device -- resume a paused background block operation
@supaplextor
supaplextor / M5atom-FastLED-grove-WS2813-PoC-police.ino
Created November 12, 2020 03:31
Proof Of Concept FastLED with M5Atom
#include <M5StickC.h> // should work with any grove port really. i2c?
#include <FastLED.h> // https://github.com/FastLED/FastLED
/* note, two led strips in use, one cell onboard and the rest on another strip. */
#define NUM_LEDS 20
#define DATA_PIN 32 // large strip
CRGB leds[NUM_LEDS+1];
CRGB dot[0];
uint8_t cell = 0;
@supaplextor
supaplextor / dhcpd.conf.inc
Created September 5, 2019 21:14
dhcpd.conf snippet Debian FAI
host compute206 {
hardware ethernet 50:65:f3:36:b6:5a;
if substring (option vendor-class-identifier, 0, 3) = "d-i" {
# request2
filename "http://192.168.50.100/~supaplex/.fai.txt";
}
if substring (option vendor-class-identifier, 0, 3) != "d-i" {
# request1
filename "/srv/tftp/amd64/pxelinux.0";
}
@supaplextor
supaplextor / ota_sample.ino
Created August 1, 2019 04:46
esp8266 and possibly esp32 OTA
void ota_starter() {
//OTA SETUP
ArduinoOTA.setPort(OTAport);
ArduinoOTA.setHostname("LEDMatrix18"); // Hostname defaults to esp8266-[ChipID]
ArduinoOTA.setPassword((const char *)OTApassword); // No authentication by default
ArduinoOTA.onStart([]() {
Serial.println("Starting OTA");
});
ArduinoOTA.onEnd([]() {
void handleRoot()
{
if (!server.authenticate("admin", "secret")) {
return server.requestAuthentication();
}
server.send(200, "text/html", "<html><p>foo</p></html>");
}
void httpd_starter() { // call from setup()
// Set up the endpoints for HTTP server, Endpoints can be written as inline functions:
#!/usr/bin/perl
#
# compile a pdf deck from slideshare.net
use warnings;
use strict;
use LWP::UserAgent;
use HTML::Parser;
use Tie::IxHash;
use Data::Dumper;
@supaplextor
supaplextor / dht11-esp8266-arduino.cpp
Created June 6, 2019 03:51
Barebones DHT11 Arduino ESP8266 Serial monitor
#include <Arduino.h>
#include <DHTesp.h>
DHTesp dht;
void setup() {
Serial.begin(115200);
dht.setup(D5, DHTesp::DHT11);
}
@supaplextor
supaplextor / pg_init.d.sh
Last active April 24, 2018 23:06 — forked from buruzaemon/gist:5351379
Sample Postgresql start/stop script for Cygwin
#!/usr/bin/bash
CYGWIN=server
CYGSERVER=/usr/sbin/cygserver
PGDATA=/usr/share/postgresql/data
PGCTL=/usr/sbin/pg_ctl
PGLOG=/var/log/postgresql.log
usage() {
echo "USAGE: pg (start|stop|restart|reload|status)"
echo