This file has been truncated, but you can view the full file.
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
2021-08-05T11:00:33.049Z INFO Configuration loaded {"Location": "/app/config/config.yaml"} | |
2021-08-05T11:00:33.059Z INFO Operator email {"Address": "...."} | |
2021-08-05T11:00:33.059Z INFO Operator wallet {"Address": "...."} | |
2021-08-05T11:00:34.935Z INFO Telemetry enabled {"instance ID": "15ZiPFXywuYhVi53kn5Ki2oujqBfdybVt54i7uTTPgUQJpdaCg"} | |
2021-08-05T11:00:35.325Z INFO db.migration.53 Add address to satellites, inserts stefan-benten satellite into satellites db | |
2021-08-05T11:00:35.555Z INFO db.migration Database Version {"version": 53} | |
2021-08-05T11:00:36.620Z INFO preflight:localtime start checking local system clock with trusted satellites' system clock. | |
2021-08-05T11:00:37.742Z INFO preflight:localtime local system clock is in sync with trusted satellites' system clock. | |
2021-08-05T11:00:37.742Z INFO bandwidth Performing bandwidth usage rollups | |
2021-08-05T11:00:37.742Z INFO Node 15ZiPFXywuYhVi53kn5Ki2oujqBfdybVt54i7uTTPgUQJpdaCg started |
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
#!/bin/bash | |
# Assumming brute force attack has constant hit rate, says X hit per Y seconds, across enough long time range, says T seconds. | |
# Every time we block a suspisuous ip for a period of time and unblock it, | |
# we should wait T seconds to see if there were further attack with rate X/Y hit/seconds. | |
# If this ip still has attack action during T seconds with hit rate X/Y, send it to block list which has doubled block time. | |
# | |
L1_period=300 | |
L2_period=3600 | |
L1_hit_upper=12 |
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 pandas as pd | |
from io import StringIO | |
from openpyxl.formatting.rule import ColorScaleRule | |
from openpyxl.styles import Alignment, Font, NamedStyle | |
from openpyxl.utils import get_column_letter | |
df = pd.read_csv(StringIO("""\ | |
alpha beta gamma | |
2000-01-01 -0.173215 0.119209 -1.044236 | |
2000-01-02 -0.861849 -2.104569 -0.494929 |
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
""" | |
emulation of collections.defaultdict | |
""" | |
class defaultdict(dict): | |
""" | |
emulation of collections.defaultdict | |
to test, run python defaultdict.py -v | |
>>> dd = defaultdict(list) |
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
#!/bin/bash | |
# automatically repair filesystems with inconsistencies during boot | |
#sudo cp rcS /etc/default/ | |
# automatically repair filesystems with inconsistencies during boot | |
# linux - What should I do to force the root filesystem check (and optionally a fix) at boot? - Unix & Linux Stack Exchange | |
# https://unix.stackexchange.com/questions/400851/what-should-i-do-to-force-the-root-filesystem-check-and-optionally-a-fix-at-bo/400927#400927 | |
sudo sed -i 's|GRUB_CMDLINE_LINUX=.*|GRUB_CMDLINE_LINUX="fsck.repair=yes"|' /etc/default/grub | |
sudo update-grub |
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
#!/bin/bash | |
# Command-line to list DNS servers used by my system - Ask Ubuntu | |
# https://askubuntu.com/questions/152593/command-line-to-list-dns-servers-used-by-my-system | |
DEVICE_NAME="eno1" | |
# get interface name | |
interface=$(nmcli device | grep "$DEVICE_NAME" | cut -d' ' -f1) |
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
#!/bin/bash | |
# install qemu utils | |
sudo apt install qemu-utils | |
# install nbd client | |
sudo apt install nbd-client |
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
#!/bin/bash | |
HOST=foo.example.com | |
USER= | |
PASS= | |
IPADDR=$(curl -s https://api.ipify.org) | |
RESULT=$(wget -q -O- "https://$USER:[email protected]/nic/update?hostname=$HOST&myip=$IPADDR&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG") |
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
javascript:(function()%7Bvar%20str%20%3D%20location.href%3Bstr%20%3D%20str.replace(%2F%5C.pdf%2Fg%2C%20%22%22)%3Bstr%20%3D%20str.replace(%2Fpdf%2Fg%2C%20%22abs%22)%3Blocation.href%20%3D%20str%7D)() |
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 bash | |
# Generate a pseudo UUID | |
uuid() | |
{ | |
local N B C='89ab' | |
for (( N=0; N < 16; ++N )) | |
do | |
B=$(( $RANDOM%256 )) |
NewerOlder