Skip to content

Instantly share code, notes, and snippets.

@ari
ari / py-buildbot.shar
Created November 17, 2021 02:46
Buildbot 3 port
#!/bin/sh
# This is a shell archive
echo x py-buildbot
mkdir -p py-buildbot > /dev/null 2>&1
echo x py-buildbot/pkg-plist
sed 's/^X//' > py-buildbot/pkg-plist << 'SHAR_END'
Xbin/buildbot
Xbin/buildbot-%%PYTHON_VER%%
Xetc/rc.d/buildbot
X%%PYTHON_SITELIBDIR%%/buildbot-3.4.0-py%%PYTHON_VER%%.egg-info/PKG-INFO
'''
SSL/TLS certificate generator
This script will either create a new key + csr for a new ssl domain or just a new csr, if you already have a key and
you are just renewing a cert
'''
from __future__ import absolute_import
import salt.pillar
@ari
ari / simple.html
Last active March 19, 2020 12:01
Simple email template
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>${subject}</title>
<style type="text/css">
img { max-width: 600px; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic;}
a img { border: none; }
table { border-collapse: collapse !important;}
@ari
ari / build.gradle
Last active August 17, 2019 22:18
Docbook gradle build
/*
Copyright 2015 Aristedes Maniatis
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@ari
ari / bas.py
Created October 21, 2018 09:28
Create BAS entries
#!python3
import argparse
import locale
import logging
from datetime import datetime, date
from lib.moneyworks import Moneyworks
from lib.transaction import Transaction
mw = Moneyworks('/usr/local/etc/salt/runner/mw.ini')
@ari
ari / PageHead.tml
Created May 2, 2018 05:37
PageHead
<t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
<script type="text/javascript">
var ciVersion = '${ciVersion}';
var editorVersion = '${editorVersion}';
var checkoutVersion = '${checkoutVersion}';
</script>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<t:any element="meta" name="generator" content="prop:metaGeneratorContent" />
@ari
ari / complex_salt_orchestrate.sls
Created August 21, 2017 00:30 — forked from whiteinge/complex_salt_orchestrate.sls
An example of a complex, multi-host Salt Orchestrate state that performs status checks as it goes
{% set backends = [ 'colo.dash', 'colo.flash' ] %}
{% set applications = [ 'willow_api', 'willow_services' ] %}
####
# Loop through the applications, and for each loop through the backends
####
{% for application in applications %}
{% for backend in backends %}
@ari
ari / CVE-2017-9615.txt
Last active June 25, 2017 23:49
CVE-2017-9615
[Suggested description]
Password exposure in Cognito Software Moneyworks 8.0.3 ( http://cognito.co.nz/ ) and earlier allows
attackers to gain administrator access to all data, because verbose logging writes the administrator password to a world-readable file.
------------------------------------------
[Additional Information]
1. Original issue discovered and notified to the vendor: 6 June 2017
2. Vendor response acknowledging issue: 6 June 2017
3. Vendor second response confirming they do not plan on fixing the issue: 12 June 2017
@ari
ari / applicationStartScript.sh
Created April 22, 2017 09:43
gradle application plugin start script
#!/usr/bin/env sh
##############################################################################
##
## ${applicationName} start up script
##
##############################################################################
# There is no realpath command on OSX, so we need to fake it
command -v realpath >/dev/null 2>&1 || realpath() {
@ari
ari / doorCounter.py
Created October 3, 2016 23:59
Door counter
#!/usr/bin/python
# Run this application like this:
# /usr/bin/python /home/pi/doorCounter.py -n label -g 22
# -g: GPIO pin to watch
# -n: label to send to Google Analytics
import RPi.GPIO as GPIO
import time