Скрипт переехал в репозиторий на GitHub.
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
# Start simple SMTP server on localhost:25 and print to standard output all email headers and the email body. | |
# Useful for debugging outgoing mail without configuring SMTP daemon in development enviroment. | |
python -m smtpd -n -c DebuggingServer localhost:25 |
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 bash | |
# http://smirnov-am.blogspot.com/2015/04/installation-of-python-279-in-ubuntu.html | |
# http://davebehnke.com/python-pyenv-ubuntu.html | |
# https://renoirboulanger.com/blog/2015/04/upgrade-python-2-7-9-ubuntu-14-04-lts-making-deb-package/ | |
# install dependencies | |
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get install build-essential |
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_extensions.management.shells import import_objects | |
from django.core.management.color import no_style | |
globals().update(import_objects({"dont_load":[], "quiet_load":False},no_style())) |
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
# file for git rename |
Let's say you start a project locally, and do some editing.
$ mkdir -p ~/git/foo && cd ~/git/foo
$ touch NEWFILE
Now you decide you want to create a new github repo and track it, but the directory is non-empty so git won't let you clone into it. You can fix this, thusly:
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 rest_framework import serializers | |
from rest_auth.serializers import UserDetailsSerializer | |
class KnoxSerializer(serializers.Serializer): | |
""" | |
Serializer for Knox authentication. | |
""" | |
token = serializers.CharField() |
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
# the following two lines give a two-line status, with the current window highlighted | |
hardstatus alwayslastline | |
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]' | |
# huge scrollback buffer | |
defscrollback 5000 | |
# no welcome message | |
startup_message off |
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 python:3.7 | |
ENV PYTHONUNBUFFERED 1 | |
WORKDIR /code | |
# Copying the requirements, this is needed because at this point the volume isn't mounted yet | |
COPY requirements.txt /code/ | |
# Installing requirements, if you don't use this, you should. | |
# More info: https://pip.pypa.io/en/stable/user_guide/ |