This file contains hidden or 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 python | |
""" | |
This script is used to refresh the session token for the AWS CLI. | |
It maintains credentials in the AWS_SHARED_CREDENTIALS_FILE file, and | |
refreshes the session token when it is about to expire. | |
It relies on the following tools: | |
- pass: a password manager |
This file contains hidden or 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 python | |
# | |
# Draw OSM geometries over each other projected to 1km units | |
# | |
# Install requirements: | |
# pip install osmnx matplotlib | |
# | |
# Usage: | |
# draw-projected "Cyprus island" "RU-MOW" | |
# |
This file contains hidden or 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
name = radiusd | |
prefix = "" | |
logdir = "/var/log/radius" | |
run_dir = "/var/run/radiusd" | |
libdir = "/usr/lib/freeradius" | |
debug_level = 2 | |
proxy_requests = no | |
raddbdir = "/etc/raddb" | |
certdir = "${raddbdir}/certs" |
This file contains hidden or 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
#!/bin/bash | |
cf_api_fetch() { | |
curl -s "https://api.cloudflare.com/client/v4/$1" \ | |
-H "X-Auth-Email: $CLOUDFLARE_EMAIL" \ | |
-H "X-Auth-Key: $CLOUDFLARE_API_KEY" \ | |
| jq -r "$2" | |
} | |
for zone_id in $(cf_api_fetch "zones" '.result[] | .id'); do |
This file contains hidden or 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 threading | |
import logging | |
from numpy.fft import fft, ifft | |
import numpy as np | |
import jack | |
def denoice(left, right): | |
fft_l = fft(left) |
This file contains hidden or 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 sys | |
import random | |
import requests | |
http = requests.Session() | |
http.cert = 'client.pem' | |
base_url = 'https://its-izba-4ncvjm8.spbctf.ru:13443' |
This file contains hidden or 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
from typing import TypeVar, Iterable, Generator, Callable, cast, Sequence | |
T = TypeVar('T', bound=Sequence) | |
def exact_size_chunks_iter( | |
chunks_iter: Iterable[T], | |
chunk_size: int, | |
concat: Callable[[Iterable[T]], T] = cast(Callable[[Iterable[T]], T], b''.join), |
This file contains hidden or 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
#!/bin/bash | |
ARCH="$(dpkg --print-architecture)" | |
CODENAME="$(. /etc/os-release && echo "$VERSION_CODENAME")" | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor > /etc/apt/trusted.gpg.d/docker.gpg | |
echo "deb [arch="$(dpkg --print-architecture)"] https://download.docker.com/linux/ubuntu \ | |
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" \ | |
> /etc/apt/sources.list.d/docker.list |
This file contains hidden or 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
[sources.journald] | |
type = "journald" | |
[transforms.remove_systemd_fields] | |
type = "remap" | |
inputs = ["journald"] | |
source = ''' | |
del(._BOOT_ID) | |
del(._CAP_EFFECTIVE) | |
del(._CMDLINE) |
This file contains hidden or 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 mmap | |
from PIL import Image | |
import numpy as np | |
size = 32 * 32 * 4 | |
f = open('f.bin', 'w+b') | |
f.truncate(size) | |
mm = mmap.mmap(f.fileno(), size) |