Skip to content

Instantly share code, notes, and snippets.

View roncapat's full-sized avatar
🤖
Making Robots

Patrick Roncagliolo roncapat

🤖
Making Robots
View GitHub Profile

DW3000 "missing manual" notes

Overall

The DW3000 is an exciting part, available as a convenient Arduino-shield eval board with good distribution. HOWEVER, this is NOT a "maker friendly" part with SparkFun or Adafruit type tutorials and examples! It is a sophisticated radio that can be the heart of a positioning system, but you have to do quite a lot of heavy lifting to get there.

For basic use, the older-but-still-good DW1000 may be a better choice; interface libraries are available for Arduino and Raspberry Pi. Or look into packaged location-system vendors, like Estimote, Pozyx, Ubitrack and many others

@kgjenkins
kgjenkins / README.md
Last active November 30, 2022 09:38
QGIS Python to automatically update layer from data source

The following Python code will, every 30 seconds, automatically update the data from the source for any QGIS layer with 'autoUpdate' in the layer name. Each time it updates, it will put the timestamp in the layer name, although you could leave that part out.

This is particularly useful for remote data sources like json-over-http or even local CSV files that might be changed by another program while the QGIS project is open.

Just paste the code into the QGIS Python console.

import threading
import datetime
@nitheeshkl
nitheeshkl / gige_gst_v4l.md
Last active May 2, 2024 08:02
Gstreamer pipelines to use GigE cams as webcam for Zoom/Teams/Skype

Using GigE cam as webcam for Zoom/Skype/Teams

TL;DR: Creates a Gstreamer pipeline to read camera frames from a GigE camera, using Aravis library, and publish them as V4l2 camera source, using V4l2loopback, that can be read by video conferencing programs like Zoom/Skype/Teams.

gst-launch-1.0 aravissrc blocksize=5013504 h-binning=1 v-binning=1 ! video/x-bayer,format=rggb,framerate=100/5,width=2448,height=2048 ! bayer2rgb ! video/x-raw,format=RGBx ! videoconvert ! video/x-raw,format=YUY2 !  aspectratiocrop aspect-ratio=16/9 ! videoscale ! video/x-raw,width=1280,height=720 ! queue ! v4l2sink device=/dev/video0

The Basics

@dtrugman
dtrugman / defer.hpp
Last active April 22, 2024 00:34
GO's defer-like implementation for CPP
/*
* Copyright (c) 2020-present Daniel Trugman
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@narate
narate / create-hotspot.md
Last active April 15, 2024 14:22
Create Wi-Fi Hotspot on Linux using nmcli

Create a Wi-Fi hotspot on Linux using nmcli

Original post : https://unix.stackexchange.com/a/310699

nmcli con add type wifi ifname wlan0 con-name Hostspot autoconnect yes ssid Hostspot
nmcli con modify Hostspot 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared
nmcli con modify Hostspot wifi-sec.key-mgmt wpa-psk
nmcli con modify Hostspot wifi-sec.psk "veryveryhardpassword1234"
@kunaltyagi
kunaltyagi / yaml_compare.cpp
Last active November 10, 2023 16:15
Compare function for 2 nodes
template <class ...Args>
bool scalar_compare(YAML::Node&, YAML::Node&);
template<class T, class ...Args>
bool helper_compare(YAML::Node& node1, YAML::Node& node2)
{
try
{
return node1.as<T>() == node2.as<T>();
}
catch(YAML::TypedBadConversion<T>& e)
@rmtsrc
rmtsrc / u2f-ssh.md
Created February 20, 2016 13:38
Enabling SSH U2F authentication

SSH authentication via U2F

Enabling SSH U2F authentication.

After some research online I've found a patch to the OpenSSH server that enables U2F authentication.

However there are 2 major caveats that would stop me from using this in a production environment:

  • Security - the patch for OpenSSH has not yet been accepted/merged and currently works on an older version of OpenSSH
  • Currently doesn't work on Mac OS, though maybe possible once Homebrew/legacy-homebrew#43676 is resolved
@arjunvenkat
arjunvenkat / gist:1115bc41bf395a162084
Last active January 12, 2024 05:04
Seeding a Rails database with a CSV file

How to seed a Rails database with a CSV file

1. Setup

First, Create a folder inside of lib called seeds

Put your CSV file example.csv into the lib/seeds folder. In the example below, the file is called real_estate_transactions.csv

Make sure you've created a resource with the appropriate columns to match your seed data. The names don't have to match up.

@gitaarik
gitaarik / git_submodules.md
Last active May 10, 2024 05:09
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:

  • Separate big codebases into multiple repositories.
@DanGe42
DanGe42 / context_demo.c
Created October 25, 2013 03:14
A non-trivial example of how to use user contexts for trivial scheduling.
#include <ucontext.h>
#include <sys/types.h>
#include <sys/time.h>
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <poll.h>
/* ucontext sample program