Skip to content

Instantly share code, notes, and snippets.

@daurnimator
daurnimator / prosody.service
Created August 4, 2014 01:55
systemd unit for prosody; assumes mod_systemd
[Unit]
Description=XMPP (Jabber) Server
After=network.target
[Service]
User=prosody
ProtectSystem=full
ProtectHome=true
Type=notify
ExecStart=/usr/bin/prosody
@jhass
jhass / vmm-change-password[slash]index.php
Last active August 29, 2015 14:07
Afterlogic WebMail VMM password change plugin
<?php
/*
* Afterlogic WebMail VMM password change plugin
* Based upon http://www.afterlogic.com/wiki/Password_change_for_ISPConfig_%28WebMail_Plugins%29
* VMM: http://vmm.localdomain.org/
* WebMail lite: http://www.afterlogic.org/webmail-lite
*
* The plugin calls doveadm pw.
*
* You should create a dedicated role and add it to the mailsys role.
@Raven24
Raven24 / rvm_no_root.sh
Last active October 13, 2015 00:18
RVM with no-root ensurance
#!/usr/bin/env sh
# this script installs rvm with the most recent stable version of ruby
# and makes sure it is not run as root,
# based on my earlier attempt for a general purpose root avoidance
# https://gist.github.com/3930399
# the command we'll be running
export RVM_CMD="curl -L https://get.rvm.io | bash -s stable"
@jhass
jhass / me@mrzyx.de.asc.txt
Last active December 10, 2015 11:49
PGP key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.0.22 (GNU/Linux)
mQENBE7I+ZUBCAC1zez5X2Y4zFbslYAobm4VX3jxV9gfAmN8rF6CM4cvGzcuy4+a
woRDXXu016QH3v/pnSSn9neWGNm4HULNiAl3gxIjhBvZcyiVV5eiDQaxLENZrjYb
BW0YtseVwWBmwD3mEyA7eRz81rzgldvUbQmh9DEEl0ZJf8tsQWGrQQB7g10bdRVp
X2P/KSYsoodDEiF+XDfSPKrzAZoqxa/mSZFCQeyThsvSyTa8baSvDA5iHm/p4MPn
Pa0Aki6QYLgYkGo5wFbrPENV7wToMiNOzg21mYdKouaijAC592CqWi1XSQE8nIEq
NppX+uI2jazH3EqFNviuyFKyw9fGYInHYHWrABEBAAG0GEpvbm5lIEhhw58gPG1l
QG1yenl4LmRlPohGBBARAgAGBQJQ42hSAAoJEOpqsNjng4LhbX8An1qLlq1b/5uA
@acook
acook / BinaryDataHandling.markdown
Last active December 23, 2015 10:29
List of gems useful for parsing/generating binary data from Ruby.

Binary Data

It can be challenging to use Ruby for handling raw binary data, involving a lot of Array#pack and String#unpack with the possibility of String#ord and Numeric#chr for good measure. Some of these tools might make the job a bit easier, allowing your to define schemas of the binary data and how to parse it, or even just allowing your to specify the format in a more verbose way.

Gems

BinData

@jonasschneider
jonasschneider / foreman
Created February 2, 2013 21:13
foreman-systemd
#! /usr/bin/env ruby
require 'foreman/cli'
require File.expand_path(File.dirname(__FILE__)) + '/foreman_export_systemd.rb'
Foreman::CLI.start
@jhass
jhass / mod_auth_diaspora.lua
Last active March 15, 2018 13:14
Prosody authentication for Diaspora. Tested with Prosody 0.9.4. See https://wiki.diasporafoundation.org/Integration/XMPP/Prosody
-- Based on Simple SQL Authentication module for Prosody IM
-- Copyright (C) 2011 Tomasz Sterna <tomek@xiaoka.com>
-- Copyright (C) 2011 Waqas Hussain <waqas20@gmail.com>
--
-- 25/05/2014: Modified for Diaspora by Anahuac de Paula Gil - anahuac@anahuac.eu
-- 06/08/2014: Cleaned up and fixed SASL auth by Jonne Haß <me@jhass.eu>
-- 22/11/2014: Allow token authentication by Jonne Haß <me@jhass.eu>
local log = require "util.logger".init("auth_diaspora")
local new_sasl = require "util.sasl".new
@datanoise
datanoise / crystal-tags.cr
Last active March 5, 2021 03:24
ctags for crystal language
require "compiler/crystal/**"
require "option_parser"
include Crystal
class ToCtagsVisitor < Visitor
@filename : String
@lines : Array(String)
@io : IO
@opts : Generator
@jhass
jhass / append.sh
Last active April 12, 2021 10:57
My public SSH key
echo -e "\n$(curl -L https://gist.github.com/jhass/66f02fe5044fa720c623/raw/cert-authority.pub)\n" >> ~/.ssh/authorized_keys