This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Unit] | |
| Description=My application %I | |
| After=network.target | |
| [Service] | |
| User=ubuntu | |
| WorkingDirectory=/home/root/projects/project | |
| Environment=PORT=5010 | |
| ExecStart=/path/to/executable arg1 arg2 | |
| Restart=always |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # flock acquires a lock prior to running. | |
| # timeout will kill the command if it's still funning at the end of the duration. | |
| * * * * * flock -n /var/lock/my-task.lock timeout 45 my-task-command | |
| # Suppress output of command so that other crons keeping going | |
| * * * * * my-task-command > /dev/null 2>&1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Allows me to turn any LIFX lights in my home on and off and have the | |
| remaining lights follow suit. | |
| Requires python 3.6 or higher. | |
| To run: | |
| $ virtualenv -p python3 env |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| PREFIX=$1 | |
| COMMAND=$2 | |
| OUTPUT=$(eval "$COMMAND" 2>&1) | |
| logger -i -t "$PREFIX" -- "$OUTPUT" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This adds all non-whitespace characters to the index. | |
| # | |
| # Consider this a template into which other arguments can be added. For | |
| # example, `git diff` can take filename args to limit its effects. | |
| git diff -U0 -w --no-color | git apply --cached --ignore-whitespace --unidiff-zero - |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ############################################################################# | |
| # Configuration file for Let's Encrypt ACME Challenge location | |
| # This file is already included in listen_xxx.conf files. | |
| # Do NOT include it separately! | |
| ############################################################################# | |
| # | |
| # This config enables to access /.well-known/acme-challenge/xxxxxxxxxxx | |
| # on all our sites (HTTP), including all subdomains. | |
| # This is required by ACME Challenge (webroot authentication). | |
| # You can check that this location is working by placing ping.txt here: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import base64 | |
| from Crypto.PublicKey import RSA | |
| from flask import Flask, request | |
| from flask.json import jsonify | |
| import json | |
| from OpenSSL import crypto | |
| import os | |
| app = Flask(__name__) |