Skip to content

Instantly share code, notes, and snippets.

View todd-dsm's full-sized avatar
🏗️
Just trying stuff...

Todd Thomas todd-dsm

🏗️
Just trying stuff...
  • smpl-cloud
  • SoCal
View GitHub Profile
@todd-dsm
todd-dsm / inst-kube-stuff.sh
Created February 13, 2018 06:20
Install kubelet and kube-proxy
#!/usr/bin/env bash
set -x
export DEBIAN_FRONTEND=noninteractive
apt-get update && apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF
@todd-dsm
todd-dsm / inst_cuda.sh
Last active May 10, 2018 16:48
install issue with cuda on debian stretch
$ sudo ./inst_cuda.sh
+ declare cudaUbuntuRepo=http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1704/x86_64
+ declare cudaGPGPubKeyAddr=http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1704/x86_64/7fa2af80.pub
+ declare cudaRepoInstaller=http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1704/x86_64/cuda-repo-ubuntu1704_9.1.85-1_amd64.deb
+ printf '%s\n' 'Install the CUDA GPG public key...'
Install the CUDA GPG public key...
+ apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1704/x86_64/7fa2af80.pub
Executing: /tmp/apt-key-gpghome.6WVgYJ8JMH/gpg.1.sh --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1704/x86_64/7fa2af80.pub
gpg: requesting key from 'http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1704/x86_64/7fa2af80.pub'
@todd-dsm
todd-dsm / worker.yaml
Created July 27, 2018 16:41
worker ignition config
---
# FIXME: bootcmd is recognized by cloud-init but not by ignition; the command works manually
# URL: https://coreos.com/ignition/docs/latest/configuration-v2_2.html
bootcmd:
- for cpunum in $(cat /sys/devices/system/cpu/cpu*/topology/thread_siblings_list | cut -s -d, -f2- | sort -un); do echo 0 > /sys/devices/system/cpu/cpu$cpunum/online; done
systemd:
units:
- name: docker.service
enable: true
- name: locksmithd.service
@todd-dsm
todd-dsm / source-completions.sh
Last active September 3, 2018 20:02
source-in bash completions on macOS from homebrew installs; gross but sometimes necessary while testing
#!/usr/bin/env bash
printf '\n%s\n' "Sourcing-in completions for:"
while read -r compFile; do
printf '%s\n' " ${compFile##*/}"
source "$compFile"
done <<< "$(find /usr/local/etc/bash_completion.d -type l)"
@todd-dsm
todd-dsm / # vim - 2018-09-03_13-13-48.txt
Created September 3, 2018 21:17
vim on macOS 10.12.6 - Homebrew build logs
Homebrew build logs for vim on macOS 10.12.6
Build date: 2018-09-03 13:13:48
@todd-dsm
todd-dsm / sudoers.sh
Last active May 2, 2022 19:28
configure sudoers properly
#!/usr/bin/env zsh
userSudoFile="/etc/sudoers.d/$USER"
# Set up password-less sudo for the vagrant user
echo "$USER ALL=(ALL) NOPASSWD:ALL" | sudo tee "$userSudoFile" > /dev/null 2>&1
sudo chmod 440 "$userSudoFile"
#------------------------------------------------------------------------------------
@todd-dsm
todd-dsm / enum-apps.sh
Last active September 9, 2018 01:59
enumerate all apps/libs on macOS
#!/usr/bin/env bash
# PURPOSE: Get package details.
# -----------------------------------------------------------------------------
# PREREQS: none
# -----------------------------------------------------------------------------
# EXECUTE: curl -Ls https://goo.gl/78ocQ5 2>&1 | bash | tee /tmp/enum-apps.out
# -----------------------------------------------------------------------------
# CREATED: 2017/01/27
# -----------------------------------------------------------------------------
set -x
@todd-dsm
todd-dsm / findmyself.sh
Last active September 17, 2018 16:50
a simple script
#!/usr/bin/env bash
# who/where am I?
# a simple (bad) example of bash with PE; https://goo.gl/stZWt
set -x
# Use PE to save only the last element of the file name; delimited by forward-slash
reqdFile="${0##*/}" # Global Scope
while read -r foundFile; do
# Use the same PE expression to simplify the names
@todd-dsm
todd-dsm / bashrc
Created September 29, 2018 19:22
source-in all bash completions on macOS
# shellcheck disable=SC2148,SC1090,SC1091,SC2012,SC2139
sysBashrc='/etc/bashrc'
bashComps='/usr/local/share/bash-completion/bash_completion'
bashCompsDir='/usr/local/etc/bash_completion.d'
if [[ -f "\$sysBashrc" ]]; then
source "\$sysBashrc"
# enable bash completions
if [ -f "\$bashComps" ]; then
source "\$bashComps"
if [[ -d "\$bashCompsDir" ]]; then
@todd-dsm
todd-dsm / flow.txt
Created September 29, 2018 22:27
the daily kubernetes grind
# The Daily Grind
## Launch a Pod (create a service)
kubectl run hello-minikube --image=k8s.gcr.io/echoserver:1.4 --port=8080 deployment
## Expose the Pod (service) listening Port
kubectl expose deployment hello-minikube --type=NodePort
## Contact the Pod
curl $(minikube service hello-minikube --url)