Skip to content

Instantly share code, notes, and snippets.

View netfirms's full-sized avatar
💭
Versace on the floor

Taweechai Maklay netfirms

💭
Versace on the floor
View GitHub Profile
@netfirms
netfirms / docker-compose-backup.sh
Created August 25, 2022 12:11 — forked from pirate/docker-compose-backup.sh
Backup a docker-compose project, including all images, named and unnamed volumes, container filesystems, config, logs, and databases.
#!/usr/bin/env bash
### Bash Environment Setup
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
# https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
# set -o xtrace
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
# copy from here https://gitlab.com/oz123/grafana-python-datasource/-/blob/master/data-source.py
# https://blog.jonathanmccall.com/2018/10/09/creating-a-grafana-datasource-using-flask-and-the-simplejson-plugin/
import math
from datetime import datetime
from calendar import timegm
from bottle import (Bottle, HTTPResponse, run, request, response,
json_dumps as dumps)
@netfirms
netfirms / go
Created September 24, 2020 08:34 — forked from flosell/go
Template `./go` script as a main entrypoint into the development environment (http://www.thoughtworks.com/insights/blog/praise-go-script-part-i)
#!/bin/bash
set -e
SCRIPT_DIR=$(cd $(dirname $0) ; pwd -P)
goal_doStuff() {
echo "doing stuff"
}
goal_doOtherStuff() {
@netfirms
netfirms / go
Created September 24, 2020 08:34 — forked from flosell/go
Template `./go` script as a main entrypoint into the development environment (http://www.thoughtworks.com/insights/blog/praise-go-script-part-i)
#!/bin/bash
set -e
SCRIPT_DIR=$(cd $(dirname $0) ; pwd -P)
goal_doStuff() {
echo "doing stuff"
}
goal_doOtherStuff() {
@netfirms
netfirms / docker-compose.yml
Last active September 7, 2020 04:28 — forked from dkirrane/docker-compose.yml
GoCD docker-compose.yml
# https://hub.docker.com/r/gocd/gocd-server/
server:
image: gocd/gocd-server:v20.7.0
hostname: go-server # Needed so the go-agent can find the server
ports:
- '8153:8153'
- '8154:8154'
environment:
- GO_SERVER_SYSTEM_PROPERTIES='-Dgo.plugin.upload.enabled=true'
# https://hub.docker.com/r/gocd/gocd-agent-alpine-3.5/
@netfirms
netfirms / setup.md
Created May 2, 2019 02:58 — forked from developius/README.md
Set up GitHub push with SSH keys

Create a repo. Make sure there is at least one file in it (even just the README) Generate ssh key:

ssh-keygen -t rsa -C "your_email@example.com"

Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys in your GitHub account settings. Test SSH key:

ssh -T git@github.com
@netfirms
netfirms / nexus-uploader.py
Created July 18, 2018 08:46 — forked from omnisis/nexus-uploader.py
Uploads a local M2 repo to a remote Nexus Server
#!/usr/bin/env python
""""
nexus-uploader.py
Allows mirroring local M2 repositories to a remote Nexus server with a single command.
Supports:
- uploading of common classifiers (sources, javadocs) if available
- using regex include pattern for artifactIds/groupIds
- recursively processing local repo, just point to the root
@netfirms
netfirms / brain.py
Last active August 29, 2015 14:27 — forked from zatarra/brain.py
Python script to parse data from Mindflex headband and convert it into a powerfull EEG device
#!/usr/bin/python
import serial
import sys
latestByte = ('c')
lastByte = ('c')
inPacket = False
myPacket = []
PLENGTH = 0