Dump existing data:
python3 manage.py dumpdata > datadump.json
Change settings.py to Postgres backend.
Make sure you can connect on MySQL. Then:
| ##TCP FLAGS## | |
| Unskilled Attackers Pester Real Security Folks | |
| ============================================== | |
| TCPDUMP FLAGS | |
| Unskilled = URG = (Not Displayed in Flag Field, Displayed elsewhere) | |
| Attackers = ACK = (Not Displayed in Flag Field, Displayed elsewhere) | |
| Pester = PSH = [P] (Push Data) | |
| Real = RST = [R] (Reset Connection) | |
| Security = SYN = [S] (Start Connection) |
| # Parse Uptime | |
| # ------------------------------ | |
| def parse_uptime(output = False): | |
| try: | |
| import re | |
| parsed = [] | |
| # Install requirements | |
| apt-get install -y build-essential | |
| apt-get install -y checkinstall | |
| apt-get install -y libreadline-gplv2-dev | |
| apt-get install -y libncursesw5-dev | |
| apt-get install -y libssl-dev | |
| apt-get install -y libsqlite3-dev | |
| apt-get install -y tk-dev | |
| apt-get install -y libgdbm-dev | |
| apt-get install -y libc6-dev |
| ## {{{ http://code.activestate.com/recipes/578019/ (r15) | |
| #!/usr/bin/env python | |
| """ | |
| Bytes-to-human / human-to-bytes converter. | |
| Based on: http://goo.gl/kTQMs | |
| Working with Python 2.x and 3.x. | |
| Author: Giampaolo Rodola' <g.rodola [AT] gmail [DOT] com> | |
| License: MIT |
| ssh-keygen -t rsa | |
| # === OR ==== | |
| mkdir /path/to/folder | |
| chmod -R 755 /path/to/folder | |
| ssh-keygen -t rsa -b 4096 -C "[email protected]" -f /path/to/folder/key -q -N “” |
| pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U |
| CREATE DATABASE dbname CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | |
| CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password'; | |
| GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost'; | |
| FLUSH PRIVILEGES; | |
| # Dump | |
| mysqldump -uUSER -pPASS DBNAME > dump.sql | |
| # Restore |
| #!/bin/sh | |
| #Check the Drive Space Used by Cached Files | |
| du -sh /var/cache/apt/archives | |
| #Clean all the log file | |
| #for logs in `find /var/log -type f`; do > $logs; done | |
| logs=`find /var/log -type f` | |
| for i in $logs |