Skip to content

Instantly share code, notes, and snippets.

View nmaas87's full-sized avatar

Nico Maas nmaas87

View GitHub Profile
@nmaas87
nmaas87 / README.rst
Created November 3, 2019 19:13 — forked from marianoguerra/README.rst
MQTT Generator Script

MQTT Generator

A simple python 3 script to generate sensor data from a config file and send it to an MQTT broker.

Usage

Download mqttgen.py and config.json files (click on the Raw button at the top right and then save the content), edit config.json to fit your needs, if you are using it to run the Event Fabric sensors dashboard then don't change the topic in config.json unless you want to change it in the dashboard too.

@nmaas87
nmaas87 / update_openwrt_rootfs.sh
Created March 20, 2019 20:18 — forked from il-katta/Dockerfile
script to update katta/openwrt-rootfs docker image
#!/bin/bash
set -xe
curl -sL https://downloads.lede-project.org/snapshots/targets/x86/generic/openwrt-x86-generic-generic-rootfs.tar.gz | docker import - katta/openwrt-rootfs:lede-latest
docker push katta/openwrt-rootfs:lede-latest
curl -sL http://archive.openwrt.org/snapshots/trunk/x86/generic/openwrt-x86-generic-generic-rootfs.tar.gz | docker import - katta/openwrt-rootfs:latest
docker push katta/openwrt-rootfs:latest
curl -sL http://downloads.openwrt.org/releases/18.06.1/targets/x86/generic/openwrt-18.06.1-x86-generic-generic-rootfs.tar.gz | docker import - katta/openwrt-rootfs:18.06.1
docker push katta/openwrt-rootfs:18.06.1
@nmaas87
nmaas87 / gist:2325be3acc0de30c2eccdc5631683dd1
Created February 1, 2017 14:59 — forked from tott/gist:3895832
create cpu load in python
#!/usr/bin/env python
"""
Produces load on all available CPU cores
"""
from multiprocessing import Pool
from multiprocessing import cpu_count
def f(x):
while True:
@nmaas87
nmaas87 / u3_docker_config
Last active February 10, 2017 11:56
Linux/arm 4.10.0-rc5 Kernel Configuration with Fan
# Odroid U3
# Configuration for Docker
# https://www.nico-maas.de/?p=1491
# Automatically generated file; DO NOT EDIT.
# Linux/arm 4.10.0-rc5 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_ARM_HAS_SG_CHAIN=y
CONFIG_MIGHT_HAVE_PCI=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@nmaas87
nmaas87 / pi_mp.py
Last active December 26, 2016 15:20 — forked from amitsaha/pi_mp.py
Parallel Pi Calculation using Python's multiprocessing module
''' listing 6: pi_mp.py
Multiprocessing based code to estimate the value of PI
using monte carlo sampling
Ref: http://math.fullerton.edu/mathews/n2003/montecarlopimod.html
Uses workers:
http://docs.python.org/library/multiprocessing.html#module-multiprocessing.pool
'''
import random
@nmaas87
nmaas87 / apache ssh keys
Created May 17, 2016 21:43 — forked from phedoreanu/apache ssh keys
git PHP webhook
sudo mkdir -m 0700 /var/www/.ssh
sudo chown -R apache:apache /var/www/.ssh
sudo -u apache ssh-keygen (empty passphrase)
paste public key into repo manager
(git-repo) sudo -u apache git pull origin branch (this will create /var/www/.ssh/known_hosts)
call git_hook.php?branch=xxx
### Keybase proof
I hereby claim:
* I am nmaas87 on github.
* I am nicomaas (https://keybase.io/nicomaas) on keybase.
* I have a public key whose fingerprint is 3B27 ADBF 4D13 E7F2 6A47 14A9 BE64 BAF7 84A0 72E8
To claim this, I am signing this object: