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 | |
# So sorry it had to come to this, this is slow. | |
# Note that pim and keyfiles etc is static and needs to be modified if used. | |
# veracrypt --text --dismount --slot 1 | |
set -eu -o pipefail | |
CONTAINER="" | |
MOUNTDIR="" | |
WORDLIST="" |
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 | |
set -uo pipefail | |
builtin="add_host | |
apt | |
apt_key | |
apt_repository | |
assemble | |
assert |
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 | |
echo "this will exit so you can go through the code before actually doing anything" | |
exit 0 | |
if ! [ "$SHELL" = "$(which bash)" ]; then | |
chsh -s "$(which bash)" | |
fi | |
curl -sSL https://raw.githubusercontent.com/konstruktoid/dotfiles/master/.bashrc > ~/.bashrc |
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 | |
set -uo pipefail | |
CONTAINER_RUNTIME="unset" | |
if command -v docker >/dev/null 2>&1; then | |
CONTAINER_RUNTIME=docker | |
else | |
CONTAINER_RUNTIME=podman | |
fi |
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 | |
TESTFILE="$1" | |
ASSERTRESULT="0" | |
if [[ -z "${TESTFILE}" ]]; then | |
echo "Please specify a testfile." | |
exit 1 | |
fi | |
if ! file "${TESTFILE}" | grep -q "Python script text"; then |
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 | |
IMG=ubuntu-20.04-server-cloudimg-amd64.img | |
USER_DATA=user-data | |
if [ ! -f "${IMG}" ]; then | |
wget "https://cloud-images.ubuntu.com/releases/focal/release/${IMG}" | |
qemu-img resize "${IMG}" +10G | |
fi | |
if [ ! -f "${USER_DATA}" ]; then |
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
# curl -sSL <URL>/sshpass.rb > /tmp/sshpass.rb && brew install /tmp/sshpass.rb && rm /tmp/sshpass.rb | |
require 'formula' | |
class Sshpass < Formula | |
url 'http://sourceforge.net/projects/sshpass/files/sshpass/1.09/sshpass-1.09.tar.gz' | |
homepage 'http://sourceforge.net/projects/sshpass' | |
sha256 '71746e5e057ffe9b00b44ac40453bf47091930cba96bbea8dc48717dedc49fb7' | |
def install | |
system "./configure", "--disable-debug", "--disable-dependency-tracking", |
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 -eux | |
if nproc &>/dev/null; then | |
CPUS=$(nproc) | |
elif grep -qc processor /proc/cpuinfo; then | |
CPUS=$(grep -c processor /proc/cpuinfo) | |
elif sysctl -n hw.ncpu &>/dev/null; then | |
CPUS=$(sysctl -n hw.ncpu) | |
else | |
CPUS=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/bash | |
{ | |
for VM in $(vagrant status | grep -iE 'running.*virtualbox' | grep "$1" | awk '{print $1}'); do | |
mapfile -t VAGRANT_SSH < <(vagrant ssh-config "$VM" | awk '{print $NF}') | |
echo "[${VAGRANT_SSH[0]}]" | |
echo "${VAGRANT_SSH[1]} ansible_connection=ssh ansible_port=${VAGRANT_SSH[3]} ansible_user=${VAGRANT_SSH[2]} ansible_ssh_private_key_file=${VAGRANT_SSH[7]}" | |
done | |
} > "hosts" |
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 | |
# https://github.com/jeremylong/DependencyCheck | |
dependency-check -f JSON -o . -s . &&\ | |
jq -r '. | .dependencies[].vulnerabilities[]?.severity + " " + .dependencies[].vulnerabilities[]?.vulnerableSoftware[].software.id + " " + .dependencies[].projectReferences[]?' dependency-check-report.json |\ | |
awk '{print tolower($0)}' |\ | |
grep -vE '/.*:".*"$|transitive$' |\ | |
sort |\ | |
uniq |