This file contains hidden or 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 | |
| # | |
| # This script takes a path to a file and uploads it to Amazon | |
| # Glacier. It does this in several steps: | |
| # | |
| # 1. Split the file up into 1MiB chunks. | |
| # 2. Initiate a multipart upload. | |
| # 3. Upload each part individually. | |
| # 4. Calculate the file's tree hash and finish the upload. | |
| # |
This file contains hidden or 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 | |
| container=${1} | |
| meta() { | |
| local container=$1 | |
| local file="${PWD}/${container}.txt" | |
| local META=" " | |
| cat /dev/null > "${file}" |
This file contains hidden or 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 | |
| pi@raspberrypi:~ $ sudo mdadm --create /dev/md2 --metadata=0.90 --raid-devices=2 --level=raid1 /dev/sda5 missing | |
| mdadm: /dev/sda5 appears to be part of a raid array: | |
| level=raid1 devices=2 ctime=Wed Feb 16 00:00:17 2011 | |
| Continue creating array? y | |
| mdadm: array /dev/md2 started. | |
| pi@raspberrypi:~ $ sudo mdadm --examine /dev/sda5 | |
| /dev/sda5: | |
| Magic : a92b4efc |
This file contains hidden or 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
| <?php | |
| filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE) |
This file contains hidden or 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
| # Using MD5... | |
| ssh-keygen -E md5 -lf ~/.ssh/id_rsa.pub | |
| # Or not... | |
| ssh-keygen -lf ~/.ssh/id_rsa.pub |
This file contains hidden or 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
| sed -e 's/^"//' -e 's/"$//' |
This file contains hidden or 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
| jq -r '.data[] | select(.thing.key == "value") | .thing.value_you_want' |
This file contains hidden or 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
| <?php | |
| substr(strrchr($filename, '.'), 1); |
This file contains hidden or 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 | |
| INSTANCE_NAME=bingo | |
| aws ec2 describe-instances --filter Name=tag:Name,Values=${INSTANCE_NAME} --query Reservations[].Instances[].PrivateDnsName |
This file contains hidden or 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 | |
| # Strip deinfers in comments | |
| sed -ie 's/\/\*[^*]*DEFINER=[^*]*\*\///' path/to/file.sql | |
| # Strip all definers | |
| sed -i 's/DEFINER=`[^`]*`@`[^`]*`//' path/to/file.sql |