go build -o goencrypt main.go
Services declared as oneshot
are expected to take some action and exit immediatelly (thus, they are not really services,
no running processes remain). A common pattern for these type of service is to be defined by a setup and a teardown action.
Let's create a example foo
service that when started creates a file, and when stopped it deletes it.
Create executable file /opt/foo/setup-foo.sh
:
{ | |
"sort": ["_doc"], | |
"size": 100, | |
"query": { | |
"bool": { | |
"must": { | |
"match_all": {} | |
}, | |
"filter": { | |
... |
# | |
# Run `make ENVIRONMENT=machinename` to override the default | |
# | |
ENVIRONMENT=default | |
TLS_VERIFY=$(shell docker-machine env $(ENVIRONMENT) | grep 'DOCKER_TLS_VERIFY=".*"' | cut -d\" -f2) | |
HOST=$(shell docker-machine env $(ENVIRONMENT) | grep 'DOCKER_HOST=".*"' | cut -d\" -f2) | |
CERT_PATH=$(shell docker-machine env $(ENVIRONMENT) | grep 'DOCKER_CERT_PATH=".*"' | cut -d\" -f2) | |
MACHINE_NAME=$(shell docker-machine env $(ENVIRONMENT) | grep 'DOCKER_MACHINE_NAME=".*"' | cut -d\" -f2) | |
export DOCKER_MACHINE_NAME=$(MACHINE_NAME) |
### | |
### | |
### UPDATE: For Win 11, I recommend using this tool in place of this script: | |
### https://christitus.com/windows-tool/ | |
### https://github.com/ChrisTitusTech/winutil | |
### https://www.youtube.com/watch?v=6UQZ5oQg8XA | |
### iwr -useb https://christitus.com/win | iex | |
### | |
### OR take a look at | |
### https://github.com/HotCakeX/Harden-Windows-Security |
{ | |
"address": "<public ip address>", | |
"ca": "<ca-cert-path>", | |
"ca-key": "<ca-key-path>", | |
"tls-cert": "<tls-cert-path>", | |
"tls-key": "<tls-key-path>", | |
"responder": "<oscp-cert-path>", | |
"responder-key": "<oscp-key-path>", | |
"db-config": "/cfssl-config/db-config.json", | |
"signing": { |
#!/usr/bin/env bash | |
# set -x | |
if [[ $EUID -ne 0 ]]; then | |
echo "You must be root to run this script" | |
exit 1 | |
fi | |
# Returns all available interfaces, except "lo" and "veth*". |
#!/bin/bash | |
# Anh Nguyen <[email protected]> | |
# 2016-04-30 | |
# MIT License | |
# This script takes in same-size images from a folder and make a crossfade video from the images using ffmpeg. | |
# Make sure you have ffmpeg installed before running. | |
# The output command looks something like the below, but for as many images as you have in the folder. |
# runcommand.py | |
# Handy function that executes an external command in the shell | |
# and returns 3 values: exit code of the command, its standard output | |
# and its error output. | |
# If you run the script directly, an example is provided: | |
# first it will run a successful command and then one with errors | |
# (you may want to modify them if not running a Unix system). | |
import subprocess |
cloud-init
is absolute cancer. Its code is horrible. It has no documentation at all.
It took me 5 fucking hours to figure out how to properly configure networking on recent
cloud-init
(Ubuntu 16.04 cloud image
) with local datasource.
It's not mentioned anywhere you need to provide dsmode: local
. (but only if you need network-config,
besides that everything is fine; someone below noted that -m
flag does the same thing, good to know) Of course nobody needs documentation for network-config
format
either. (cloudinit/net/__init__.py
is a protip, enjoy the feces dive)
Oh, and by the way - no, it's not possible to provide network-config
to uvt-kvm
without patching shit.