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
#!/usr/bin/python | |
import csv | |
import sys | |
from datetime import datetime | |
import matplotlib.pyplot as plt | |
import matplotlib.dates as mdates | |
import matplotlib.image as image | |
import matplotlib.lines as mlines | |
import os.path |
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
#!/usr/bin/python | |
from PIL import Image | |
import numpy | |
import argparse | |
import os | |
import sys | |
#Configure argument parser to take input arguments |
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
# How to encode and decode a file backed up as a series of printed QR codes | |
# Install the required tools | |
sudo apt-get update | |
sudo apt-get install zbar-tools imagemagick qrencode | |
################################################################################ | |
# Convert the file to a base 64 encoded format. Probably not needed as QR codes |
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 mailbox | |
from email.header import decode_header | |
import re | |
import itertools | |
regex = re.compile('[^a-zA-Z0-9]') | |
words = [] | |
for message in mailbox.mbox('Inbox.mbox'): | |
subject, encoding = decode_header(message['subject'])[0] |
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 numpy as np | |
import matplotlib.pyplot as plt | |
import scipy.special as sp | |
a = 1.55 | |
current = 1 | |
mu = 4 * np.pi / 10000000 | |
# equal to sqrt(4ra(z^2 + (a+r)^2)^(-1)) | |
def k_val (R, Z): |
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 numpy as np | |
import matplotlib.pyplot as plt | |
import scipy.special as sp | |
a = 1.55 | |
current = 1 | |
mu = 4 * np.pi / 10000000 | |
# equal to sqrt(4ra(z^2 + (a+r)^2)^(-1)) | |
def k_val (R, Z): |
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 random | |
import math | |
import sqlite3 | |
import numpy | |
import matplotlib.pyplot as plt | |
from matplotlib.collections import LineCollection | |
def order_trajectory(base, colours, trajectory): | |
scale = 500 | |
day_trajectory = trajectory / 24 |
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 itertools as itt | |
from collections import deque | |
# Each element of a sequence can have these values | |
possible_elements = [0, 1, 2, 3, 4, 5, 6, 7] | |
element_count = len(possible_elements) | |
# A sequence contains this many elements | |
sequence_length = 4 |
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
function Hex_To_Bytes($hex){ | |
# Takes a string with an even number of hexadecimal characters and | |
# converts it two characters at a time to an array of bytes half as long | |
# Initialize ouput byte array | |
$hexLength = $hex.Length | |
$byteLength = $hexLength / 2 | |
$bytes = ,0 * ($byteLength) | |
# generate bytes by taking 2 hexadecimal characters at a time |
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
<# | |
.SYNOPSIS | |
Backs up and encrypts a directory or file | |
.DESCRIPTION | |
Backs up files or directories by adding it them a tar file and then | |
encrypting it with a public key. Becuase public key encryption is used | |
there are no passwords stored anywhere. | |
gpg must be installed and the public key you want to use must be imported. |
OlderNewer