Skip to content

Instantly share code, notes, and snippets.

View rhom6us's full-sized avatar

Thomas Butler rhom6us

  • Butler Software
  • Atlanta, GA
View GitHub Profile
@amgine
amgine / WindowsMessage.cs
Created April 16, 2012 02:02
All windows messages as C# enum
namespace NAMESPACE
{
public enum WindowsMessage
{
WM_NULL = 0x0000,
WM_CREATE = 0x0001,
WM_DESTROY = 0x0002,
WM_MOVE = 0x0003,
WM_SIZE = 0x0005,
WM_ACTIVATE = 0x0006,
@branw
branw / samd51_1dac_2adc_dma.cpp
Last active March 21, 2024 18:52
Minimum working example of analog data acquisition with one output and two inputs on the SAMD51 Grand Central M4.
// Produces a sawtooth on A0 and samples A1 and A3 into buffers via DMA
#include <Adafruit_ZeroDMA.h>
#include <wiring_private.h> // for access to pinPeripheral
// Create buffers for DMAing data around -- the .dmabuffers section is supposed to
// optimize the memory location for the DMA controller
__attribute__ ((section(".dmabuffers"), used)) static uint16_t dac_buffer[4096], adc_buffer[2][4096];
void setup() {
@daehahn
daehahn / wsl2-network.ps1
Last active October 19, 2024 16:26
WSL 2 TCP NETWORK FORWARDING
# WSL2 network port forwarding script v1
# for enable script, 'Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser' in Powershell,
# for delete exist rules and ports use 'delete' as parameter, for show ports use 'list' as parameter.
# written by Daehyuk Ahn, Aug-1-2020
# Display all portproxy information
If ($Args[0] -eq "list") {
netsh interface portproxy show v4tov4;
exit;
}
// ... application includes here
// CMSIS Math includes
#include "arm_math.h"
#include "arm_const_structs.h"
// using a 1024 point signal
#define FFT_SAMPLES 1024
#define FFT_SAMPLES_HALF (FFT_SAMPLES / 2)
@rhom6us
rhom6us / enable-rdp.sh
Last active July 15, 2022 21:34
Configure Ubuntu to be accessible via RDP
#!/bin/bash
# chmod +x ./enable-rdp.sh
sudo apt install xrdp
sudo systemctl enable --now xrdp
sudo ufw allow from any to any port 3389 proto tcp
sudo ufw allow from any to any port 3399 proto tcp