Add yourself to the docker
group to be able to run containers as non-root (see Post-install steps for Linux).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <csignal> | |
#include <thread> | |
#include <chrono> | |
#include <string_view> | |
#include <fmt/core.h> | |
#include <fmt/color.h> | |
#include <mosquitto.h> | |
#include <openssl/ssl.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <boost/uuid/uuid.hpp> | |
#include <boost/uuid/uuid_generators.hpp> | |
#include <boost/uuid/uuid_io.hpp> | |
/** | |
* This snippet implements basic string conversion support for `boost::uuids::uuid` | |
* in libpqxx. | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename T> | |
struct decay_optional { | |
using type = T; | |
}; | |
template<typename T> | |
struct decay_optional<std::optional<T>> { | |
using type = T; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# See https://tomlankhorst.nl/unresponsive-usb-unbind-bind-linux | |
DEV=${1:-0000:06:00.3} | |
echo $DEV | sudo tee /sys/bus/pci/drivers/xhci_hcd/unbind | |
sleep 1 | |
echo $DEV | sudo tee /sys/bus/pci/drivers/xhci_hcd/bind |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<launch> | |
<node launch-prefix="docker run --rm --name listener -v$HOME:$HOME -u$UID --privileged --net=host -eROS_HOME=$ROS_HOME ros:melodic-ros-base-bionic" name="listener" pkg="roscpp_tutorials" type="listener" output="screen"/> | |
<node launch-prefix="docker run --rm --name talker -v$HOME:$HOME -u$UID --privileged --net=host -eROS_HOME=$ROS_HOME ros:melodic-ros-base-bionic" name="talker" pkg="roscpp_tutorials" type="talker" output="screen"/> | |
</launch> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import re | |
import requests | |
from subprocess import check_output | |
github_origin_re = r"^(git@github\.com:|https:\/\/github.com\/)([\w\-_]+)\/([\w\-_]+)\.git$" | |
try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:443> | |
ServerName service.com | |
# Set CORS headers to allow XHR | |
# Determine if Origin matches the regex | |
SetEnvIf Origin "http(s)?://(www.api-client.com|beta.api-client.com:8000)$" AccessControlAllowOrigin=$0 | |
# Set Access-Control-Allow-Origin if the Origin is allowd | |
Header always set Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin | |
Header always set Access-Control-Allow-Credentials true | |
Header always set Access-Control-Allow-Headers "Origin, Authorization, Accept" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://javadoc.jenkins.io/jenkins/model/Jenkins.html#getItemByFullName-java.lang.String- | |
def organization = Hudson.instance.getItemByFullName('my_organization') | |
if (!organization) throw new Exception("No organization by that name") | |
// https://javadoc.jenkins.io/plugin/cloudbees-folder/com/cloudbees/hudson/plugins/folder/AbstractFolder.html#getItems-- | |
def jobs = organization.getItems() | |
jobs.each { | |
// find the sub-job that's named "master" | |
// https://javadoc.jenkins.io/hudson/model/Item.html#getName-- | |
master = it.items.find { it.getName() == "master" } |
NewerOlder