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 | |
# based on https://docs.docker.com/engine/install/debian/ | |
# and https://docs.docker.com/engine/install/ubuntu/ | |
# at 2021-05-03 | |
dist=$(lsb_release --id --short | awk '{ print tolower($0) }') | |
: : : Set up the Docker repository && \ | |
sudo apt update && \ | |
sudo apt -y install \ | |
apt-transport-https \ |
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 argparse | |
import os | |
import random | |
parser = argparse.ArgumentParser() | |
parser.add_argument('file') | |
args = parser.parse_args() | |
data = [] | |
read_size = 1024 * 4 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
@rem Place this file at the live/ directory of the downloaded LIVE555 source files. | |
@rem Based on instructions at https://nspool.github.io/2016/02/building-live555/ | |
@rem Tested with Visual Studio 2015 on Windows 10 | |
@echo off | |
if exist "%TEMP%\sed.vbs" goto skip_gen_sed | |
> "%TEMP%\sed.vbs" ( | |
REM thanks to https://stackoverflow.com/questions/127318/is-there-any-sed-like-utility-for-cmd-exe | |
@echo.Dim pat, patparts, rxp, inp | |
@echo.pat = WScript.Arguments(0^) |
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
from timeit import timeit | |
import re | |
def a(s, delim, n): | |
''' | |
Two-param split, retaining head | |
''' | |
r = s.split(delim, n)[n] | |
return s[:-len(r)-len(delim)], 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
import timeit | |
from math import pow | |
import sys | |
# Python 2/3 compatible | |
# note : alternative versions of this file had pow(x,0.33) replaced with | |
# sqrt(x) or max(x,33,1,2,3,4,5,6,6,7,8,9) to see the effect of the | |
# number of arguments on run times. |
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 python | |
import re | |
import fastnumbers | |
def is_int1(v): | |
try: | |
int(v) | |
return True | |
except ValueError: |
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 python | |
def is_int1(v): | |
return v.lstrip('+-').isdigit() | |
def is_int2(v): | |
try: | |
int(v) | |
return True | |
except ValueError: |
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 | |
OUT_DIR=/opt/DUMP | |
VERBOSE=0 | |
NAME= | |
show_help() { | |
cat <<HELP | |
Backs up a directory. | |
Usage: $0 [-h -?] [-n name] [-o outdir] <directory> [...tar options] |
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/sh | |
# | |
# suggested daily cron jobs: | |
# 7 2 * * * /opt/admin/scripts/link-config-files.sh | |
# 8 3 * * * /opt/admin/scripts/backup-dir.sh /opt/admin | |
# | |
# example FILES format: | |
# /etc/httpd/conf/httpd.conf | |
# /etc/fail2ban/jails.conf |
NewerOlder