Skip to content

Instantly share code, notes, and snippets.

View kmsheng's full-sized avatar
🏠
Working from home

kmsheng kmsheng

🏠
Working from home
View GitHub Profile
@kmsheng
kmsheng / hard-coded-interfaces
Last active April 17, 2018 05:52
Hard coded password to /etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback
# Wi-Fi
auto wlp3s0
iface wlp3s0 inet dhcp
wpa-ssid your-ssid
wpa-psk your-password
@kmsheng
kmsheng / interfaces
Created April 18, 2018 09:12
Ethernet interface example
# The loopback network interface
auto lo
iface lo inet loopback
auto enp4s0
allow-hotplug enp4s0
iface enp4s0 inet dhcp
function getPointAlongALine(p0, p1, t) {
return Math.round(((1 - t) * p0 + (t * p1)) * 10) / 10;
}
function reduce(points, t) {
if (points.length === 1) {
return points;
}
@kmsheng
kmsheng / sanji-vrrp-ui.yaml
Created June 1, 2018 00:53
An example of using swagger yaml for VRRP bundle API
swagger: '2.0'
info:
title: VRRP API
description: Provides the VRRP configuration interface
version: 0.1.0
schemes:
- http
- https
produces:
- application/json
swagger: '2.0'
basePath: "/api/v1"
info:
title: VRRP API
description: Provides the VRRP configuration interface
version: 0.1.0
schemes:
- http
- https
produces:
@kmsheng
kmsheng / UC-8112-ME-T-node-red-installation-notes
Last active June 12, 2018 02:13
UC-8112-ME-T node-red installation
sudo su
apt-get update
apt-get install wget
npm install -g --unsafe-perm node-red
# clear Bash's cache of paths to executables
hash -r
@kmsheng
kmsheng / README-Template.md
Created July 6, 2018 05:33 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@kmsheng
kmsheng / Makefile
Created August 15, 2018 07:02
recursively expanded
A = $(B)
B = "B"
all:;@echo $(A)
@kmsheng
kmsheng / Makefile
Created August 15, 2018 07:03
simply expanded
A := "A"
B := $(A)
all:;@echo $(B)
@kmsheng
kmsheng / Makefile
Created August 15, 2018 07:04
Set if not present
A :=
A ?= "A"
all:;@echo $(A)