Skip to content

Instantly share code, notes, and snippets.

View timothystewart6's full-sized avatar
🚀
Ship it!

Techno Tim timothystewart6

🚀
Ship it!
View GitHub Profile
apiVersion: provisioning.cattle.io/v1
kind: Cluster
metadata:
annotations:
field.cattle.io/creatorId: user-mzmwp
creationTimestamp: '2024-04-08T19:48:03Z'
finalizers:
- wrangler.cattle.io/cloud-config-secret-remover
- wrangler.cattle.io/provisioning-cluster-remove
- wrangler.cattle.io/rke-cluster-remove
@timothystewart6
timothystewart6 / rancher_docker_backup.sh
Last active March 31, 2020 01:56
A script to back up your rancher 2 installation with docker
docker stop rancher_docker_server
docker create --volumes-from rancher_docker_server --name rancher-data-"$(date +%F)" rancher/rancher:latest
docker run --volumes-from rancher-data-"$(date +%F)" -v $PWD:/backup:z busybox tar pzcvf /backup/rancher-data-backup-latest-"$(date +%F)".tar.gz /var/lib/rancher
docker rm rancher-data-"$(date +%F)"
docker start rancher_docker_server
@timothystewart6
timothystewart6 / docker-cleanup.sh
Last active February 24, 2019 23:50
Docker cleanup - crontab
#!/bin/bash
docker rmi $(docker images -q -f dangling=true)
# chmod +x ~/docker-cleanup.sh.
# crontab -e
# every day at midnight
# 0 12 * * * ~/docker-cleanup.sh > /dev/null 2>&1
@timothystewart6
timothystewart6 / do_per_dir.sh
Created September 30, 2018 02:44
Do something per directory
# This is used when you want to do something per directory
# I sometimes do this to make a commit in all sub directories (which are repos)
for dir in ~/dev/work/**;
do (cd "$dir" && git commit -m "fix(something): Just fixed a bug");
done
@timothystewart6
timothystewart6 / clone_all.sh
Last active October 1, 2018 01:02
clone all gitlab repos for an org
# install
# macOS brew install jq
# ubuntu/debian sudo apt-get install jq
# chmod +x clone_all.sh
# gitlab api token https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html
# usage:
# ./clone_all.sh YOUR_GITLAB_ORG_NAME YOUR_GITLAB_API_TOKEN https://gitlab.com
@timothystewart6
timothystewart6 / yarn_install_all.sh
Last active September 30, 2018 02:34
npm/yarn install into each subdirectory that has a package.json .
# This is used when you need to install npm modules for each sub dir that contains a package.json
# This is helpful when cloning an entire org's repos and you aren't sure which are js projects
for dir in ~/dev/work/**;
do if [ ! -f package.json ]; then
(cd "$dir" && yarn install)
fi;
done
@timothystewart6
timothystewart6 / watchman_delete_all.sh
Last active September 30, 2019 18:19 — forked from EQuimper/clear.txt
React-Native clear Watchman + Cache
watchman watch-del-all && rm -rf node_modules/ && yarn cache clean && yarn install && yarn ios -- --reset-cache
@timothystewart6
timothystewart6 / states.js
Created September 23, 2017 18:00
United States
const states = [
'AK - Alaska',
'AL - Alabama',
'AR - Arkansas',
'AS - American Samoa',
'AZ - Arizona',
'CA - California',
'CO - Colorado',
'CT - Connecticut',
'DC - District of Columbia',
@timothystewart6
timothystewart6 / countries-states.js
Last active September 23, 2017 18:00 — forked from e1024kb/gist:41bf38fdb1a2cb19a781
Country - state list in javascript
const countries = [
{
'country': 'Afghanistan',
'states': ['Badakhshan', 'Badghis', 'Baghlan', 'Balkh', 'Bamian', 'Daykondi', 'Farah', 'Faryab', 'Ghazni', 'Ghowr', 'Helmand', 'Herat', 'Jowzjan', 'Kabul', 'Kandahar', 'Kapisa', 'Khost', 'Konar', 'Kondoz', 'Laghman', 'Lowgar', 'Nangarhar', 'Nimruz', 'Nurestan', 'Oruzgan', 'Paktia', 'Paktika', 'Panjshir', 'Parvan', 'Samangan', 'Sar-e Pol', 'Takhar', 'Vardak', 'Zabol'],
},
{
'country': 'Albania',
'states': ['Berat', 'Dibres', 'Durres', 'Elbasan', 'Fier', 'Gjirokastre', 'Korce', 'Kukes', 'Lezhe', 'Shkoder', 'Tirane', 'Vlore'],
},
{
@timothystewart6
timothystewart6 / zsh.md
Created September 3, 2017 15:44 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu