Skip to content

Instantly share code, notes, and snippets.

@mrlnc
mrlnc / free5gc_wireguard.md
Created February 8, 2021 12:45
Wireguard on Linux 5.0.0-23-generic (for Free5GC)

So you're using free5gc (hence stuck on linux 5.0.0-23-generic) and want to use wireguard VPN.

tl;dr you need wireguard-linux-compat tag v1.0.20200520

git clone https://git.zx2c4.com/wireguard-linux-compat
cd wireguard-linux-compat
git checkout v1.0.20200520
cd ..
make -C wireguard-linux-compat/src -j$(nproc)
make -C wireguard-linux-compat/src -j$(nproc) install
@jen20
jen20 / install-jetbrains-toolbox.sh
Created September 16, 2019 16:37
Script for installing JetBrains Toolbox on Linux
#!/bin/bash
[ $(id -u) != "0" ] && exec sudo "$0" "$@"
echo -e " \e[94mInstalling Jetbrains Toolbox\e[39m"
echo ""
function getLatestUrl() {
USER_AGENT=('User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36')
URL=$(curl 'https://data.services.jetbrains.com//products/releases?code=TBA&latest=true&type=release' -H 'Origin: https://www.jetbrains.com' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: en-US,en;q=0.8' -H "${USER_AGENT[@]}" -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Referer: https://www.jetbrains.com/toolbox/download/' -H 'Connection: keep-alive' -H 'DNT: 1' --compressed | grep -Po '"linux":.*?[^\\]",' | awk -F ':' '{print $3,":"$4}'| sed 's/[", ]//g')
@agutenkunst
agutenkunst / 00sourcetrail_ros_instructions.md
Last active September 5, 2022 07:48
Use Sourcetrail with ROS

Use Sourcetrail with ROS

1. Build your workspace with the required cmake flag

Building your workspace with -DCMAKE_EXPORT_COMPILE_COMMANDS=ON which will create a file compile_commands.json in your build/<pkg> directory containing all compiler calls.

colcon build --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

2. Add the project to sourcetrail

See images below

@svenevs
svenevs / gravizo.md
Last active October 26, 2022 23:06
Having trouble using Gravizo? Cheat the system

What is Gravizo?

Gravizo is a really cool tool to display graphs in your README.

What is the Problem?

Lately, none of their examples seem to be working for me. I don't like using the indirect method, because it means that if the indirect breaks or is no longer public or whatever, who

@ggerganov
ggerganov / iss-docking.js
Created May 16, 2020 12:30
Automatic ISS Docking in Javascript
// Auto-pilot for docking with the International Space Station
//
// The program uses Artificial Intelligence and Decision Trees (i.e. basic kinematics and a bunch of if statements)
// to perform docking with the ISS from any starting position.
//
// To use it:
// - open the SpaceX simulation website: https://iss-sim.spacex.com/
// - open the Developer's console and paste the contents of this file
//
// Demo: https://youtu.be/jWQQH2_UGLw
@albrow
albrow / confirm.go
Last active April 16, 2023 03:03
Go (golang): How to ask for user confirmation via command line
import (
"fmt"
"log"
"os"
"sort"
)
// askForConfirmation uses Scanln to parse user input. A user must type in "yes" or "no" and
// then press enter. It has fuzzy matching, so "y", "Y", "yes", "YES", and "Yes" all count as
// confirmations. If the input is not recognized, it will ask again. The function does not return

Moved to repo: /quenhus/uBlock-Origin-dev-filter

In order to keep filters up to date, please use this repo.

@pazdera
pazdera / gist:1098119
Created July 21, 2011 20:25
Singleton example in C++
/*
* Example of a singleton design pattern.
* Copyright (C) 2011 Radek Pazdera
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
@dabrahams
dabrahams / constexpr_demo.cpp
Created December 11, 2011 01:29
Fun with C++11 constexpr
#include <iostream>
#include <iomanip>
//
// Utilities
//
// RETURNS() is used to avoid writing boilerplate "->decltype(x) { return x; }" phrases.
//
// USAGE: auto function(<arguments>) RETURNS(<some-expression>);
//
@maxidorius
maxidorius / notes.md
Last active November 16, 2023 00:05
Notes on privacy and data collection of Matrix.org

Notes on privacy and data collection of Matrix.org


This version of the document is no longer canonical. You can find the canonical version hosted at Gitlab and Github.

PART 2 IS OUT, INCLUDING THE DISCLOSURE OF A GLOBAL FEDERATION DATA LEAK, AND THE ANATOMY OF A GDPR DATA REQUEST HANDLED BY MATRIX.ORG. SEE THE REPOS ABOVE.