This file contains hidden or 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
| #!/bin/bash | |
| now=`date +%Y%m%d-%H%M%S` | |
| day_ago=7 | |
| db_name="DB_NAME" | |
| base_path="BASE_PATH" | |
| dump_fpath="$base_path/backup_db-$now.sql.gz" | |
| sudo -u postgres pg_dump $db_name | gzip -9 > $dump_fpath |
This file contains hidden or 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
| import asyncio | |
| import os | |
| from aiohttp import web | |
| from aiohttp import streamer | |
| @streamer | |
| async def file_sender(writer, file_path=None): | |
| """ |
This file contains hidden or 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 python3 | |
| import sys, os, socket | |
| from socketserver import ThreadingMixIn | |
| from http.server import SimpleHTTPRequestHandler, HTTPServer | |
| HOST = socket.gethostname() | |
| class ThreadingSimpleServer(ThreadingMixIn, HTTPServer): | |
| pass |
This file contains hidden or 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 | |
| # You need PIL <http://www.pythonware.com/products/pil/> to run this script | |
| # Download unifont.ttf from <http://unifoundry.com/unifont.html> (or use | |
| # any TTF you have) | |
| # Copyright 2011 Álvaro Justen [alvarojusten at gmail dot com] | |
| # License: GPL <http://www.gnu.org/copyleft/gpl.html> | |
| from image_utils import ImageText |
This file contains hidden or 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.contrib import admin | |
| from django.contrib.flatpages.models import FlatPage | |
| # Note: we are renaming the original Admin and Form as we import them! | |
| from django.contrib.flatpages.admin import FlatPageAdmin as FlatPageAdminOld | |
| from django.contrib.flatpages.admin import FlatpageForm as FlatpageFormOld | |
| from django import forms | |
| from ckeditor.widgets import CKEditorWidget |
NewerOlder