start new:
tmux
start new with session name:
tmux new -s myname
| from django.contrib import admin | |
| class ReadOnlyModelAdmin(admin.ModelAdmin): | |
| """ | |
| ModelAdmin class that prevents modifications through the admin. | |
| The changelist and the detail view work, but a 403 is returned | |
| if one actually tries to edit an object. |
| import email | |
| def get_decoded_email_body(message_body): | |
| """ Decode email body. | |
| Detect character set if the header is not set. | |
| We try to get text/plain, but if there is not one then fallback to text/html. | |
| :param message_body: Raw 7-bit message body input e.g. from imaplib. Double encoded in quoted-printable and latin-1 |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
| #!/usr/bin/env python3 | |
| """ | |
| License: MIT License | |
| Copyright (c) 2023 Miel Donkers | |
| Very simple HTTP server in python for logging requests | |
| Usage:: | |
| ./server.py [<port>] | |
| """ | |
| from http.server import BaseHTTPRequestHandler, HTTPServer |
| SELECT table, | |
| formatReadableSize(sum(bytes)) as size, | |
| min(min_date) as min_date, | |
| max(max_date) as max_date | |
| FROM system.parts | |
| WHERE active | |
| GROUP BY table |
| # Reference: https://www.exclamationlabs.com/blog/continuous-deployment-to-npm-using-gitlab-ci/ | |
| # GitLab uses docker in the background, so we need to specify the | |
| # image versions. This is useful because we're freely to use | |
| # multiple node versions to work with it. They come from the docker | |
| # repo. | |
| # Uses NodeJS V 9.4.0 | |
| image: node:9.4.0 | |
| # And to cache them as well. |
| """ | |
| Custom django checks. | |
| H001: Field has no verbose name. | |
| H002: Verbose name should use gettext. | |
| H003: Words in verbose name must be all upper case or all lower case. | |
| H004: Help text should use gettext. | |
| H005: Model must define class Meta. | |
| H006: Model has no verbose name. | |
| H007: Model has no verbose name plural. |
/!\ Be very carrefull in your setup : any misconfiguration make all the git config to fail silently ! Go trought this guide step by step and it should be fine 😉
~/.ssh/config, set each ssh key for each repository as in this exemple: