Skip to content

Instantly share code, notes, and snippets.

#! /usr/bin/python
# wakeonlan.py
#
# Wake on LAN
#
# Use:
# wol computer1
# wol computer1 computer2
# wol 00:11:22:33:44:55
@aleksas
aleksas / README.md
Last active March 13, 2024 01:25
Command `DYMO LabelMaster 280` from python on Ubuntu

Script copied from original dymoprint page and modified to include LM280 usb device id 0x1005 and ttf paths changed. Also usb device class changed from 0x3 to 0x7.

  • Install drivers from this repo by following these instructions.
  • Check if Ubuntu detects the LM 280 when connected to computer and powered on.
  • Run the script.
@aleksas
aleksas / CMakeLists.txt
Last active May 16, 2024 13:43
cv::Mat shared memory serializer deserializer into lockfree ring buffer
cmake_minimum_required(VERSION 3.0.0)
project(circular-buffer-queue VERSION 0.1.0)
set(Boost_USE_MULTITHREADED OFF)
add_definitions(-DBOOST_ALL_NO_LIB)
find_package( Boost 1.54 COMPONENTS system thread REQUIRED )
find_package( OpenCV REQUIRED )
include_directories(
${Boost_INCLUDE_DIRS}
cmake_minimum_required(VERSION 3.0.0)
project(circular-buffer-queue VERSION 0.1.0)
set(Boost_USE_MULTITHREADED OFF)
add_definitions(-DBOOST_ALL_NO_LIB)
find_package( Boost 1.54 COMPONENTS system thread REQUIRED )
find_package( OpenCV REQUIRED )
include_directories(
${Boost_INCLUDE_DIRS}
@aleksas
aleksas / CMakeLists.txt
Last active November 12, 2020 22:30 — forked from sehe/Makefile
Boost shared memory lockfree circular buffer queue
cmake_minimum_required(VERSION 3.0.0)
project(circular-buffer-queue VERSION 0.1.0)
set(Boost_USE_MULTITHREADED OFF)
add_definitions(-DBOOST_ALL_NO_LIB)
find_package( Boost 1.54 COMPONENTS system thread REQUIRED )
include_directories(${Boost_INCLUDE_DIRS})
set(LINK_LIBRARIES
@aleksas
aleksas / README.md
Last active November 24, 2023 12:59
Analog-to-digital conversion and acquisition (Arduino DUE + Python)

Analog-to-digital conversion and acquisition (Arduino DUE + Python)

Copied and translated from original published by Frédéric Legrand (archived copy).

1. Introduction

This page shows how to operate the analog-to-digital converter of the Arduino Due, in order to perform sampled acquisitions. The sampling will be done by interrupts triggered by a stopwatch. The samples will be transmitted in a continuous stream to the computer, in order to be plotted in a graphics window or to undergo various treatments.

The arduino code presented can be used as a basis for an on-board application dealing with audio signals.

@aleksas
aleksas / arduino-due_high-speed-ADC.ino
Last active March 12, 2021 09:40 — forked from pklaus/arduino-due_high-speed-ADC.ino
Arduino Due: ADC → DMA → USB @ 1MSPS
#undef HID_ENABLED
// Arduino Due ADC->DMA->USB 1MSPS
// by stimmer
// from http://forum.arduino.cc/index.php?topic=137635.msg1136315#msg1136315
// Input: Analog in A0
// Output: Raw stream of uint16_t in range 0-4095 on Native USB Serial/ACM
// on linux, to stop the OS cooking your data:
// stty -F /dev/ttyACM0 raw -iexten -echo -echoe -echok -echoctl -echoke -onlcr
@aleksas
aleksas / README.md
Last active May 13, 2022 19:59
Raspberry 3B+ | HiFi Berry DAC+ Pro | FluidSynth | MIDI keyboard

DRAFT guide for DIY synth: Alesis V61 + Rapberry 3B+ + HiFi Berry DAC+ Pro

Probably 99% compatible with most synths

Setup fluidsynth

sudo apt-get update -y
sudo apt-get install -y fluidsynth
@aleksas
aleksas / download_github_assets.py
Last active September 22, 2021 10:10
Download github release assets
import os
import urllib.request
import os.path
import json
def download_asset(url, filename, token=None):
headers = {}
headers["Accept"] = 'application/octet-stream'
if token:
@aleksas
aleksas / DS8830_Single_channel_alpha.ino
Last active October 2, 2022 11:53
ADS8330 Manual Trigger Single Channel read (Arduino Due)
#include <SPI.h>
#define ADC_CS_PIN 2
#define ADC_CONVERSION_PIN 3
#define ADC_EOC_PIN 4
enum Command : uint16_t {
SEL_AN_IN_CHANNEL_0 = 0b0000 << 12,
SEL_AN_IN_CHANNEL_1 = 0b0001 << 12,
WAKE_UP = 0b1011 << 12,