--- /dev/null
+#!/bin/sh
+
+# Borrowed and modified from https://stackoverflow.com/questions/63241009/aws-sts-assume-role-in-one-command
+
+ROLE_ARN=$1
+
+shift
+
+export $(printf "AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s AWS_SESSION_TOKEN=%s" \
+ $(aws sts assume-role --role-arn "$ROLE_ARN" --role-session-name "${SESSION_NAME:-aws_run_as}" \
+ --query "Credentials.[AccessKeyId,SecretAccessKey,SessionToken]" \
+ --output text))
+exec "$@"
mkdir -p local_packages/$pkg;
(cd local_packages/$pkg;
deb_name=$pkg
- if [ $pkg == "mr"; ]; then
+ if [ $pkg = "mr" ]; then
deb_name=myrepos
fi;
if which apt-get >/dev/null 2>&1; then
dpkg-deb -x ${deb_name}*.deb .
else
# ok, this host isn't Debian.
- if [ "$pkg" == "mr" ]; then
+ if [ "$pkg" = "mr" ]; then
wget http://http.debian.net/debian/pool/main/m/myrepos/myrepos_1.20160123_all.deb
ar p myrepos*.deb data.tar.xz|xz --decompress|tar -x
- elif [ "$pkg" == "vcsh" ]; then
+ elif [ "$pkg" = "vcsh" ]; then
wget http://http.debian.net/debian/pool/main/v/vcsh/vcsh_1.20151229-1_all.deb
ar p vcsh*.deb data.tar.xz|xz --decompress|tar -x
fi;
);
mkdir -p bin
ln ~/local_packages/$pkg/usr/bin/$pkg bin/$pkg -s
- if [ "$pkg" == "mr" ]; then
- echo -e "[DEFAULT]\ninclude = cat ~/local_packages/$pkg/usr/share/mr/*" >> ~/.mrconfig
+ if [ "$pkg" = "mr" ]; then
+ printf '[DEFAULT]\ninclude = cat ~/local_packages/%s/usr/share/mr/*' "$pkg" >> ~/.mrconfig
fi;
PATH="$HOME/local_packages/$pkg/usr/bin/:$PATH"
export PATH
--- /dev/null
+#!/bin/bash
+
+for i in /sys/bus/pci/drivers/[uoex]hci_hcd/*:*; do
+ [ -e "$i" ] || continue
+ echo "${i##*/}" > "${i%/*}/unbind"
+ echo "${i##*/}" > "${i%/*}/bind"
+done