Skip to content

Instantly share code, notes, and snippets.

@vegertar
vegertar / use-clang.sh
Created March 3, 2023 02:50
Choose a default clang from multiple versions in DragonFlyBSD
#!/bin/sh
basedir=`dirname $0`
version=${1:-14}
dirname=/usr/local/bin/
run() {
echo $@
$@
}

Ordinarily, the minimal gtest working with cmake can be given by

cmake_minimum_required(VERSION 3.20)
project(gtest_with_cmake)

set(CMAKE_CXX_STANDARD 14)
include(GoogleTest)

enable_testing()
add_executable(example example.cpp)
@vegertar
vegertar / mount-usb-from-normal-user.md
Created February 28, 2023 04:42
Allows non-root users to mount USB sticks on DragonFlyBSD

Activation

See man vfs, search vfs.usermount, hence merely enable user mount by run sysctl vfs.usermount=1

Permission

See man devfsctl, investigate the section EXAMPLES, add some lines into /etc/devfs.conf, in my case, e.g.:

perm    da8s*           whom:whom       0644

Stuff

@vegertar
vegertar / 0001-add-DragonFlyBSD.patch
Created February 26, 2023 06:12
Make pyserial work in DragonflyBSD properly
From 87e58dcc9e372de8399676d9151b634f69ad821d Mon Sep 17 00:00:00 2001
From: Joe Hu <vegertar@gmail.com>
Date: Sat, 25 Feb 2023 08:47:44 +0800
Subject: [PATCH] add DragonFlyBSD
---
serial/serialposix.py | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/serial/serialposix.py b/serial/serialposix.py
/**
* @fileoverview microlight - syntax highlightning library
* @version 0.0.7
*
* @license MIT, see http://github.com/asvd/microlight
* @copyright 2016 asvd <heliosframework@gmail.com>
*
* Code structure aims at minimizing the compressed library size
*/