Skip to content

Instantly share code, notes, and snippets.

View anselanza's full-sized avatar
👋

Stephen Buchanan anselanza

👋
  • Amsterdam, The Netherlands
View GitHub Profile
@anselanza
anselanza / gist:df79695add3339e32a804baf1f7d4022
Last active September 3, 2021 15:12
Datadog for Raspberry Pi
# Use instructions as per https://github.com/DataDog/documentation/blob/master/content/en/developers/faq/deploying-the-agent-on-raspberrypi.md
# Create datadog.service file: `sudo nano /etc/systemd/system/datadog.service` as below
# Edit ~/.datadog-agent/agent/datadog.conf to custom hostname
# `sudo systemctl daemon-reload`
# `sudo systemctl enable datadog`
# `sudo service datadog start` and `sudo service datadog status`
[Unit]
Description=Start Datadog Agent
# Based on https://gist.github.com/imyelo/b6c3d3d9383f7d5623f06a0c11052530
# Added restart settings, which are super important!
# `sudo mkdir /usr/local/frp`
# Copy both frpc and frpc.ini under /usr/local/frp/
# Create this file (frpc.service) at /etc/systemd/system, i.e. `sudo nano /etc/systemd/system/frpc.service`
# run `sudo systemctl daemon-reload && sudo systemctl enable frpc`
# run `sudo systemctl start frpc`
# Then we can manage frpc with `sudo service frpc {start|stop|restart|status}`
@anselanza
anselanza / ffmpeg-movie-to-gif.md
Created December 17, 2020 09:13
ffmpeg to convert a video to animated GIF

Useful for converting screenshots, for example. Note the reduced framerate and scale (which can be changed) to help with reduced filesizes:

ffmpeg -i some-video.mov -filter_complex "[0:v] fps=12,scale=480:-1,split [a][b];[a] palettegen [p];[b][p] paletteuse" output.gif
@anselanza
anselanza / gui_ssh_mac.md
Last active March 22, 2024 09:39
Viewing graphical output on from a remote Linux host, on your Mac

This is not for full desktop screen sharing. It allows you to forward the graphical contents of individual windows to your Mac from a remote Linux machine, regardless of whether that machine is connected to a physical display or not.

Steps below based very much on https://unix.stackexchange.com/a/46748

1. Install X11 server

You will need XQuartz, since X11 server is not installed with MacOS after version 10.7

Download here: https://www.xquartz.org/

2. Enable forwarding on server

@anselanza
anselanza / sketch.js
Created December 20, 2017 15:16
Basic example using p5js as npm module, without using global context
// As shown in https://github.com/processing/p5.js/wiki/Global-and-instance-mode
import p5 from 'p5';
let myP5 = new p5( function (sketch) {
// for red, green, and blue color values
let r, g, b;
sketch.setup = function() {