Skip to content

Instantly share code, notes, and snippets.

Tobias Kunze rixx

Block or report user

Report or block rixx

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
View notify.cfg
[zammad]
token = secrettoken
url = https://my.domain.com
[pushover]
user = secretusertoken
app = secretapptoken
@rixx
rixx / get_tickets.py
Created Jun 25, 2019
Getting tickets from Django's trac and putting them into an SQLite database – results at https://data.rixx.de
View get_tickets.py
import json
import sqlite3
from datetime import datetime
import requests
BASE_URL = "https://code.djangoproject.com/jsonrpc"
DJANGO_MAX_TICKET = 30588
View covsource.py
import sqlite3
import sys
def usage():
print("Usage: covsource.py <file> <linenos>")
print(" e.g. covsource.py foo/bar.py 14,15\n")
print(" or covsource.py foo/bar.py 14-27\n")
sys.exit(1)
@rixx
rixx / urls.py
Created Jun 18, 2018
Delivering static files on fixed URL in Django
View urls.py
import os
from django.http import Http404, FileResponse
def get_static(request, path, content_type):
path = os.path.join(settings.BASE_DIR, 'pretalx/static', path)
if not os.path.exists(path):
raise Http404()
return FileResponse(open(path, 'rb'), content_type=content_type)
View keybase.md

Keybase proof

I hereby claim:

  • I am rixx on github.
  • I am rixx (https://keybase.io/rixx) on keybase.
  • I have a public key ASDSgbthxeP9hBggbdd7FMbQjKNL5zCBJumGVUtGRwDsawo

To claim this, I am signing this object:

@rixx
rixx / models.py
Created Aug 2, 2017
Django Url Considerations
View models.py
from django.db import models
from urlman import NamedUrls
class Event(models.Model):
code = models.CharField(max_length=20)
class urls(NamedUrls):
base = 'orga:event.list'
detail = 'orga:event.view', {'event': self.code}
@rixx
rixx / git-lg
Created Mar 27, 2017
git config --global alias.lg
View git-lg
$ git config --global alias.lg
log --graph --all --pretty=format:'%C(yellow)%<|(14)%h%Creset %<|(80,trunc)%s %Cgreen%<(15,trunc)%cr %C(bold blue)%<(20,trunc)%an%Creset %C(red)%D%Creset'
View sizing.md
Size 42 44 46 48 50 52 54 56 58 60 62 64
Height 166 168 170 172 174 176 178 180 182 184 186 188
Chest girth 80 86 90 94 98 102 106 110 114 118 122 126
Waist girth 70 74 78 82 86 90 94 98 102 106 110 114
Inseam length 75 77 78 79 80 81 82 83 84 85 86 87

Source

View switch
#!/usr/bin/env python
import os
import subprocess
def switch():
if "nodeadkeys" in subprocess.check_output(["setxkbmap", "-query"]):
os.system("setxkbmap de neo -option")
else:
os.system("setxkbmap de nodeadkeys -option")
@rixx
rixx / 27.5
Last active Aug 29, 2015
Spamassassin Highscores
View 27.5
Spam detection software, running on the system "cirdan",
has identified this incoming email as possible spam. The original
message has been attached to this so you can view it or label
similar future email. If you have any questions, see
root@localhost for details.
Content preview: Hello Dear, Compliments of the season,I am Mrs.Phensiri Pitikornkul,the
wife of the former assistant Governor Bank of Thailand under Thaksin Shinawatra,
the tycoon and founder of a political movement who was ousted in military
coup and Impeached, that led to the overthrow of the Thai Rak Thai Party.
You can’t perform that action at this time.