Description | Command |
---|---|
Start a new session with session name | screen -S <session_name> |
List running sessions / screens | screen -ls |
Attach to a running session | screen -x |
Attach to a running session with name | screen -r |
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
class Bar(object): | |
def plop(self): | |
print 'plop' | |
class Foo(object): | |
def __init__(self): | |
self.bar = Bar() | |
def do(self): | |
print 'done' |
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
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) |
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 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) |
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
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()) | |
) | |
} |
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/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 |
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 | |
from enum import Enum, IntEnum | |
class BRAIN(str, Enum): | |
SMALL = "small" | |
MEDIUM = "medium" | |
GALAXY = "galaxy" | |
def __str__(self) -> str: |