This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias gta='f() { git tag -m "" -a $1; git push origin $1 };f' | |
alias gbump='f() {gaa; gcam "bump to $1"; ggp; git tag -m "" -a $1; git push origin $1 };f' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
empty="" | |
image=${1//\.tar/$empty} | |
echo $image | |
docker load --input $image.tar | |
docker tag $image localhost:5000/$image | |
docker push localhost:5000/$image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const net = require('net'); | |
const repl = require('repl').start('> '); | |
const sockets = repl.context.sockets = []; | |
const loggerFor = socket => msg => { | |
const idx = sockets.indexOf(socket); | |
const name = socket.remoteAddress; | |
const [time] = new Date().toISOString().replace('T', ' ').split('.'); | |
console.log(`[${idx + 1}/${sockets.length}] ${time} ${name} - ${msg}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const v1 = `https://${process.env.RIC_HOST}/api/v1`; | |
const login = process.env.RIC_USER; | |
const password = process.env.RIC_PASS; | |
async function getToken() { | |
const resp = await fetch(`${v1}/auth/token`, { | |
method: 'post', | |
headers: { 'Content-Type': 'application/json' }, | |
body: JSON.stringify({ login, password }) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mqtt = require('mqtt').connect('mqtt://sandbox.rightech.io', { | |
clientId: 'mqtt-prohazko-fFJlHqZwnH7wYTihXOlH0', | |
//key: require('fs').readFileSync('./key.pem').toString(), | |
//cert: require('fs').readFileSync('./crt.pem').toString(), | |
}); | |
const si = require('systeminformation'); | |
const nanoid = require('nanoid'); | |
const { Server } = require('ws'); | |
const ports = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: monitoring | |
namespace: kube-system | |
secrets: | |
- name: monitoring-secret-token | |
--- | |
apiVersion: v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# > sudo apt install libmosquitto-dev | |
# > make | |
# > ./mqtt | |
mqtt: mqtt.o | |
$(CC) $(LDFLAGS) mqtt.o -o mqtt -lmosquitto | |
mqtt.o: mqtt.c | |
$(CC) $(CFLAGS) -c mqtt.c -lmosquitto | |
clean: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include $(TOPDIR)/rules.mk | |
# Name, version and release number | |
# The name and version of your package are used to define the variable to point to the build directory of your package: $(PKG_BUILD_DIR) | |
PKG_NAME:=helloworld | |
PKG_VERSION:=1.0 | |
PKG_RELEASE:=1 | |
# Source settings (i.e. where to find the source codes) | |
# This is a custom variable, used below |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const cert = ` | |
-----BEGIN CERTIFICATE----- | |
-----END CERTIFICATE----- | |
`; | |
const key = ` | |
-----BEGIN RSA PRIVATE KEY----- | |
-----END RSA PRIVATE KEY----- | |
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from: https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino | |
/* | |
HTTP over TLS (HTTPS) example sketch | |
This example demonstrates how to use | |
WiFiClientSecure class to access HTTPS API. | |
We fetch and display the status of | |
esp8266/Arduino project continuous integration | |
build. |
OlderNewer