Skip to content

Instantly share code, notes, and snippets.

View ruzickap's full-sized avatar

Petr Ruzicka ruzickap

View GitHub Profile
@ruzickap
ruzickap / openwrt_wireless.sh
Created April 6, 2014 16:55
OpenWrt WiFi configuration tweaks
uci set wireless.radio0.channel=8
uci set wireless.radio0.htmode=HT40-
uci set wireless.radio0.noscan=1
uci set wireless.radio0.bursting=1
uci set wireless.radio0.ff=1
uci set wireless.radio0.compression=1
uci set wireless.radio0.xr=1
uci set wireless.radio0.ar=1
uci set wireless.radio0.txpower=20
@ruzickap
ruzickap / git-repository-gpg-crypt
Created November 1, 2019 15:54
Make git repository encrypted with generated GPG key which can be used by CI/CD to access the git repo when using GitHub Actions
# Make sure you are using gpg2
git config --global gpg.program gpg2
# Clone empty repository
git clone git@github.com:ruzickap/terraform-gitops.git
# Configure a repository to use git-crypt
cd terraform-gitops
git-crypt init
@ruzickap
ruzickap / kops-ubuntu.sh
Last active November 25, 2023 09:19
Deploy k8s cluster with Ubuntu nodes using kops
#!/usr/bin/env bash
export CLUSTER_FQDN="${CLUSTER_FQDN:-ruzickap-kops-ubuntu.k8s.mylabs.dev}"
export AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION:-eu-central-1}"
export KUBECONFIG="/tmp/kubeconfig-${CLUSTER_FQDN}.conf"
export KOPS_STATE_STORE="s3://${CLUSTER_FQDN}"
set -euxo pipefail
## Create S3 bucket first
@ruzickap
ruzickap / eksctl.sh
Last active November 24, 2023 19:58
Create Amazon EKS cluster using eksctl
#!/bin/bash -eux
export CLUSTER_NAME="${CLUSTER_NAME:-ruzickap}"
export AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION:-eu-central-1}"
export KUBECONFIG="/tmp/kubeconfig-${CLUSTER_NAME}.conf"
export TAGS="Owner=petr.ruzicka@gmail.com Environment=dev Group=Cloud_Native Squad=Cloud_Container_Platform"
set -euxo pipefail
@ruzickap
ruzickap / win7-admin.bat
Last active October 18, 2023 02:47
win7 customization file. Run right after you first log in as administrator.
:: Tested on Windows 7
@echo.
@echo Test connection settings
powershell -command "$client = new-object System.Net.WebClient; $client.DownloadFile('http://www.google.com', 'c:\del')"
if %ERRORLEVEL% NEQ 0 (
@echo Can not download files form Internet !!!
pause
exit
@ruzickap
ruzickap / eksctl-cilium.sh
Last active September 14, 2023 10:47
Install Amazon EKS cluster with Cilium CNI using eksctl
#!/usr/bin/env bash
export CLUSTER_NAME="${USER}-cilium"
export AWS_DEFAULT_REGION="eu-central-1"
export KUBECONFIG="/tmp/kubeconfig-${CLUSTER_NAME}.conf"
export TAGS="Owner=petr.ruzicka@gmail.com Environment=dev"
set -euxo pipefail
@ruzickap
ruzickap / eksctl-calico.sh
Created March 27, 2023 15:39
Deploy Amazon EKS with Calico
#!/usr/bin/env bash
export CLUSTER_NAME="ruzickap-calico"
export AWS_DEFAULT_REGION="eu-central-1"
export KUBECONFIG="/tmp/kubeconfig-${CLUSTER_NAME}.conf"
export TAGS="Owner=petr.ruzicka@gmail.com Environment=dev"
set -euxo pipefail
@ruzickap
ruzickap / headphones.sh
Created March 22, 2018 09:48
Short script which will move all audio (in/out)put to the USB Headphones
#!/bin/bash -eux
HEADSET="alsa_output.usb-Logitech_Logitech_USB_Headset-00.analog-stereo"
HEADSET_MIC="alsa_input.usb-Logitech_Logitech_USB_Headset-00.analog-mono"
#pacmd list-sink-inputs
#pacmd list-source-outputs
pacmd stat | grep -E '^Default (sink|source) name'
@ruzickap
ruzickap / packer_qemu_windows_ansible_winrm.sh
Last active March 21, 2023 23:26
Quick and Dirty script building Windows using Packer + Ansible + WinRM on QEMU (libvirt)
#!/bin/bash -x
mkdir test
cd test
curl https://raw.githubusercontent.com/ruzickap/packer-templates/master/http/windows-server-2016/Autounattend.xml | sed '/.*Microsoft-Windows-PnpCustomizationsWinPE.*/,/component>/d' > Autounattend.xml
wget -c https://raw.githubusercontent.com/ruzickap/packer-templates/master/scripts/win-common/fixnetwork.ps1
test -f packer || ( wget https://releases.hashicorp.com/packer/1.2.0/packer_1.2.0_linux_amd64.zip && unzip packer_1.2.0_linux_amd64.zip && rm packer_1.2.0_linux_amd64.zip )
@ruzickap
ruzickap / aks.sh
Created March 15, 2023 07:44
Deploy Azure AKS
#!/usr/bin/env bash
export AZURE_LOCATION=westeurope
export CLUSTER_FQDN="ruzickap2aks.k8s.mylabs.dev"
# CLUSTER_NAME must have max 12 character due to "--nodepool-name" parameter
export CLUSTER_NAME="${CLUSTER_FQDN%%.*}"
export KUBECONFIG="/tmp/kubeconfig-${CLUSTER_NAME}.conf"
set -euxo pipefail