View secure-aes-gen.sh
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 | |
# | |
# Create a variable `$key` for use in powershell as a AES encyrption key | |
# constant with (ConvertFrom-SecureString)[https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/convertfrom-securestring?view=powershell-7.2)] | |
# | |
# param: $1 secret key (optional, default: secret) | |
# param: $2 cipher (optional, default: aes-256-cbc) | |
# output: An byte array (in decimals), the size of the encryption key (AES256 = 32 bytes) | |
genkey() { |
View g++-5.sh
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 | |
apt-get update | |
DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common | |
add-apt-repository ppa:ubuntu-toolchain-r/test | |
apt-get update | |
DEBIAN_FRONTEND=noninteractive apt-get install -y g++-5 gcc-5 |
View bash_aliases
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 | |
# shellcheck disable=SC1073,SC1007,SC1072,SC1090,SC1091,SC2015 | |
if [[ $UID -ne 0 ]]; then | |
if ! type -t __git_ps1 >/dev/null 2>&1 && test -e /usr/share/git-core/contrib/completion/git-prompt.sh; then | |
. /usr/share/git-core/contrib/completion/git-prompt.sh | |
fi | |
if type -t __git_ps1 >/dev/null 2>&1; then | |
PS1='[\[\033[32m\]\u@\h\[\033[00m\] \[\033[36m\]\W\[\033[31m\]$(__git_ps1)\[\033[00m\]] \$ ' |
View iam-assume-role.sh
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 | |
# | |
# Assume the given role, and print out a set of environment variables | |
# for use with aws cli. | |
# | |
# To use: | |
# | |
# $ eval $(./iam-assume-role.sh) | |
# |
View route53-asg-rrdns.sh
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 | |
# | |
# Get all IPs from an autoscale group and update set the local ip as | |
# equal weight A entries (round robin dns). Takes autoscale group as | |
# parameter. | |
# | |
# Amit Bakshi | |
# 10/21/2014 | |
# |
View docker-direct-lvm.sh
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 | |
set -e | |
## striping seems to break docker | |
#STRIPE="-i2 -I64" | |
#DEVS="/dev/xvdf /dev/xvdg" | |
DEVS="$1" | |
if [ -z "$DEVS" ]; then | |
echo >&2 "Specify which block devices to use" | |
exit 1 |
View parse-opts.sh
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 bash | |
# | |
# MIT Licensensed | |
# Amit Bakshi Jan 2021 | |
# Generic option parser. | |
# Usage: | |
# parse_opts --valid-args 'foo bar link' -- --with-foo=yes --bar=fizz --no-link | |
# | |
# Yields: |
View cloud-init.sh
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 | |
# | |
# Amazon Linux cloud-init script | |
# | |
# Amit Bakshi | |
# 10/2014 | |
# | |
if [ `id -u` -ne 0 ]; then | |
sudo exec /bin/bash -x "$0" "$@" | |
fi |
View ssh-keygen.service
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
[Unit] | |
Description=Generate sshd keys | |
Before=ssh.service | |
ConditionPathExists=!/etc/ssh/ssh_host_rsa_key | |
[Service] | |
Type=oneshot | |
ExecStart=/usr/bin/ssh-keygen -A | |
RemainAfterExit=true | |
StandardOutput=journal |
View Autounattend.xml
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
<?xml version="1.0" encoding="utf-8"?> | |
<unattend xmlns="urn:schemas-microsoft-com:unattend"> | |
<settings pass="windowsPE"> | |
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<SetupUILanguage> | |
<UILanguage>en-US</UILanguage> | |
</SetupUILanguage> | |
<InputLocale>en-US</InputLocale> | |
<SystemLocale>en-US</SystemLocale> | |
<UILanguage>en-US</UILanguage> |
NewerOlder