Do you have a domain that is tied to a non-static IP, such as your home? This script when run from within your network will update your Gandi DNS to your public IP.
The following is an example of how to run this script.
import random | |
from enum import Enum, IntEnum | |
class BRAIN(str, Enum): | |
SMALL = "small" | |
MEDIUM = "medium" | |
GALAXY = "galaxy" | |
def __str__(self) -> str: |
#!/usr/bin/env zsh -f | |
# Purpose: Once you set the DEVICE, | |
# this script will mount your Time Machine drive, | |
# run Time Machine, | |
# and then unmount the drive | |
# | |
# From: Timothy J. Luoma | |
# Mail: luomat at gmail dot com | |
# Date: 2020-04-20 |
async def gather_dict(tasks: dict): | |
async def mark(key, coro): | |
return key, await coro | |
return { | |
key: result | |
for key, result in await gather( | |
*(mark(key, coro) for key, coro in tasks.items()) | |
) | |
} |
import hashlib as hash | |
# Specify how many bytes of the file you want to open at a time | |
BLOCKSIZE = 65536 | |
sha = hash.sha256() | |
with open('kali.iso', 'rb') as kali_file: | |
file_buffer = kali_file.read(BLOCKSIZE) | |
while len(file_buffer) > 0: | |
sha.update(file_buffer) |
def poisson_disk_sample(width=1.0, height=1.0, radius=0.025, k=30): | |
# References: Fast Poisson Disk Sampling in Arbitrary Dimensions | |
# Robert Bridson, SIGGRAPH, 2007 | |
def squared_distance(p0, p1): | |
return (p0[0]-p1[0])**2 + (p0[1]-p1[1])**2 | |
def random_point_around(p, k=1): | |
# WARNING: This is not uniform around p but we can live with it | |
R = np.random.uniform(radius, 2*radius, k) | |
T = np.random.uniform(0, 2*np.pi, k) |
class Bar(object): | |
def plop(self): | |
print 'plop' | |
class Foo(object): | |
def __init__(self): | |
self.bar = Bar() | |
def do(self): | |
print 'done' |