Skip to content

Instantly share code, notes, and snippets.

@alichry
alichry / install-docker-with-compose-on-amazonlinux.sh
Created May 6, 2024 22:44
Install Docker (Compose) on Amazonlinux
#!/bin/sh
set -e
sudo yum install docker
# start docker
sudo systemctl enable --now docker
# add ec2-user to docker group
#!/usr/bin/env php
<?php
$federalRates = [
[49020, 15],
[49020, 20.5],
[53939, 26],
[64533, 29],
[216511, 33]
];
#!/bin/sh
set -e
script_name="$(basename "${0}")"
usage="${script_name}: force retries executing a custom command until it exits successfully.
Usage:
${script_name} COMMAND ARG1 ARG2 ...
Example:
${script_name} curl -C - --retry 5 -L -O {URL}"
@alichry
alichry / srp-client.js
Created September 18, 2021 06:11
SRP client tester
#!/usr/bin/env node
const jsrp = require('jsrp');
const client = new jsrp.client();
const readline = require("readline");
const identity = process.argv[2];
const password = process.argv[3];
const rl = readline.createInterface({
#!/bin/sh
default_args="-C - --retry 5"
script_name="$(basename "${0}")"
usage="${script_name} force retries executing curl until it exits successfully.
Passed arguments are passed to curl. By default, we additionally pass these args:
${default_args}
To execute a curl program, you should include the URL and other options,
if necessary. Example:
${script_name} -L -O {URL}"
<?php
function swap(&$o, $a, $b) {
$x = $o[$a];
$o[$a] = $o[$b];
$o[$b] = $x;
}
$letters = 'abcdefghijklmnopqrstuvwxyz';
$lettersUp = strtoupper($letters);
$digits = '0123456789';