Skip to content

Instantly share code, notes, and snippets.

View Piotr1215's full-sized avatar
🐺

Piotr Zaniewski Piotr1215

🐺
View GitHub Profile
@Piotr1215
Piotr1215 / create-delete-rg.sh
Created July 21, 2021 19:14
Create or Delete Azure Resource Group
#!/bin/bash
# Setup variables
group='rg-unique-name'
location='rg-location'
groupExists=$(az group exists -n $group)
if $groupExists; then
echo 'Group' $group 'already exists'
Link Description
Azure Services Overview Overview of Azure services. Linked directly to Azure Service 360° for service summary information.
Azure Heat Map See what services have changed recently
Azure Learning Explorer Select service(s) and get list of available trainings on Azure Learn
Azure Latency Test latency for selected regions and more
Azure DevOps Demo Generator Create automated azure DevOps environments for learning/testing
Azure Tips and Tricks A very informative blog all things Azure
Azure VM Comparison Prices Compare VM prices in Azure, API updated
[Azure Pricing Calculator](https://azure.microsoft.com/e
@Piotr1215
Piotr1215 / tmux-cheatsheet.md
Created June 21, 2021 18:09 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@Piotr1215
Piotr1215 / .gitignore
Last active January 31, 2022 22:12
Vim Commands
*swp
curl -sfL https://get.k3s.io | K3S_KUBECONFIG_MODE="644" INSTALL_K3S_VERSION="v1.21.1+k3s1" sh -
kubectl apply -f https://raw.githubusercontent.com/Piotr1215/dca-exercises/master/k8s/deployment/1-create-deployment.yaml
kubectl scale deployment nginx-test --replicas 5
kubectl expose deployment.app/nginx-test --port 80 --target-port 80 --type NodePort --name nginxsvc
# Create server and agent machines
multipass launch --name k3s-server --cpus 1 --mem 1024M --disk 10G
multipass launch --name k3s-agent --cpus 1 --mem 1024M --disk 15G
# Install k3s on the server vm
multipass exec k3s-server -- /bin/bash -c "curl -sfL https://get.k3s.io | K3S_KUBECONFIG_MODE="644" sh -"
# Obtain token form the server
K3S_TOKEN=$(multipass exec k3s-server -- /bin/bash -c "sudo cat /var/lib/rancher/k3s/server/node-token")
echo $K3S_TOKEN
sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target
sudo vim /etc/systemd/logind.conf
# Replace whatever values of following to "ignore"
HandleHibernateKey=ignore
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore