Dump existing data:
python3 manage.py dumpdata > datadump.json
Change settings.py to Postgres backend.
Make sure you can connect on MySQL. Then:
# Parse Uptime | |
# ------------------------------ | |
def parse_uptime(output = False): | |
try: | |
import re | |
parsed = [] | |
##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) |
import os | |
import paramiko | |
paramiko.util.log_to_file('/tmp/paramiko.log') | |
paramiko.util.load_host_keys(os.path.expanduser('~/.ssh/known_hosts')) | |
host = 'local' | |
port = 22 | |
username = 'user' | |
files = ['file1', 'file2', 'file3', 'file4'] |
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import pprint | |
import subprocess | |
def get_processes(): | |
""" | |
Parse the output of `ps aux` into a list of dictionaries representing the parsed |
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
*/ | |
$args = array( |
<?php | |
/** | |
* Get human readable time difference between 2 dates | |
* | |
* Return difference between 2 dates in year, month, hour, minute or second | |
* The $precision caps the number of time units used: for instance if | |
* $time1 - $time2 = 3 days, 4 hours, 12 minutes, 5 seconds | |
* - with precision = 1 : 3 days | |
* - with precision = 2 : 3 days, 4 hours |
<?php | |
// ADD NEW ADMIN USER TO WORDPRESS | |
// ---------------------------------- | |
// Put this file in your Wordpress root directory and run it from your browser. | |
// Delete it when you're done. | |
require_once('wp-blog-header.php'); | |
require_once('wp-includes/registration.php'); | |
// ---------------------------------------------------- |