This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: UTF-8 -*- | |
from __future__ import absolute_import | |
from __future__ import unicode_literals | |
from django.db import models | |
from django.db.models.query import QuerySet | |
from django.core.urlresolvers import reverse | |
from django.utils.timezone import now | |
from django.utils.encoding import python_2_unicode_compatible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: UTF-8 -*- | |
""" | |
A collection of tasks for `Invoke`_ to help setting up a `Django`_ project | |
with `Gunicorn`_ on `Uberspace`_ accounts. | |
All information for this script has to be set in a JSON file | |
called ``settings.json`` in the same directory like this:: | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deployments: | |
testing: | |
host: xyz.domain.tld | |
user: username | |
destination: /home/username/html/misc/path/ | |
sources: | |
- index.html | |
- img |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.exceptions import ValidationError | |
from django.utils.deconstruct import deconstructible | |
@deconstructible | |
class DateValidator(): | |
""" | |
Überprüft ob *ein Datum* vor oder nach einem gegebenen anderen Datum liegt. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def add_image( | |
filenames, image_path, description='Cover', img_type=3, encoding=3 | |
): | |
""" | |
Adds an image to MP3 from *filenames*. | |
Args: | |
filenames (lits): paths to the MP3 | |
image_path (string): path to image file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: UTF-8 -*- | |
"""Serv Bench | |
Very basic test server to try some stuff. | |
""" | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``ab -r -n 200 -c 200 http://localhost:8080/`` | |
* pure sockets (max 5 connections, sleeptime=0.25ms) | |
Time taken for tests: 16.932 seconds | |
Requests per second: 11.81 [#/sec] (mean) | |
Failed requests: 507 | |
* pure sockets (max 500 connections, sleeptime=0.25ms) | |
Time taken for tests: 50.088 seconds | |
Requests per second: 3.99 [#/sec] (mean) | |
Failed requests: 0 | |
* threads (max 500 connections, sleeptime=0.25ms) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: UTF-8 -*- | |
import sys | |
import string | |
trans = string.maketrans( | |
string.lowercase, | |
string.lowercase[13:] + string.lowercase[:13] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Building dependency tree | |
Reading state information... Done | |
The following NEW packages will be installed: | |
lvm2 | |
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. | |
Need to get 584 kB of archives. | |
After this operation, 1182 kB of additional disk space will be used. | |
Get:1 http://archive.raspbian.org/raspbian/ wheezy/main lvm2 armhf 2.02.95-7+rpi1 [584 kB] | |
Fetched 584 kB in 1s (577 kB/s) | |
Selecting previously unselected package lvm2. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DPI scale: 1 | |
startup, version: 3047 linux x64 channel: stable | |
executable: /opt/sublime_text/sublime_text | |
working dir: /home/brutus | |
packages path: /home/brutus/Dokumente/.config/sublime-text-3/Packages | |
state path: /home/brutus/Dokumente/.config/sublime-text-3/Local | |
hardware concurrency: 4 | |
zip path: /opt/sublime_text/Packages | |
zip path: /home/brutus/Dokumente/.config/sublime-text-3/Installed Packages | |
found 7 files for base name Default.sublime-keymap |
OlderNewer