Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Luke Hinds lukehinds

View GitHub Profile
View vtpm-setup.sh
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo -e "Please run as the root user"
exit 1
fi
read -p "Name for vtpm vm: " vm_name
echo -e "Turn off SELinux for now"
View ima-setup.sh
#!/bin/bash
# ./ima-setup.sh 2>&1 | tee output.log
WORK_DIR=$(pwd)
KEYLIME_HOME="${WORK_DIR}/python-keylime"
SWTPM_HOME="${WORK_DIR}/swtpm"
TPM2_TSS_HOME="${WORK_DIR}/tpm2-tss"
TPM2_TOOLS_HOME="${WORK_DIR}/tpm2-tools"
View keytest.sh
#!/bin/bash
REPO="/home/luke/repos/python-keylime"
tpm12image="lukehinds/keylime-ci-tpm12"
tpm12tag="v300"
tpm20image="lukehinds/keylime-ci-tpm20"
tpm20tag="v301"
echo -e "Grabbing latest images"
View vtpm.sh
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo -e "Please run as the root user"
exit 1
fi
echo -e "Updating Packages"
dnf update -y
View rust-cheatsheet.md

Cargo

cargo new hello_cargo # create new project
cargo run # compile and run
cargo build # build
cargo build --release # compiled with optimizations 
cargo fmt --all -- --check # check formatting (but don't correct)
cargo fmt --all # correct formatting.

$ git clone someurl.com/someproject
View tpm2_commands.md

Check ownership status

tpm2_getcap -c properties-variable

Query failure code

tpm2_rc_decode <code>

For example:

View minishift
# Clean up
minishift delete --force --clear-cache
# Start (with a decent amount of logging)
minishift start --vm-driver virtualbox --show-libmachine-logs
# Console
https://192.168.99.100:8443
View new-box.sh
#!/bin/bash
echo -e "Installing vim, zsh, wget and git\n"
sudo yum install vim-enhanced zsh wget git -y
echo -e "Grabbing .vimrc and .zshrc\n"
wget https://gist.githubusercontent.com/lukehinds/a4cd9b82e65d06e4771beb7a5322a36e/raw/278d1e00b6a6ac8c1f1368e415e0f9658307fff8/.vimrc
You can’t perform that action at this time.