Skip to content

Instantly share code, notes, and snippets.

Jonne Haß jhass

Block or report user

Report or block jhass

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jhass
jhass / .gitignore
Last active Sep 24, 2015
powerdns remote backend for hashbang.sh
View .gitignore
python/
*.log
@jhass
jhass / git-merge-diaspora-stable
Last active Oct 28, 2018
Little helper to merge pull requests to the stable for diaspora/diaspora. Requires github/hub. Handy alias: git config alias.mds merge-diaspora-stable
View git-merge-diaspora-stable
#!/bin/bash
set -e
if [ -z "$1" ]; then
echo "No PR given"
exit 1
fi
parts=(${1//\// })
pr=${parts[${#parts[@]}-1]}
@jhass
jhass / lib_c.cr
Last active Nov 12, 2015
Platform indepedent standard library for Crystal
View lib_c.cr
lib LibC
# Common bindings go here
fun chdir(...)
fun printf(...)
fun wprintf(...)
fun atoi(...)
fun watoic(...)
end
ifdef windows
@jhass
jhass / RubyOnArch.md
Last active Dec 31, 2019
My Ruby setup on Archlinux
View RubyOnArch.md

Ruby on Archlinux

I thought I would document my setup, since it's somewhat non-standard but working quite well for me.

What this does

  • Install major Ruby versions at their latest patch release
  • Allow to switch between them seamlessly
  • Use chruby
  • Encourage bundler usage
@jhass
jhass / .rubocop.yml
Last active Feb 16, 2020
My preferred Rubocop config
View .rubocop.yml
AllCops:
RunRailsCops: true
# Commonly used screens these days easily fit more than 80 characters.
Metrics/LineLength:
Max: 120
# Too short methods lead to extraction of single-use methods, which can make
# the code easier to read (by naming things), but can also clutter the class
Metrics/MethodLength:
@jhass
jhass / vmm-change-password[slash]index.php
Last active Aug 29, 2015
Afterlogic WebMail VMM password change plugin
View vmm-change-password[slash]index.php
<?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.
View keybase.md

Keybase proof

I hereby claim:

  • I am jhass on github.
  • I am jhass (https://keybase.io/jhass) on keybase.
  • I have a public key whose fingerprint is 2BA4 8007 D6F8 3856 3165 B0D7 F347 E0EB 47AC 70D6

To claim this, I am signing this object:

@jhass
jhass / mod_auth_diaspora.lua
Last active Mar 15, 2018
Prosody authentication for Diaspora. Tested with Prosody 0.9.4. See https://wiki.diasporafoundation.org/Integration/XMPP/Prosody
View mod_auth_diaspora.lua
-- 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
View populations.json
{
"Antigua and Barbuda" : 90604,
"United Kingdom" : 63375707,
"China" : 1391193266,
"St. Lucia" : 183292,
"Netherlands" : 16790052,
"Tuvalu" : 9888,
"Iraq" : 34419098,
"Cambodia" : 15312752,
"Canada" : 35417147,
@jhass
jhass / diaspora_spam.rb
Last active Mar 27, 2019
Deletes spam comments, posts and local spam accounts. Place into Diasporas root, edit and run. Don't forget to set necessary environment variables.
View diaspora_spam.rb
#!/usr/bin/env ruby
# List of spam accounts
spam_accounts = %w(spamacc@podA spamacc@podB spamacc@mypod)
# Delete comments even if spammer isn't a local user or spam isn't on a
# local users account.
# And delete posts of users in spam_accounts that aren't local.
always_delete = true
You can’t perform that action at this time.