I hereby claim:
- I am sprytnyk on github.
- I am sprytnyk (https://keybase.io/sprytnyk) on keybase.
- I have a public key ASBPJMnl5Y0bGmT0N8mOmWSbNW7sSLMk68YQSjFFGlRBZwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| #!/bin/bash | |
| # A bootstrap script for Ubuntu on DigitalOcean | |
| set -eu | |
| trap 'echo "Error on line $LINENO"; exit 1' ERR | |
| echo "Starting bootstrap setup..." | |
| # Update system and install required packages | |
| echo "Updating system and installing required packages..." |
| #!/bin/bash | |
| # VPN bootstrap script. | |
| # 1st step | |
| # Abort script at first error, when a command exits with non-zero status | |
| # (except in until or while loops, if-tests, list constructs) | |
| # https://www.tldp.org/LDP/abs/html/options.html | |
| set -eu | |
| # update repositories and install libraries |
| #!/usr/bin/env python3 | |
| import os | |
| import pathlib | |
| import sys | |
| import django | |
| # Set a project root to a const, this file should be placed in a project root | |
| # as well | |
| PROJECT_ROOT = pathlib.Path(__file__).resolve().parent |
| import resource | |
| from functools import wraps | |
| from time import time | |
| def time_it(func): | |
| @wraps(func) | |
| def wrapper(*args, **kwargs): | |
| start = time() | |
| f = func(*args, **kwargs) |
| import resource | |
| from functools import wraps | |
| def mem_it(func): | |
| @wraps(func) | |
| def wrapper(*args, **kwargs): | |
| pre = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss / 1024 | |
| print(f'Pre-memory usage: {pre} (mb)') | |
| f = func(*args, **kwargs) |
| package main | |
| import "fmt" | |
| func main() { | |
| /* | |
| array address is 0xc000016420. | |
| array values are [5]int{1, 2, 3, 4, 5}. | |
| array type is [5]int. | |
| array length is 5. |
| package main | |
| import "fmt" | |
| func main() { | |
| /* | |
| i initial value is 0 | |
| j initial value is 0 | |
| i initial address is 0xc0000b4010 | |
| j initial address is 0xc0000b4018 |
| import re | |
| import subprocess | |
| from collections import defaultdict | |
| from dataclasses import dataclass, field | |
| from pprint import pprint | |
| TEMPLATE = """## {code} ({text_code}) | |
| ### :x: Problematic code: |
| #!/usr/bin/env bash | |
| # A dummy script incorporated to a gist for the sake of simplicity to install srm. | |
| # Credit: http://techies-world.com/install-srm-secure-remove-command/ | |
| cd "$(mktemp -d)" || exit | |
| echo "Starting to download srm file..." | |
| sudo apt install build-essential | |
| wget http://downloads.sourceforge.net/project/srm/1.2.15/srm-1.2.15.tar.gz | |
| tar -zxvf srm-1.2.15.tar.gz | |
| cd srm-1.2.15 || exit |