This file contains hidden or 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
--- | |
kind: ConfigMap | |
apiVersion: v1 | |
metadata: | |
name: example-configmap | |
data: | |
# Configuration values can be set as key-value properties | |
# use '|' bar to add new line to each line, otherwise its missed out | |
database: | | |
mongodb |
This file contains hidden or 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
#picked these up somewhere a long time back | |
# Tmux settings | |
# Enable mouse mode (tmux 2.1 and above) | |
set -g mouse on | |
# Enable mouse control (clickable windows, panes, resizable panes) | |
set -g mouse-select-window on | |
set -g mouse-select-pane on | |
set -g mouse-resize-pane on |
This file contains hidden or 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
DROP FUNCTION IF EXISTS deg_to_nesw; | |
DELIMITER // | |
CREATE FUNCTION deg_to_nesw(deg float) RETURNS char(3) DETERMINISTIC | |
-- based on: https://www.campbellsci.eu/blog/convert-wind-directions | |
BEGIN | |
SET @directions = 'N,NNE,NE,ENE,E,ESE,SE,SSE,S,SSW,SW,WSW,W,WNW,NW,NNW,N'; | |
RETURN substring_index(substring_index(@directions,',',Round((deg MOD 360)/ 22.5,0)+1),',', -1); | |
END | |
// |
This file contains hidden or 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
--- | |
version: "2.4" | |
services: | |
test_localnet_ip: | |
image: alpine:latest | |
container_name: test_localnet_ip | |
command: tail -F anything |
This file contains hidden or 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 | |
# | |
# /etc/rc.d/init.d/syncthing | |
# | |
# Starts the syncthing daemon on TerraMaster NAS | |
# | |
# chkconfig: 345 80 20 | |
# description: the syncthing daemon | |
# processname: syncthing | |
# config: /etc/syncthing.conf |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
) | |
var FlagsToNames = map[int]string{ | |
0x0: "read", | |
0x1: "write", | |
0x2: "deny", |
This file contains hidden or 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
# EDIT - 01 Dec 2023 - Works without the below in Ubuntnu 22.04 | |
$ lsusb | |
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub | |
Bus 001 Device 040: ID 0a5c:21e8 Broadcom Corp. BCM20702A0 Bluetooth 4.0 | |
Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. Hub | |
Bus 001 Device 044: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode) | |
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub | |
# get the pre-compiled driver |
This file contains hidden or 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
"go.useLanguageServer": true, | |
// gometalinter is not allowed but works? | |
"go.lintTool": "gometalinter", | |
"go.lintFlags": [ | |
"--disable-all", | |
"--enable=golint", | |
"--exclude=exported (const|type|method|function) [\\w.]+ should have comment (\\(or a comment on this block\\) )?or be unexported", | |
"--exclude=don't use ALL_CAPS in Go names; use CamelCase", | |
"--exclude=(func|const|struct field|) \\w+ should be \\w+" | |
] |
This file contains hidden or 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
/* | |
* Based in part on https://lastminuteengineers.com/bme280-esp8266-weather-station/ | |
* | |
* massively tweaked by me :) | |
*/ | |
/* | |
* BME280 Room Sensors | |
* | |
* 00F50507 - room1 |
This file contains hidden or 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 | |
ES="192.168.0.2:9200" | |
INDEX="stats-000001" | |
curl -s -XGET "http://$ES/$INDEX/_mapping " |\ | |
jq -r --arg INDEX "$INDEX" '.[$INDEX].mappings.properties | | |
[leaf_paths as $path | | |
{"key": $path | join("."), "value": getpath($path)}] | |