Skip to content

Instantly share code, notes, and snippets.

View MarkusH's full-sized avatar
🐍

Markus Holtermann MarkusH

🐍
View GitHub Profile

Keybase proof

I hereby claim:

  • I am markush on github.
  • I am markush (https://keybase.io/markush) on keybase.
  • I have a public key whose fingerprint is 5786 D19B C800 5CE5 7452 0A63 AFE7 9D68 D41C 7E39

To claim this, I am signing this object:

$ xrandr --newmode "1920x1080" 148.50 1920 2008 2052 2200 1080 1084 1088 1125
$ xrandr --addmode VGA1 "1920x1080"
$ xrandr --output VGA1 --mode 1920x1080
@MarkusH
MarkusH / update-pacman-mirrorlist.sh
Created September 1, 2014 07:17
Update pacman mirrorlist
#!/bin/sh
COUNTRY=DE
PROTOCOL=('http' 'https')
IP=(4 6)
if [ $UID != 0 ] ; then
echo "run as root"
exit 1
fi
@MarkusH
MarkusH / testing_backend.py
Created September 14, 2014 23:35
Django File and Locmem Email Backend
import django
from django.core import mail
from django.core.mail.backends.filebased import EmailBackend as FileEmailBackend
class EmailBackend(FileEmailBackend):
def __init__(self, *args, **kwargs):
super(EmailBackend, self).__init__(*args, **kwargs)
if not hasattr(mail, 'outbox'):
mail.outbox = []
@MarkusH
MarkusH / gist:6079d18dd27e6aabf93a
Created October 1, 2014 18:02
Foundation select multiple size
/* http://foundation.zurb.com/forum/posts/3108-form-with-multiselect-invalid-size */
select {
height: auto;
}
select[size], select[multiple] {
background-image: none;
}
@MarkusH
MarkusH / ssh-add.desktop
Created November 10, 2014 07:51
Adding SSH Keys on login in Plasma 5
; File: ~/.config/autostart/ssh-add.desktop
; You need to change USERNAME to your username for "Exec" and "Path"
[Desktop Entry]
Categories=Qt;KDE;System;Network;
Comment=Add SSH keys to session
Exec=/home/USERNAME/.config/autostart/ssh-add.sh
GenericName=Add SSH keys
Icon=
# showmigrations comes from https://github.com/MarkusH/django/tree/ticket23359-2
$ python manage.py showmigrations --plan -v 2
[X] contenttypes.0001_initial
[X] auth.0001_initial ... (contenttypes.0001_initial)
[X] admin.0001_initial ... (auth.0001_initial, contenttypes.0001_initial)
[X] auth.0002_alter_permission_name_max_length ... (auth.0001_initial)
[X] auth.0003_alter_user_email_max_length ... (auth.0002_alter_permission_name_max_length)
[X] auth.0004_alter_user_username_opts ... (auth.0003_alter_user_email_max_length)
[X] auth.0005_alter_user_last_login_null ... (auth.0004_alter_user_username_opts)
[X] sites.0001_initial
@MarkusH
MarkusH / gist:d7faa8326b2e064c90e7
Created December 1, 2014 16:15
TEMPLATE_STRING_IF_INVALID
class InvalidString(str):
def __mod__(self, other):
print(">>> DJANGO TEMPLATE ERROR: Undefined variable or unknown value for: \"%s\"" % other)
TEMPLATE_STRING_IF_INVALID = InvalidString("%s")
@MarkusH
MarkusH / tb-mbox-recover.py
Created January 17, 2015 17:26
Recover Thunderbird mbox mails
In [1]: import mailbox
In [2]: mbox = mailbox.mbox('/tmp/mbox/INBOX')
In [3]: maildir = mailbox.Maildir('/tmp/maildir/')
In [4]: for msg in mbox.itervalues():
...: maildir.add(msg)
@MarkusH
MarkusH / operations.py
Created January 22, 2015 20:00
LoadFixtures Django migration operation
from __future__ import unicode_literals
from os.path import splitext
from django.core import serializers
from django.db.migrations.operations.base import Operation
###############################################################################
# #
# In order to make the following code work, the model serializers and #