Skip to content

Instantly share code, notes, and snippets.

@andrewwebber
andrewwebber / default.yaml
Last active May 23, 2019 16:26
CoreOS + Matchbox + KubeAdm = <3
systemd:
units:
- name: installer.service
enable: true
contents: |
[Unit]
Requires=network-online.target
After=network-online.target
[Service]
Type=simple
@Niksko
Niksko / main.tf
Created April 25, 2018 11:56
Terraform config for my home Kubernetes server
module "bare-metal-skouf-home" {
source = "git::https://github.com/Niksko/typhoon//bare-metal/container-linux/kubernetes?ref=ca8feb773b2000a68b567e67d29a7c5fb5a672df"
providers = {
local = "local.default"
null = "null.default"
template = "template.default"
tls = "tls.default"
}
@wildoctopus
wildoctopus / CORS Filter
Created April 16, 2018 05:30
How to fix the CORS issue on backend side , java Springboot App (Handling Simple CORS requests)
//Contents from https://spring.io/understanding/CORS
In the simplest scenario, cross-origin communications starts with a client making a GET, POST, or HEAD request against a resource on the server.
In this scenario, the content type of a POST request is limited to application/x-www-form-urlencoded, multipart/form-data, or text/plain. The request includes an Origin header that indicates the origin of the client code.
The server will consider the request's Origin and either allow or disallow the request. If the server allows the request, then it will respond with the requested resource and an Access-Control-Allow-Origin header in the response. This header will indicate to the client which client origins will be allowed to access the resource. Assuming that the Access-Control-Allow-Origin header matches the request's Origin, the browser will allow the request.
On the other hand, if Access-Control-Allow-Origin is missing in the response or if it doesn't match the request's Origin, the browser will disallow th
@tomask-de
tomask-de / place-zip-state.sql
Created April 10, 2018 16:09
opengeodb select place, zip/postal code, federal state
SELECT
t1.loc_id, t1.text_val AS Ort, t2.text_val AS PLZ, t5.text_val AS Bundesland
FROM geodb_textdata t1, geodb_textdata t2, geodb_textdata t3, geodb_textdata t4, geodb_textdata t5
WHERE t2.text_val = '08060'
AND t1.loc_id = t2.loc_id
AND t2.text_type = '500300000' /* PLZ */
AND t3.loc_id = t1.loc_id
AND t3.text_type = '500600000' /* Amtlicher Gemeindeschlüsssel */
AND t4.text_type = '500600000'
AND t4.text_val = SUBSTR(t3.text_val,1,2)
@rms1000watt
rms1000watt / golang-docker-build.sh
Last active November 13, 2025 00:46
Go Build command with netgo
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -tags netgo -installsuffix netgo -o bin/linux-golang-server
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -tags netgo -installsuffix netgo -ldflags '-w -extldflags "-static"' -o bin/linux-golang-server
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -tags netgo -installsuffix netgo -ldflags '-w -extldflags=-static' -o bin/linux-golang-server
@tomask-de
tomask-de / java-ts-to-date-from-oracle-number.sql
Last active April 21, 2016 10:55
Convert a Java timestamp (long value) saved in an Oracle database as NUMBER(16) into a readable string
-- 2177452800000000 = diff from 01.01.1970 00:00:00.000000 to 01.01.1901 00:00:00.000000
select timestamp '1970-01-01 00:00:00' + numtodsinterval((STAMP - 2177452800000000)/1000/1000,'SECOND') from DUAL;
#!/bin/sh
if [ "$#" -ne 1 ]; then
echo "Usage: $0 your-service-prefix" >&2
exit 1
fi
fleetctl list-units | grep $1@ | cut -f1 -d. | while read -r unit ; do
unit_index=`echo $unit | cut -f2 -d@`
@KonradIT
KonradIT / readme.md
Last active December 4, 2025 22:25
GoPro Studio for Linux