Skip to content

Instantly share code, notes, and snippets.

View mchwalisz's full-sized avatar

Mikołaj Chwalisz mchwalisz

View GitHub Profile
#!/bin/sh
### BEGIN INIT INFO
# Provides: myservice
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Put a short description of the service here
# Description: Put a long description of the service here
@mchwalisz
mchwalisz / email.sh
Created August 6, 2014 12:42 — forked from fuzzmz/email.sh
#!/bin/sh
### BEGIN INIT INFO
# Provides: SystemEmail
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Send email
# Description: Sends an email at system start and shutdown
### END INIT INFO
import thread
import time
import zmq
# global zmg context
context = zmq.Context.instance()
endpoint = "tcp://*:8888"
# the subscriber thread function
def subscriber(name, address, cnt, subscriptions):
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@mchwalisz
mchwalisz / git-latexdiff.PKGBUILD
Created July 28, 2017 07:39 — forked from sebastianst/git-latexdiff.PKGBUILD
PKGBUILD of git-latexdiff AUR Package
# Maintainer: Benjamin Chrétien <chretien at lirmm dot fr>
# Contributor: Sebastian Stammler <base64 -d<<<c2ViQGhkZG4uc3BhY2UK>
pkgname=git-latexdiff
pkgver=1.2.0
pkgrel=1
pkgdesc="Simple but very convenient wrapper around Git and latexdiff"
arch=('any')
url="https://gitlab.com/git-latexdiff/git-latexdiff"
license=('BSD')
depends=('texlive-core' 'texlive-bin' 'git')
@mchwalisz
mchwalisz / setup.py
Created August 1, 2017 13:05 — forked from nloadholtes/setup.py
An example of using the git hash/tag as a version number
from setuptools import setup, find_packages
import subprocess
def _get_version_hash():
"""Talk to git and find out the tag/hash of our latest commit"""
try:
p = subprocess.Popen(["git", "describe",
"--tags", "--dirty", "--always"],
stdout=subprocess.PIPE)
except EnvironmentError: