Skip to content

Instantly share code, notes, and snippets.

View gravcat's full-sized avatar

poppoppop gravcat

View GitHub Profile
@gravcat
gravcat / [email protected]
Last active January 10, 2019 16:22
create a docker-based openvpn server, accepting a list of users to create configs and certs for
[Unit]
Description=OpenVPN connection to %i
PartOf=openvpn.service
ReloadPropagatedFrom=openvpn.service
Before=systemd-user-sessions.service
After=network-online.target
Wants=network-online.target
Documentation=man:openvpn(8)
Documentation=https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage
Documentation=https://community.openvpn.net/openvpn/wiki/HOWTO
#!/bin/sh
# add universe and multiverse, for desktop packages and guest additions respectively
sudo sed '1 s/.*/& universe multiverse/' /etc/apt/sources.list
sudo apt update -y
sudo apt install guest-additions-dkms -y
@gravcat
gravcat / filebeat.yml
Created October 3, 2018 18:16
filebeat config file example
#Global options
filebeat.shutdown_timeout: 3s
##Logging
logging.level: error
logging.to_files: true
logging.files:
path: /var/log/filebeat
name: filebeat
keepfiles: 7
@name Smart Opener
@inputs
@outputs Door
@persist P:array Distance:array A:array Target:entity D Z
@trigger
runOnChat(1)
interval(300)
#Distance
D = 120
@gravcat
gravcat / docker-compose.yml
Created September 4, 2018 16:41
capture potential relevant config stuff for stellar core
version: '3.4'
services:
stellar-core-postgres:
image: postgres:9-alpine
container_name: stellar-postgres
ports:
- 5432:5432
environment:
- POSTGRES_DB=stellar-core
@gravcat
gravcat / relocate_docker_to_data_disk.sh
Last active August 29, 2018 21:10
example of how to pick up and relocate docker to a new disk, data intact
#!/bin/bash
export DATA_DISK_DEVICE=/dev/nvme1n1
export DATA_DISK_MOUNT=/data
sudo mkfs.ext4 $DATA_DISK_DEVICE
echo "$DATA_DISK_DEVICE $DATA_DISK_MOUNT ext4 defaults 0 0" | sudo tee -a /etc/fstab && sudo mount -a
sudo systemctl stop docker
sudo mv /var/lib/docker $DATA_DISK_MOUNT/docker
sudo ln -s $DATA_DISK_MOUNT/docker /var/lib/docker
@gravcat
gravcat / stellar-node_docker-compose.yml
Created August 25, 2018 20:08
i think this would be consider a watcher node until I have history GET options as well?
version: '3.4'
services:
stellar-core-postgres:
image: postgres:9-alpine
container_name: stellar-postgres
ports:
- 5432:5432
environment:
- POSTGRES_DB=stellar-core
@gravcat
gravcat / regex-match-curly-braces
Created August 17, 2018 18:01
a simple regex to match curly braces and the stuff inside of them
\{(.+)\}
@gravcat
gravcat / check_existing_postgresdb.yml
Last active August 13, 2018 22:00
check for an existing postgres database in a data directory, and do not initdb if found
# assumes you have postgres_data_directory, postgres_user, and postgres_bin_directory set
- name: Check for existing database
become: yes
become_user: postgres
stat:
path: "{{ postgres_data_directory }}/PG_VERSION"
register: pgdata_directory_version
- name: Initialize PostgreSQL DB
become: yes
@gravcat
gravcat / docker-compose.yml
Created July 22, 2018 06:21
grafana really fast
version: "3"
services:
grafana:
image: grafana/grafana:5.2.1
ports:
- "3000:3000"
environment:
- HTTP_USER=admin
- HTTP_PASS=admin