Skip to content

Instantly share code, notes, and snippets.

@manno
manno / gist:7500776
Last active December 28, 2015 12:29
jabber.ccc.de + poezio roster versioning hotfix
diff --git a/sleekxmpp/clientxmpp.py b/sleekxmpp/clientxmpp.py
index 6bcb36b..5d00483 100644
--- a/sleekxmpp/clientxmpp.py
+++ b/sleekxmpp/clientxmpp.py
@@ -240,8 +240,6 @@ class ClientXMPP(BaseXMPP):
iq = self.Iq()
iq['type'] = 'get'
iq.enable('roster')
- if 'rosterver' in self.features:
- iq['roster']['ver'] = self.client_roster.version

Keybase proof

I hereby claim:

  • I am manno on github.
  • I am manno (https://keybase.io/manno) on keybase.
  • I have a public key whose fingerprint is 23AC 27F5 AB99 000A 2A1E 77B3 93E4 4FAC 6495 B44F

To claim this, I am signing this object:

@manno
manno / test_ar.rb
Created May 20, 2014 09:27
AR missing join table alias
unless File.exist?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
gem 'arel', github: 'rails/arel'
gem 'sqlite3'
GEMFILE
system 'bundle install'
end
(while read url; do
echo "============ $url ============"
curl --header "Range: bytes=0-10485760" -4 $url/congress/2014/opus/31c3-6050-en-Code_Pointer_Integrity_opus.opus > /dev/null
done <<EOF
http://berlin.ftp.media.ccc.de/
http://c3media.vsos.ethz.ch/
http://ccc1.mirror.xt0.org/
http://ccc2.mirror.xt0.org/
http://dedi5.s11.c3voc.de/
http://fr1.1und1.c3voc.de
#!/bin/bash
lockfile=/var/tmp/rsync-media.lock
if ( set -o noclobber; echo "$$" > "$lockfile") 2> /dev/null; then
trap 'rm -f "$lockfile"; exit $?' INT TERM EXIT
# begin
#rsync -Pa -x rsync://ftp.halifax.rwth-aachen.de/ccc/congress/2014/ /srv/ftp/congress/2014
@manno
manno / .pryrc
Last active August 29, 2015 14:22
pry command for graphing AASM models with graphviz
# see https://github.com/ivantsepp/aasm_graph/blob/master/bin/aasm_graph
Pry.config.commands = Pry::CommandSet.new do
helpers do
def dot_template(edges)
<<-DOT
digraph cronjob {
rankdir=LR; /* This should be configurable */
node [shape = circle];
#{edges}
}
@manno
manno / .pryrc
Created June 10, 2015 13:02
pry command for graphing AASM models with graphviz
# see https://github.com/ivantsepp/aasm_graph/blob/master/bin/aasm_graph
Pry::Commands.helpers {
def dot_template(edges)
<<-DOT
digraph cronjob {
rankdir=LR; /* This should be configurable */
node [shape = circle];
#{edges}
}
DOT
@manno
manno / openvpn_up.sh
Last active December 13, 2015 14:35
OpenVPN commandline with NetworkManager and internal DNS
#!/bin/sh
nameserver=$(env | perl -anE 'print $F[-1] if /foreign_option.*DNS/')
if [ "$nameserver" ]; then
#echo "nameserver $nameserver" | resolvconf -a $dev
nmcli con modify $dev +ipv4.dns $nameserver
fi
domain=$(env | perl -anE 'print $F[-1] if /foreign_option.*DOMAIN/')
if [ "$nameserver" ] && [ "$domain" ]; then
@manno
manno / cap-staging
Created February 18, 2016 07:20
testi cap
#!/bin/sh
export CAP_REPO=https://github.com/voc/media.ccc.de.git
export CAP_BRANCH=master
export CAP_USER=media
export CAP_HOST=195.54.164.162
export CAP_PORT=16723
bundle exec cap staging $*
let g:neomake_sh_shellcheck_maker = {
\ 'args': ['-fgcc', '-e', 'SC2034,SC2148,SC2164,SC2086,SC2154'],
\ 'errorformat':
\ '%f:%l:%c: %trror: %m,' .
\ '%f:%l:%c: %tarning: %m,' .
\ '%I%f:%l:%c: note: %m',
\ }