Skip to content

Instantly share code, notes, and snippets.

@muka
muka / renew.md
Last active Jan 25, 2017
letsencript renew
View renew.md
@muka
muka / dhcpd.conf
Last active Nov 21, 2019
Setup a dhcpd server using docker
View dhcpd.conf
ddns-update-style none;
option domain-name "thpi";
option domain-name-servers 208.67.222.222, 208.67.220.220;
default-lease-time 86400;
max-lease-time 604800;
authoritative;
@muka
muka / Utils.java
Last active Apr 12, 2017
Load a properties file from resources package
View Utils.java
/*
* Copyright 2017 FBK/CREATE-NET
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View hex_split.js
var s = "886953285be646dee459532b743aeb3c"
var out = []
for(var i=0; i<s.length; i++){
var i1 = s[i]
i++
var i2 = s[i]
out.push(`0x${i1}${i2}`)
}
console.log("{ %s }", out.join(", "))
View extract coop tn.js
var items = []
var read = ()=> {
var clr = (s) => s.replace("\n", "").trim()
jQuery('.media-body').each((i, el) => {
var item = jQuery(el)
//console.log(item)
View parse json coop tn.js
var items = []
var read = ()=> {
var clr = (s) => s.replace("\n", "").trim()
jQuery('.media-body').each((i, el) => {
var item = jQuery(el)
var url = clr(item.find('h4 a').attr('href').trim())
View example.md

Notice: as per node-red contrib guideline, the module has been renamed node-red-contrib-openfaas

Setup

  • Start OpenFaaS
  • Install node-red-admin sudo npm i -g node-red-admin
  • Start node-red docker run -it --rm -p 1880:1880 -v `pwd`:/shared --network host --name mynodered nodered/node-red-docker
  • Install openfaas module node-red-admin install node-red-contrib-openfaas
  • Done go to http://127.0.0.1:1880
@muka
muka / install-protoc.sh
Last active Mar 20, 2018
How to install protoc to use with grpc
View install-protoc.sh
#Get a release here https://github.com/google/protobuf/releases
sudo -s
cd /usr/local/include
mkdir google
wget https://github.com/google/protobuf/releases/download/v3.5.0/protoc-3.5.0-linux-x86_64.zip -O protoc.zip
unzip protoc.zip -d tmp