Skip to content

Instantly share code, notes, and snippets.

View zauberstuhl's full-sized avatar

Lukas Matt zauberstuhl

View GitHub Profile
@zauberstuhl
zauberstuhl / ganggo_validate_message.go
Last active February 24, 2018 00:28
GangGo validate Message
package main
import (
"fmt"
federation "github.com/ganggo/federation"
)
//<me:env xmlns:me="http://salmon-protocol.org/ns/magic-env">\n <me:data type="application/xml">PHN0YXR1c19tZXNzYWdlPjxhdXRob3I-amF5d2lua0BnZ2cuc29jaWFsPC9hdXRob3I-PGd1aWQ-ZmQ2NWEwMjNmZWE2MmU2NDNiNWM5ZTgxMWJlODI5YmQ8L2d1aWQ-PGNyZWF0ZWRfYXQ-MjAxOC0wMi0yM1QyMzoyMTo0Nlo8L2NyZWF0ZWRfYXQ-PHByb3ZpZGVyX2Rpc3BsYXlfbmFtZT5HYW5nR288L3Byb3ZpZGVyX2Rpc3BsYXlfbmFtZT48dGV4dD5QaW5nIHBvbmc8L3RleHQ-PHB1YmxpYz50cnVlPC9wdWJsaWM-PC9zdGF0dXNfbWVzc2FnZT4=</me:data>\n <me:encoding>base64url</me:encoding>\n <me:alg>RSA-SHA256</me:alg>\n <me:sig key_id="amF5d2lua0BnZ2cuc29jaWFs">m0Al iIlJziasAdCZ9mfYbtm1nnhImd31wCtu2rZ9dQL46wjoHI9yD6EYsR5p1XS1FNm9A3PqAszVpJxWO2UGUlVvCote6 m7MbOWQ9lAjnhgfYKhwHeHiZt8lbbC/UaPJz1ZOWi4SUfr7nPOR/aoK5LzYyy4Ls6rUUXSEsbx5NVbj5TBiC/h1UjNTG28ZMnCnNrpViD5pWNhpUuinRmmQc9RLvOcKZNKTezkzsjEhbu5cXc9kZsPhlM WALyYRedpNcW4BsoF4bTWYQSqJsJLz3Jp/4wDc0pN2nPvn8rBvA6NPNJWZMrJxeYUXFwO aFctcSh8ByubXNifEa8wNQ==</me:sig>\n</me:env>
@zauberstuhl
zauberstuhl / diaspora_api_register_client.sh
Created June 8, 2016 20:47
Diaspora API - Register a new application/client and retrieve an access token for your pod
#!/bin/bash
echo -n "Name your client (MyBot): "
read client_name
echo -n "Define your pod address (with https://): "
read domain
cookie_file="/tmp/.cookie"
openid_url="$domain/api/openid_connect"

Keybase proof

I hereby claim:

  • I am zauberstuhl on github.
  • I am zauberstuhl (https://keybase.io/zauberstuhl) on keybase.
  • I have a public key ASA5e6M2OZtdDCX9PUMjxI-5qocx7DQxmbr-JIZvMHdezgo

To claim this, I am signing this object:

@zauberstuhl
zauberstuhl / sidekiq_adjust.sh
Created May 26, 2016 14:22
Sidekiq dynamically adjustment through database load measuring
#!/bin/bash
MAX=12
SKMAX=50
SKMIN=12
DIR=/home/diaspora/diaspora
SSHCONFIG="-F $DIR/../.ssh/config yggdrasil"
CONFIG=$DIR/config/diaspora.yml
#!/bin/bash
# check if script is already running
SELFCHECK=$(ps -eo pid,command |grep -v grep |grep $0 |wc -l)
if [ "$SELFCHECK" -gt 2 ]; then
echo "$0 is already running!";
exit 1;
fi;
NAPTIME=120
@zauberstuhl
zauberstuhl / jsxc.css.diff
Created February 19, 2015 10:43
Diaspora css customization
203,214c203,244
< div#jsxc_roster {
< position: fixed;
< top: 0px;
< bottom: 0px;
< right: 0px;
< width: 200px;
< overflow: visible;
< border-left: 4px solid #A4A4A4;
< z-index: 80;
@zauberstuhl
zauberstuhl / gist:ee95e1eacefa6ddbec6e
Last active August 29, 2015 14:03
Diaspora: Configure Nginx for proxying http-bind to avoid mixed contant problems (XMPP)
upstream chat_cluster {
server localhost:5280;
}
location /http-bind {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto https;
@zauberstuhl
zauberstuhl / gist:2d09330961614b12b642
Last active August 29, 2015 14:03
Diaspora: Configure Apache for proxying http-bind to avoid mixed contant problems (XMPP)
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/http-bind
RewriteRule ^/(http\-bind.*)$ balancer://chat%{REQUEST_URI} [P,QSA,L]
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://diaspora%{REQUEST_URI} [P,QSA,L]
<Proxy balancer://diaspora>
BalancerMember http://127.0.0.1:3000