Skip to content

Instantly share code, notes, and snippets.

{
"Antigua and Barbuda" : 90604,
"United Kingdom" : 63375707,
"China" : 1391193266,
"St. Lucia" : 183292,
"Netherlands" : 16790052,
"Tuvalu" : 9888,
"Iraq" : 34419098,
"Cambodia" : 15312752,
"Canada" : 35417147,

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 / 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.
<?xml version='1.0' encoding='UTF-8'?>
<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'
xmlns:hm='http://host-meta.net/xrd/1.0'>
<hm:Host>mrzyx.de</hm:Host>
<Link rel='lrdd'
template='https://mrzyx.de/webfinger.php?q={uri}'>
<Title>Resource Descriptor</Title>
</Link>
</XRD>
@jhass
jhass / follow_all.rb
Created November 16, 2011 11:08
Add all followers to an aspect, edit and save under script/follow_all.rb, run with bundle exec ruby ./script/follow_all.rb
#!/usr/bin/env ruby
user_id = 0 # your user id
aspect_name = "Work" # Name of the aspect followers should be added to
require File.join(File.dirname(File.expand_path(__FILE__)), '..', 'config', 'environment')
user = User.find(user_id)
aspect = user.aspects.where(:name => aspect_name).first
user.contacts.only_sharing.each do |contact|
begin
user.share_with(contact.person, aspect)
@jhass
jhass / yml-checker.rb
Created December 30, 2011 17:53
Simple script that tries to load it's arguments as YAML files. Don't forget to chmod +x it.
#!/usr/bin/env ruby
require 'yaml'
files = ARGV
if !files.nil? && files.length >= 1
files.each do |file|
if File.exists?(file) && File.file?(file)
begin
print "checking #{file}..."
@jhass
jhass / Diaspora-PKGBUILD.md
Last active September 29, 2015 18:37
A PKGBUILD for Diaspora (git release)
@jhass
jhass / fortune
Created May 21, 2012 14:41
Random fortune cookie
#!/usr/bin/env python
# -*- coding: utf8
from random import choice
fortunes = ["“Welcome” is a powerful word.",
"A dubious friend may be an enemy in camouflage.",
"A feather in the hand is better than a bird in the air. (2)",
"A fresh start will put you on your way.",
"A friend asks only for your time not your money.",
"A friend is a present you give yourself.",
"A gambler not only will lose what he has, but also will lose what he doesn’t have.",
@jhass
jhass / gpio_functions.sh
Created July 7, 2012 13:04
Some helper functions to work with the GPIO ports of the RPi
function export() {
echo "$1" | sudo tee /sys/class/gpio/export
sudo chgrp -RH --dereference users /sys/class/gpio/*
sudo chmod -R g+w+r /sys/class/gpio/*/*
}
function unexport() {
echo "$1" | sudo tee /sys/class/gpio/unexport
}
#!/usr/bin/env ruby
require './config/environment'
def path_length(post, length=0)
if post.is_a?(Reshare)
path_length(post.root, length+1)
else
length
end
end