Skip to content

Instantly share code, notes, and snippets.

@muka
muka / renew.md
Last active January 25, 2017 11:11
letsencript renew
@muka
muka / dhcpd.conf
Last active November 21, 2019 07:25
Setup a dhcpd server using docker
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;
curl test1:test1@localhost:8090/auth/oauth/token -d grant_type=client_credentials
@muka
muka / Utils.java
Last active April 12, 2017 06:29
Load a properties file from resources package
/*
* 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
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(", "))
var items = []
var read = ()=> {
var clr = (s) => s.replace("\n", "").trim()
jQuery('.media-body').each((i, el) => {
var item = jQuery(el)
//console.log(item)
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())
@muka
muka / example.md
Last active November 19, 2017 05:35

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 March 20, 2018 14:04
How to install protoc to use with grpc
#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