Skip to content

Instantly share code, notes, and snippets.

View Simon-L's full-sized avatar
😠
Leaving Github!

FergusL Simon-L

😠
Leaving Github!
  • Not Microsoft
  • Paris, France
View GitHub Profile
@Simon-L
Simon-L / install.sh
Created September 2, 2017 23:57
How to install prebuilt puredata from zip
cd pd-x.xx-x/
sudo cp bin/* /usr/local/bin/
sudo mkdir /usr/local/lib/pd
sudo cp -r bin doc extra po tcl /usr/local/lib/pd/
@Simon-L
Simon-L / README.md
Created June 9, 2022 00:24
__cxa_pure_virtual

Compile: g++ -std=c++11 -fPIC -fno-gnu-unique -MMD -MP -g -O3 -march=nehalem -funsafe-math-optimizations -fno-omit-frame-pointer -o purevirtual main.cpp -static-libstdc++ -static-libgcc
Try it on your x64 host? Segfault!
Remove the static linking? It catches pure virtual call!

Useful read? https://stackoverflow.com/a/14082540

Result on arm64:

box64 ./purevirtual
@Simon-L
Simon-L / main.cpp
Created June 9, 2022 16:09
bare minimum dlsym (dlopen bug on box64)
#include <cstdio>
#include <dlfcn.h>
typedef void (*LibFunc)();
LibFunc getSym(const char* sopath) {
void* handle = dlopen(sopath, RTLD_NOW | RTLD_LOCAL);
if (!handle) {
printf("Oops exit1!\n");
return (LibFunc)(0);
@Simon-L
Simon-L / Makefile
Last active October 28, 2022 07:39
# Untar this in current dir
# https://github.com/alandefreitas/matplotplusplus/releases/download/v1.1.0/matplotplusplus-1.1.0-Linux.tar.gz
LDFLAGS = lib/libmatplot.a lib/Matplot++/libnodesoup.a -lpng -lz -ltiff -ljpeg
CXXFLAGS = -std=c++17 -I../chowdsp_wdf/include -Iinclude
SRC = main.cpp
OUT = main
$(OUT): $(SRC)
@Simon-L
Simon-L / ADAREnvelope.h
Created January 9, 2023 16:53
Reusing ADAREnvelope...
// Taken from Surge XT for Rack, minimal changes - 2023 SL
// Original license below:
/*
* SurgeXT for VCV Rack - a Surge Synth Team product
*
* Copyright 2019 - 2022, Various authors, as described in the github
* transaction log.
*
* SurgeXT for VCV Rack is released under the Gnu General Public Licence
* V3 or later (GPL-3.0-or-later). The license is found in the file
@Simon-L
Simon-L / panic.log
Created April 9, 2023 14:51
rg351m boot panic 6.3-rc5
[ 2.795586] dw-mipi-dsi-rockchip ff450000.dsi: Failed to create device link (0x180) with backlight
[ 2.800733] usb 1-1.2: Manufacturer: OpenSimHardware
[ 2.800742] usb 1-1.2: SerialNumber: 0M25O6T36BNAKO
[ 2.829226] input: OpenSimHardware OSH PB Controller Keyboard as /devices/platform/ff300000.usb/usb1/1-1/1-1.2/1-1.2:1.0/0003:1209:3100.0001/input/input2
[ 2.831686] rockchip-drm display-subsystem: bound ff460000.vop (ops vop_component_ops)
[ 2.854101] rockchip-drm display-subsystem: bound ff450000.dsi (ops dw_mipi_dsi_rockchip_ops)
[ 2.865710] [drm] Initialized rockchip 1.0.0 20140818 for display-subsystem on minor 0
[ 2.874892] ------------[ cut here ]------------
[ 2.880096] WARNING: CPU: 2 PID: 9 at drivers/gpu/drm/drm_mode_object.c:45 __drm_mode_object_add+0x68/0xd8
[ 2.890939] Modules linked in:
@Simon-L
Simon-L / .config
Last active April 9, 2023 15:21
6.2 .config for rg351m
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 6.2.0 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="aarch64-linux-gnu-gcc (Debian 12.2.0-14) 12.2.0"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=120200
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=24000
@Simon-L
Simon-L / README.md
Last active April 16, 2023 20:57
Boot LXC ready-to-go arm64 images in QEMU on amd64

⚠️ Quickly put together in April 2023, you're reading a gist, not a community wiki. It's fundamentally hacky, heavily summarized, and might be out-of-date, make sure you're familiar with the concepts before attempting this!

So, for some reason, the arm64 images used in lxc don't run on amd64 qemu by default.

The images are hosted here: https://us.lxd.images.canonical.com/images/
We will go for an ubuntu jammy arm64 image: https://us.lxd.images.canonical.com/images/ubuntu/jammy/arm64/default/20230413_07:43/disk.qcow2
There are plenty to choose from, just make sure to pick the qcow2 file
If you have lxc you can also run: lxc image export images:ubuntu/jammy/arm64 --vm images_ubuntu_arm64

It's a good thing to make a backup of this file as we're going to change it right away.

diff --git a/src/surge-xt/osc/OSCListener.cpp b/src/surge-xt/osc/OSCListener.cpp
index a209970f..8ed102ce 100644
--- a/src/surge-xt/osc/OSCListener.cpp
+++ b/src/surge-xt/osc/OSCListener.cpp
@@ -128,6 +128,24 @@ void OSCListener::oscMessageReceived(const juce::OSCMessage &message)
#ifdef DEBUG_VERBOSE
std::cout << "Parameter OSC name:" << p->get_osc_name() << " ";
std::cout << "Parameter full name:" << p->get_full_name() << std::endl;
+#endif
+ }
@Simon-L
Simon-L / build.sh
Created May 3, 2023 11:17
JELOS build DO vm
#! /bin/bash
apt install build-essential docker.io
cd ~
git clone https://github.com/JustEnoughLinuxOS/distribution.git
cd distribution/
# change netbase to 5.6
# adapt flags here
EMULATION_DEVICE=no ENABLE_32BIT=no make docker-AMD64
tar -czvf release.tar.gz release/