Skip to content

Instantly share code, notes, and snippets.

@devster31
devster31 / systemd instructions.md
Created May 4, 2015 00:17
systemd units for syncthing OSX and unix

Mac OS X

Using homebrew

  1. brew install syncthing
  2. Follow the info to autostart syncthing using launchctl. At the moment this is done using this command: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.syncthing.plist.

Without homebrew

Download syncthing for Mac: https://github.com/syncthing/syncthing/releases/latest.

SUMMARY

query is not returning an empty list.

ISSUE TYPE
  • Bug Report
@devster31
devster31 / tasks.jsonc
Created February 11, 2020 00:43
yamllint Visual Studio Code task
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "yamllint",
"type": "shell",
"command": "/usr/local/bin/yamllint",
"args": [
@devster31
devster31 / transmission-purge-completed.sh
Created August 16, 2017 11:58
Transmission script to clean completed downloads
#!/bin/sh
# the folder to move completed downloads to
# port, username, password
SERVER="9091 --auth transmission:transmission"
# use transmission-remote to get torrent list from transmission-remote list
# use sed to delete first / last line of output, and remove leading spaces
# use cut to get first field from each line
@devster31
devster31 / fluent.conf
Created June 23, 2015 00:41
simple fluentd config for apache and syslog
## built-in TCP input
## $ echo <json> | fluent-cat <tag>
<source>
@type forward
@id forward_input
</source>
## built-in UNIX socket input
#<source>
# @type unix
import requests
from bs4 import BeautifulSoup
css = """
table {
color: #666;
font-family: 'Raleway', sans-serif;
font-size: 16px;
font-weight: 400;
@devster31
devster31 / nginx.conf
Last active July 9, 2021 09:35 — forked from spikegrobstein/nginx.conf
to add plex as a subdomain
upstream plex-upstream {
# change plex-server.example.com:32400 to the hostname:port of your plex server.
# this can be "localhost:32400", for instance, if Plex is running on the same server as nginx.
server plex-server.example.com:32400;
}
server {
listen 80;
# server names for this server.
import glob
import pathlib
from doit.tools import LongRunning
DOIT_CONFIG = {"action_string_formatting": "new"}
def aria_files():
globs = glob.glob("*.aria2.txt") + glob.glob("*.session")
#!/usr/bin/env python3
"""Creates a shift scheduling problem and solves it."""
from absl import app
from absl import flags
from ortools.sat.python import cp_model
from google.protobuf import text_format
FLAGS = flags.FLAGS
@devster31
devster31 / nginx.conf
Last active December 16, 2021 15:40
OS optimizations for ec2 t2.micro - WIP
# https://www.nginx.com/blog/tuning-nginx/
worker_connections 1024;
# Limit the number of connections NGINX allows, for example from a single client
# IP address. Setting them can help prevent individual clients from opening too
# many connections and consuming too many resources.
server {
# When several limit_conn directives are specified, any configured limit will apply.
limit_conn perip 10;
limit_conn perserver 100;