Skip to content

Instantly share code, notes, and snippets.

@andrey-zh
andrey-zh / 1-setopts.zsh
Created June 6, 2024 18:02 — forked from mattmc3/1-setopts.zsh
ZSH - options by framework
## ZSH Options
# http://zsh.sourceforge.net/Doc/Release/Options.html
# Changing Directories
# http://zsh.sourceforge.net/Doc/Release/Options.html#Changing-Directories
setopt auto_cd # if a command isn't valid, but is a directory, cd to that dir
setopt auto_pushd # make cd push the old directory onto the directory stack
setopt pushd_ignore_dups # don’t push multiple copies of the same directory onto the directory stack
setopt pushd_minus # exchanges the meanings of ‘+’ and ‘-’ when specifying a directory in the stack

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
#!/bin/bash
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
# inspired by
# https://gist.github.com/codeinthehole/26b37efa67041e1307db
# https://github.com/why-jay/osx-init/blob/master/install.sh
# https://github.com/timsutton/osx-vm-templates/blob/master/scripts/xcode-cli-tools.sh
@andrey-zh
andrey-zh / osx_bootstrap.sh
Created April 7, 2022 20:11 — forked from codeinthehole/osx_bootstrap.sh
Script to install stuff I want on a new OSX machine
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new OSX machine
#
# This should be idempotent so it can be run multiple times.
#
# Some apps don't have a cask and so still need to be installed by hand. These
# include:
#
# - Twitter (app store)
@andrey-zh
andrey-zh / 1-install-zsh-lsd.sh
Last active April 13, 2022 13:05
terminal setup
#!/bin/bash
##### install updates #####
sudo apt-get update
sudo apt-get install build-essential -y
##### install zsh #####
sudo apt-get install zsh -y
sudo apt-get install -y util-linux -y
chsh -s $(which zsh)
@andrey-zh
andrey-zh / install-oh-my-zsh.sh
Created April 5, 2022 19:59 — forked from hewerthomn/install-oh-my-zsh.sh
Offline install of oh-my-zsh on Ubuntu
main() {
# Use colors, but only if connected to a terminal, and that terminal
# supports them.
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
@andrey-zh
andrey-zh / talos.sh
Last active March 30, 2022 08:00 — forked from vfarcic/161-talos.sh
[Install Talos]
# Source: https://gist.github.com/c7cdfef142bd65cc744789d3c1e90170
###########################################
# Talos Linux: OS Designed For Kubernetes #
# https://youtu.be/iEFb2Zg4xUg #
###########################################
# Additional Info:
# - Talos Linux: https://www.talos.dev/
# - How To Create, Provision, And Operate Kubernetes With Cluster API (CAPI): https://youtu.be/8yUDUhZ6ako
@andrey-zh
andrey-zh / dashboard.sh
Created February 28, 2022 13:05 — forked from jeremyje/dashboard.sh
Install Kubernetes
#!/bin/bash
# curl https://gist.githubusercontent.com/jeremyje/14e26148909734ebe1d6395cc8b0e156/raw/dashboard.sh | bash
# https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/
# https://github.com/kubernetes/dashboard
bash -c "cat >> dashboard.yaml" << EOF
apiVersion: v1
kind: ServiceAccount
metadata:
name: kubernetes-dashboard
@andrey-zh
andrey-zh / configure_k8s.sh
Created January 20, 2022 08:30 — forked from lucashalbert/configure_k8s.sh
Script to install and configure kubernetes on CentOS-7
#######################
# === All Systems === #
#######################
# Ensure system is fully patched
sudo yum -y makecache fast
sudo yum -y update
# Disable swap
sudo swapoff -a