Check the output of the lsblk
command to find the correct device (eg: /dev/mmcblk0
):
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
So I've installed a dead simple backup, in /home/USER/git_backup/: | |
git clone --mirror git@github.com:USER/PROJECT.git | |
update.sh (launched every 5 minutes by cron): | |
#/bin/sh | |
cd /home/USER/git_backup/PROJECT.git | |
LINES=`git remote update 2>&1 | wc -l` |
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
/* | |
* Only useful in changelist pages when the ModelAdmin displayed has | |
* "list_editable" (https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_editable) | |
* configured. | |
* | |
* When one of the input/select/textarea value is changed, automatically submit | |
* the form using ajax. | |
* | |
* Only form fields relevant to the "list_editable" will trigger a form submit. | |
* |
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 unicode_literals, absolute_import, division | |
import pytest | |
from django_webtest import DjangoTestApp, WebTestMixin | |
class Stub(object): | |
"""Stub methods, keep track of calls.""" |
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 -*- | |
"""Add permissions for proxy model. | |
This is needed because of the bug https://code.djangoproject.com/ticket/11154 | |
in Django (as of 1.6, it's not fixed). | |
When a permission is created for a proxy model, it actually creates if for it's | |
base model app_label (eg: for "article" instead of "about", for the About proxy | |
model). |
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
import pytest | |
@pytest.fixture(scope='session') | |
def _django_db_setup(request, _django_db_setup, _django_cursor_wrapper): | |
"""Load any data needed for the tests after the database is created. | |
This "overwrites" pytest_django's own _django_db_setup. | |
""" |
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
Not yet! But here are some notes (taken from the release notes): | |
## New | |
* use PBKDF2 for passwords | |
* new URL tags : remove all ```{% load url from future %}``` (and make sure there's no old style ```{% url %}``` tags lurking around) | |
* **INFO**: [update_fields](https://docs.djangoproject.com/en/dev/ref/models/instances/#specifying-which-fields-to-save) added to save only needed fields on a model | |
* **INFO**: calls to [call_command](https://docs.djangoproject.com/en/dev/ref/django-admin/#call-command) now propagates exceptions | |
* **INFO**: [LOGIN_URL](https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-LOGIN_URL) and [LOGIN_REDIRECT_URL](https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-LOGIN_REDIRECT_URL) settings now also allows view function names and named url patterns | |
* **INFO**: when using RequestContext, there's now a [perms](https://docs.djangoproject.com/en/dev/ref/templates/api/#django-contrib-auth-context-processors-auth) in the context that allows to do ```{% if 'someapp.so |
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
"""Reloads the `my_turtle.py` code on save. | |
Put simple turtle instructions in the `my_turtle.py` file, | |
and they'll be re-run (on a clean window) on each file save. | |
Usage: | |
1/ put some turtle instructions in a `my_turtle.py` file | |
(eg `turtle.forward(100)`) | |
2/ run `python watch_turtle.py` on a commandline | |
(no dependencies needed) |
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
// require() some stuff from npm (like you were using browserify) | |
// and then hit Run Code to run it on the right | |
var Validator = require('jsonschema').Validator; | |
var v = new Validator(); | |
var schema = { "allOf" : [ | |
{"type": "boolean"}, | |
{"type": "string"} | |
]} | |
console.log(v.validate("foobar", schema)); |
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 with: | |
gunicorn utilery.views_aiohttp_aiopg:app -b 0.0.0.0:3579 -w 4 -k aiohttp.worker.GunicornWebWorker""" | |
import asyncio | |
import json | |
import math | |
import time | |
import psycopg2 | |
import psycopg2.extras |