Skip to content

Instantly share code, notes, and snippets.

@paddy74
paddy74 / readJsonFile.hpp
Last active April 9, 2021 09:24
Read the values of a JSON file using C++ REST SDK
#pragma once
#include <cpprest/json.h>
/**
* @brief Parse a JSON file into a JSON object.
*
* @param jsonFileName The path to the JSON file to parse.
*/
@chrisswanda
chrisswanda / WireGuard_Setup.txt
Last active October 14, 2024 11:22
Stupid simple setting up WireGuard - Server and multiple peers
Install WireGuard via whatever package manager you use. For me, I use apt.
$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard
MacOS
$ brew install wireguard-tools
Generate key your key pairs. The key pairs are just that, key pairs. They can be
@mdonkers
mdonkers / server.py
Last active November 15, 2024 20:01
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@noromanba
noromanba / apt-daily-timer-disable.md
Created December 25, 2016 17:51
how to disable apt-daily.timer

how to disable apt-daily.timer

$ systemctl stop apt-daily.timer
$ systemctl disable apt-daily.timer
$ systemctl mask apt-daily.service
$ systemctl daemon-reload

check current status

@tmeissner
tmeissner / w1-therm.sh
Last active June 1, 2020 06:09
Bash script to read out the DS18B20 1wire temp sensor. You have to modprobe the w1-gpio and w1-therm modules before using it.
#!/bin/bash
THERM=$(cat $1)
CPU=$(cat /sys/class/thermal/thermal_zone0/temp)