Skip to content

Instantly share code, notes, and snippets.

@yds
yds / BetaFlightNightlies.get
Last active October 18, 2021 13:25
Shell script to fetch BetaFlight Configurator, BlackBox-Explorer and TX-Lua-Scripts nightlies plus PIDtoolbox
#!/bin/sh -
URL='https://github.com/betaflight/betaflight-configurator-nightlies/releases/'
BIN='betaflight-configurator-installer_([0-9]+\.[0-9]+\.[0-9]+)-.*_win64\.exe'
AWK="/$BIN/ { match(\$0,/$BIN/); print substr(\$0,RSTART,RLENGTH); exit }"
BIN=$(curl -Ls "$URL" | awk "$AWK")
VER=$(echo "$BIN" | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')
AWK="/$BIN/ { match(\$0,/\/.*\/$BIN/); print substr(\$0,RSTART,RLENGTH); exit }"
URL=$(curl -Ls "$URL" | awk "$AWK")
BIN="BetaFlight-Configurator-Installer_${VER}_Win64.exe"
echo $BIN
@yds
yds / OmnibusF4.uav
Last active April 20, 2021 22:50
OmnibusF4 template
<uavobjects>
<settings>
<object id="0x9FB75C18" name="ActuatorSettings">
<field name="MotorInputOutputCurveFit" values="0.75"/>
<field name="MotorInputOutputGain" values="0.8"/>
<field name="TimerUpdateFreq" values="65534,65534,65534,50,50,50"/>
<field name="ChannelMax" values="2047,2047,2047,2047,0,0,0,0,0,0"/>
<field name="ChannelNeutral" values="100,100,100,100,0,0,0,0,0,0"/>
<field name="ChannelMin" values="0,0,0,0,0,0,0,0,0,0"/>
<field name="ChannelDeadband" values="1,2,2,1,0,0,0,0,0,0"/>
@yds
yds / 0001-Zfs-provision-1.patch
Created July 26, 2020 19:49
Check if sysvol is on filesystem with ZFS ACLs cherry picked from <https://Bugs.FreeBSD.org/bugzilla/show_bug.cgi?id=239105#c47>
From 2664c997587416a2c8c911a75158485a5c98b70b Mon Sep 17 00:00:00 2001
From: John Hixon <john@ixsystems.com>
Date: Sat, 20 May 2017 04:39:37 +0200
Subject: [PATCH] Zfs provision (#1)
Cherry-pick ZFS provisioning code by iXsystems Inc.
* Check if sysvol is on filesystem with ZFS ACLs
(cherry picked from <https://Bugs.FreeBSD.org/bugzilla/show_bug.cgi?id=239105#c47>)
@yds
yds / DarkMonokai.qss
Last active April 28, 2020 02:05 — forked from Zren/DarkMonokai.qss
Dark Monokai - Quassel Theme (qss)
/**
** ____ _ ___ ___ _ _
** | _ \ | | | \/ | | | (_)
** | | \ |__ _ _ __| | __ | . . | ___ _ __ ___ | | __ __ _ _
** | | | | _` | '__| |/ / | |\/| |/ _ \| '_ \ / _ \| |/ // _` | |
** | |_/ /(_| | | | < | | | | (_) | | | | (_) | <| (_| | |
** |____/\__,_|_| |_|\_\ \_| |_/\___/|_| |_|\___/|_|\_\\__,_|_|
**
** Quassel Theme
**
@yds
yds / powerdns.diff
Created March 9, 2020 18:33
FreeBSD port update of pdns_server to 4.3.0-beta2
diff -ruN powerdns~4.2.1/Makefile powerdns/Makefile
--- powerdns~4.2.1/Makefile 2020-01-22 00:53:20.000000000 -0500
+++ powerdns/Makefile 2020-03-09 12:23:23.187001000 -0400
@@ -1,8 +1,7 @@
# $FreeBSD$
PORTNAME= powerdns
-DISTVERSION= 4.2.1
-PORTREVISION= 1
+DISTVERSION= 4.3.0-beta2
@yds
yds / PowerDNS.out
Created March 9, 2020 17:45
ext/lmdb-safe/lmdb-safe.cc:16:50: error: reference to 'string_view' is ambiguous
libtool: compile: c++ -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -pthread -I/usr/local/include -I/usr/local/include -isystem /usr/local/include -DPIE -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 --param ssp-buffer-size=4 -fstack-protector -g -O2 -Wall -Wextra -Wshadow -Wno-unused-parameter -O3 -pipe -march=nocona -fstack-protector-strong -DLDAP_DEPRECATED -isystem /usr/local/include -fno-strict-aliasing -DLDAP_DEPRECATED=1 -isystem /usr/local/include -MT ../../ext/lmdb-safe/lmdb-safe.lo -MD -MP -MF ../../ext/lmdb-safe/.deps/lmdb-safe.Tpo -c ../../ext/lmdb-safe/lmdb-safe.cc -fPIC -DPIC -o ../../ext/lmdb-safe/.libs/lmdb-safe.o
../../ext/lmdb-safe/lmdb-safe.cc:16:50: error: reference to 'string_view' is ambiguous
MDBDbi::MDBDbi(MDB_env* env, MDB_txn* txn, const string_view dbname, int flags)
^
../../ext/lmdb-safe/lmdb-safe.hh:20:14: note: candidate found by name lookup is 'string_view'
using boost::string_view;
^
/usr/include/c++/v1/string_view:770:37: no
@yds
yds / strptime.lua
Last active March 24, 2019 00:37
Lua posix.time.strptime strangeness
#!/usr/local/bin/luajit
-- vim: set ft=lua:
if not arg[1] or arg[1] == '-h' or arg[1] == '--help' then
print(string.format(' Usage: %s YYYY[MM][DD][HH][MM][SS]', arg[0]))
os.exit()
end
local date = arg[1]
if date:len() == 4 then date = date..'0101000000 '
elseif date:len() == 6 then date = date..'01000000 '
@yds
yds / keybase.md
Created September 28, 2018 13:12
Keybase proof

Keybase proof

I hereby claim:

  • I am yds on github.
  • I am yds (https://keybase.io/yds) on keybase.
  • I have a public key ASA4-Kpynqxor9665ltS7NRufuPByewCV1n4d8zlz2XXjQo

To claim this, I am signing this object:

@yds
yds / OmnibusF3.uav
Last active February 23, 2018 20:59
OmnibusF3 UAV settings
<uavobjects>
<version>
<hardware revision="1" serial="2b0030001757344836373720" type="ce"/>
<firmware date="20180213 03:02" hash="020e58fb" tag="Release-20180212.2"/>
<gcs date="20180213" hash="020e58fb" tag="Release-20180212.2"/>
</version>
<settings>
<object id="0x926EE978" name="ActuatorSettings">
<field name="LowPowerStabilizationMaxPowerAdd" values="0.15000000596046448"/>
<field name="MotorInputOutputCurveFit" values="0.8999999761581421"/>
@yds
yds / CharOnScreenDisplaySettings.uav
Last active January 14, 2018 20:37
dRonin CharOSD Settings
<uavobjects>
<settings>
<object id="0xCA616496" name="CharOnScreenDisplaySettings">
<field name="VideoStandard" values="Autodetect-Prefer PAL"/>
<field name="CustomText" values="100,82,111,110,105,110,79,83,68,0"/>
<field name="Font" values="Regular"/>
<field name="PanelType" values="GPS,Latitude,Longitude,ArmedFlag,RSSI,FlightMode,Pitch,Horizon,Throttle,GroundSpeed,Altitude,Roll,FlightTime,HomeDistance,HomeDirection,BatteryVolt,BatteryCurrent,BatteryConsumed,Crosshair,Alarms,Disabled,Disabled,Disabled,Callsign"/>
<field name="X" values="1,8,19,1,26,23,25,8,1,4,25,2,23,10,18,1,10,18,14,10,0,0,0,10"/>
<field name="Y" values="1,1,1,2,13,2,8,6,13,3,5,8,13,3,3,14,14,14,7,11,0,0,0,13"/>
</object>