Skip to content

Instantly share code, notes, and snippets.

@Staggerlee011
Staggerlee011 / wsl2-setup-config.ps1
Created December 14, 2020 15:04
wsl2-setup-config
## Enable hyper-v and wsl
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -NoRestart
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux -NoRestart
## Download distro of choice (https://docs.microsoft.com/en-us/windows/wsl/install-manual)
Invoke-WebRequest https://aka.ms/wsl-ubuntu-1804 -OutFile ubuntu-18-04.appx -UseBasicParsing
Add-AppxPackage .\ubuntu-18-04.appx
@Staggerlee011
Staggerlee011 / terraform-statefile-bucket.tf
Last active December 4, 2020 21:12
Terraform template to create a secure s3 bucket, dnamodb for state file
provider "aws" {
region = "eu-west-2"
profile = "xxx"
}
variable "env" {
description = "Name of AWS environment"
type = string
default = "xxx"
}
@Staggerlee011
Staggerlee011 / install
Last active April 17, 2020 21:14
ubunutu-install
# install brew
sudo apt install linuxbrew-wrapper
sudo apt install curl
## maunual download of chrome
## isntall vscode from snap
sudo apt install python3.8
sudo apt install python3-pip
@Staggerlee011
Staggerlee011 / ubuntu-install
Created April 2, 2020 19:50
ubuntu-install
# install brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
## install k8s tools
brew install stern
brew install kube-ps1
brew install kubectx
brew install derailed/popeye/popeye
brew install derailed/k9s/k9s
curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp
@Staggerlee011
Staggerlee011 / pg_admin
Created March 31, 2020 20:00
pg_admin container: http://localhost:65432/
docker pull dpage/pgadmin4
docker run -p 65432:80 -e '[email protected]' -e 'PGADMIN_DEFAULT_PASSWORD=SuperSecret' -d dpage/pgadmin4
@Staggerlee011
Staggerlee011 / k8s-cheatsheet
Created March 6, 2020 20:35
k8s cheatsheet
## testing with busybox (runs interactive shell in busybox pod in your namespace. dies on exit.)
kubectl run -i --tty busybox --image=busybox --restart=Never -- sh
### in busybox command prompt you can test mysql connection with
<servicename> <seriveport>
# scripts to build a dockerfile
docker build myapp:v2 .
@Staggerlee011
Staggerlee011 / docker-compose
Last active February 18, 2020 15:10
docker-compose cheatsheet
## run a docker-compose
docker-compose up
## run specific file
docker-compose -f /tests/docker-compose.yml up
## run detatched
docker-compose up -d
## run a single container from the docker-compose
## Primary Desktop Apps
sudo su -
#updates
zypper update
## zypper --non-interactive install PACKAGE_NAME
# power management tools
@Staggerlee011
Staggerlee011 / Azure-DevOps-BuildTemplate-Folder-Example
Created June 3, 2019 09:17
Azure DevOps - Build - Calling a template in a folder
resources:
repositories:
- repository: templates #Name of repo
type: git
name: templates
jobs:
- template: terraform/azureterraform.yml@templates # Name of folder (Terraform in the example) and name of file (azureterraform.yml in the example)