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 / diaspora.conf
Last active Oct 18, 2019
Advanced Diaspora Apache reverse proxy
View diaspora.conf
# Make sure to notice the comments at https://gist.github.com/jhass/719014#gistcomment-19774
<VirtualHost *:80>
ServerName diaspora.example.org
ServerAlias www.diaspora.example.org
RedirectPermanent / https://diaspora.example.org/
</VirtualHost>
<VirtualHost *:443>
ServerName diaspora.example.org
View .well-known[slash]host-meta
<?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 / nginx.conf
Last active Jan 3, 2020
Nginx Diaspora reverse proxy. - This is not a complete Nginx configuration! It only shows the relevant parts for integrating Diaspora.
View nginx.conf
# This is not a complete Nginx configuration! It only shows the relevant parts for integrating Diaspora.
# [...]
http {
# Your standard server configuration goes here
# [...]
gzip_static on;
@jhass
jhass / follow_all.rb
Created Nov 16, 2011
Add all followers to an aspect, edit and save under script/follow_all.rb, run with bundle exec ruby ./script/follow_all.rb
View 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 Dec 30, 2011
Simple script that tries to load it's arguments as YAML files. Don't forget to chmod +x it.
View yml-checker.rb
#!/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 Sep 29, 2015
A PKGBUILD for Diaspora (git release)
View ignore.cpp
/*
* Copyright (C) 2004-2009 See the AUTHORS file for details.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation.
*
* Made by Mini
*/
@jhass
jhass / fortune
Created May 21, 2012
Random fortune cookie
View fortune
#!/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 Jul 7, 2012
Some helper functions to work with the GPIO ports of the RPi
View gpio_functions.sh
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
}
View reshare_path_length.rb
#!/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
You can’t perform that action at this time.