Instantly share code, notes, and snippets.

View Smart Opener.lua
@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
View docker-compose.yml
version: '3.4'
services:
stellar-core-postgres:
image: postgres:9-alpine
container_name: stellar-postgres
ports:
- 5432:5432
environment:
- POSTGRES_DB=stellar-core
View relocate_docker_to_data_disk.sh
#!/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
View stellar-node_docker-compose.yml
version: '3.4'
services:
stellar-core-postgres:
image: postgres:9-alpine
container_name: stellar-postgres
ports:
- 5432:5432
environment:
- POSTGRES_DB=stellar-core
View check_existing_postgresdb.yml
# 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
View docker-compose.yml
version: "3"
services:
grafana:
image: grafana/grafana:5.2.1
ports:
- "3000:3000"
environment:
- HTTP_USER=admin
- HTTP_PASS=admin
View parity-docker-compose.yml
version: '3.1'
volumes:
parity:
services:
parity:
image: parity/parity:stable
container_name: parity
volumes:
View basic_ec2_w_docker.tf
#############################
# ec2 instance
#############################
resource "aws_instance" "nt-test-ec2" {
count = 1
ami = "${lookup(var.ami, var.region)}"
instance_type = "t2.medium"
key_name = "${var.key_pair_name}"
#ebs_optimized = true
View bip-0039_chatter.py
import mechanize
import requests
import random
from random import randrange
scammers_url = 'https://baddies.online.notarealtld/'
word_list_url = 'https://raw.githubusercontent.com/bitcoin/bips/master/bip-0039/english.txt'
useragents = ['Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0']
runs = 1