Skip to content

Instantly share code, notes, and snippets.

View plopp's full-sized avatar

Marcus Kempe plopp

View GitHub Profile
resource "azurerm_app_service" "my_app_service_container" {
name = "my_app_service_container"
location = "France central"
resource_group_name = "MYRG"
app_service_plan_id = azurerm_app_service_plan.my_service_plan.id
https_only = true
client_affinity_enabled = true
site_config {
scm_type = "VSTSRM"
always_on = "true"
@plopp
plopp / adax.py
Last active July 31, 2023 15:20
Improved ADAX example
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# install dependencies with: pip install requests sanction
import requests
import sanction
CLIENT_ID = "112395"
@plopp
plopp / tmux.conf
Created January 9, 2021 22:03 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@plopp
plopp / 3018-PROver parameters
Last active November 12, 2020 23:55
Machine specific settings/parameters for my 3018-PROver
$1=25
$2=0
$3=2
$4=0
$5=0
$6=0
$10=1
$11=0.010
$12=0.002
$13=0
@plopp
plopp / wifi-on-ubuntu-server-18.md
Created April 7, 2019 20:18 — forked from austinjp/wifi-on-ubuntu-server-18.md
Enabling wifi on Ubuntu server 18

Wifi on Ubuntu 18 server

TLDR

  1. Install wpasupplicant
  2. Turn on wifi radios: sudo nmcli radio wifi on
  3. Check your devices are recognised even if they're not "managed": sudo iwconfig
  4. Check your wifi (here called "wlp3s0") is capable of detecting nearby routers: sudo iwlist wlp3s0 scan
  5. Configure netplan by dropping a file called 01-netcfg.yml into /etc/netplan/ or edit existing file there. See example below.
  6. netplan try, netplan generate, netplan apply.
RED='\033[1;31m'
GREEN='\033[1;32m'
CYAN='\033[1;36m'
WHITE='\033[1;37m'
NC='\033[0m' # No Color
DIR="$HOME/db/rethinkdb"
echo ""
echo "${CYAN}Preparing for creation of a RethinkDB container...${NC}"
@plopp
plopp / effective_modern_cmake.md
Created March 15, 2018 14:25 — forked from mbinna/effective_modern_cmake.md
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

function(head, req) {
var tags = [
'GVL.abbExportedReactive',
'GVL.abbImportedReactive',
'GVL.abbPhaseAngleTotal',
'GVL.abbPowerFactorL1',
'GVL.abbPowerFactorL2',
'GVL.abbPowerFactorL3',
'GVL.abbPowerFactorTotal',
'GVL.avluftfasad281',
@plopp
plopp / yanzi_api_example.js
Last active October 9, 2017 16:20
Example client for the Yanzi Cirrus API
const WebSocket = require('ws');
const http = require('http');
function assertDefinedEnv(varname) {
if (!(varname in process.env))
throw "Error: Missing required env var " + varname;
}
assertDefinedEnv("SHREK_URL");
assertDefinedEnv("PLUG_ENERGY_DID");
@plopp
plopp / loose_perfect_sum.js
Last active October 5, 2017 23:09
Loose perfect sum algorithm for detecting electric loads that are probably running given a power sum and known power consumptions of appliances.
//Based on work from: http://www.geeksforgeeks.org/perfect-sum-problem-print-subsets-given-sum/
let c = 0.2; //Looseness in percent of current power consumtion
let s = 600; //Current power consumtion
let dp; //Solution tree
let appliances = ["Lights", "Fridge/Freezer standby", "Tap water standby", "Tap water heating on", "Pipe anti-freeze", "Fridge/Freezer on", "Modem/Electronics/etc"];
let always_on = [false, false, false, false, false, true, false];