Skip to content

Instantly share code, notes, and snippets.

View jskrivseth's full-sized avatar

Jesse Skrivseth jskrivseth

View GitHub Profile
<?php
/**
* @param string $charset the entire set of characters to permute
* @param array|int[] $ring an array of counters representing the character pointed to by each element of the cipher ring
* @return Generator
*/
function permute($charset, array $ring = [0])
{
while (count($ring) <= strlen($charset)) {
@jskrivseth
jskrivseth / yum_patch.sh
Last active August 29, 2020 15:36
Run yum update on all named hosts
#!/bin/bash
hosts=( "host1" "host2" )
for i in "${hosts[@]}"
do
echo "----------"
echo "- Host: $i"
ssh -q "$i" << SSH_COMMANDS
sudo yum update -y
@jskrivseth
jskrivseth / apt_patch.sh
Created August 29, 2020 15:35
Run apt update on all hosts
#!/bin/bash
hosts=( "host3" "host4" )
for i in "${hosts[@]}"
do
echo "----------"
echo "- Host: $i"
ssh -q "$i" << SSH_COMMANDS
sudo apt-get upgrade -y