Skip to content

Instantly share code, notes, and snippets.

View danpicton's full-sized avatar

Dan Picton danpicton

View GitHub Profile
@danpicton
danpicton / arch_updater.py
Created February 4, 2024 08:16
Terminal prompt to update Arch every n days
#!/bin/python
from subprocess import run
from datetime import datetime, timedelta
TSFILE_LOCATION = '/home/abcde/.arch_updater'
PROMPT_REMINDER_DAYS = 1
def write_tsfile(ts=None):
@danpicton
danpicton / README.md
Created August 23, 2019 19:25
Simple python server that serves/returns some static/posted JSON

A simple way of serving up simple JSON. Converted to Python 3 from https://gist.github.com/nitaku/10d0662536f37a087e1b

Changes:

  • converts BaseHTTPServer to http.server
  • omits socketserver
  • .encode() appended to json.dumps() calls
  • self.headers.getheader() converted to self.headers.get()
@danpicton
danpicton / fluentd.service
Created April 24, 2019 19:29
systemd service for Raspbian Stretch Lite
### BEGIN INIT INFO
# Provides: fluentd
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
[Unit]
Description=fluentd logger
[Service]
@danpicton
danpicton / project.clj
Created May 2, 2017 19:47
Cloud9 Basic project.clj
(defproject scratch-project "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:repl-options {:init-ns scratch-project.core :timeout 120000}
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]])