Skip to content

Instantly share code, notes, and snippets.

Petr Ruzicka ruzickap

Block or report user

Report or block ruzickap

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ruzickap
ruzickap / aws_create_site.yml
Created Feb 16, 2017
Ansible playbook which creates instances and tag volumes
View aws_create_site.yml
---
- name: Create Instance in AWS
hosts: localhost
connection: local
gather_facts: false
vars:
aws_access_key: "xxxxxx"
aws_secret_key: "xxxxxx"
security_token: "xxxxxx"
@ruzickap
ruzickap / check_urls.sh
Last active Feb 2, 2020
Automatically check links on web pages
View check_urls.sh
git clone git@github.com:ruzickap/check_urls.git
cd check_urls
mkdir -p .github/workflows
cat > .github/workflows/periodic-broken-link-checks.yml << \EOF
name: periodic-broken-link-checks
on:
schedule:
- cron: '0 0 * * *'
@ruzickap
ruzickap / openwrt_wireless.sh
Created Apr 6, 2014
OpenWrt WiFi configuration tweaks
View openwrt_wireless.sh
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 / headphones.sh
Created Mar 22, 2018
Short script which will move all audio (in/out)put to the USB Headphones
View headphones.sh
#!/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 / openwrt_guest_wifi.sh
Created May 2, 2014
OpenWrt - Guest WiFi configuration
View openwrt_guest_wifi.sh
uci set network.wifi_open=interface
uci set network.wifi_open.type=bridge
uci set network.wifi_open.proto=static
uci set network.wifi_open.ipaddr=10.0.0.1
uci set network.wifi_open.netmask=255.255.255.0
uci add wireless wifi-iface
uci set wireless.@wifi-iface[-1].device=radio0
uci set wireless.@wifi-iface[-1].mode=ap
uci set wireless.@wifi-iface[-1].ssid=medlanky.xvx.cz
@ruzickap
ruzickap / f5_init.sh
Created Dec 23, 2014
BIGIP F5 initial configuration
View f5_init.sh
#(root / default)
tmsh modify sys global-settings mgmt-dhcp disabled
tmsh create sys management-ip 10.0.0.224/255.255.255.0
tmsh create sys management-route default gateway 10.0.0.1
#(or you can use "config" command - to speed it up)
#DNS
tmsh modify sys dns name-servers add { 10.0.0.141 10.0.0.142 }
tmsh modify sys dns search add { cloud.example.com }
@ruzickap
ruzickap / git-repository-gpg-crypt
Created Nov 1, 2019
Make git repository encrypted with generated GPG key which can be used by CI/CD to access the git repo when using GitHub Actions
View git-repository-gpg-crypt
# 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
View kubernetes_notes.sh
# Connect to PostgreSQL database internally
kubectl run -i --tty --rm psql --image=postgres --env "PGPASSWORD=user_password" --command -- \
psql -U myuser -h patroni.patroni.svc.cluster.local my_database
# Port forwarding to service
kubectl port-forward -n harbor service/harbor 8080:443
@ruzickap
ruzickap / xmp_darktable_raw_decode.sh
Last active Aug 27, 2019
Decode RAW files form camera using darktable-cli + XMP to JPEG
View xmp_darktable_raw_decode.sh
#!/bin/bash -eu
for XMP_FILE in *.xmp; do
RAW_FILE=`awk -F \" '/xmpMM:DerivedFrom=/ { print $2 }' $XMP_FILE`
RAW_FILE_NAME="${XMP_FILE%.*}"
FILE_NAME="${RAW_FILE%.*}"
echo "*** $XMP_FILE [$RAW_FILE] [$FILE_NAME]"
if [ "$RAW_FILE_NAME" != "$RAW_FILE" ]; then
@ruzickap
ruzickap / ovftool_installation.sh
Created Sep 27, 2014
OVFTool installation on ESXi
View ovftool_installation.sh
#Download OVF tools
wget -q ftp://ftp.example.com/software/vmware/installation_scripts/vmware-ovftool.tar.gz -O /vmfs/volumes/My_Datastore/vmware-ovftool.tar.gz
# Extract ovftool content to /vmfs/volumes/My_Datastore
tar -xzf /vmfs/volumes/My_Datastore/vmware-ovftool.tar.gz -C /vmfs/volumes/My_Datastore/
rm /vmfs/volumes/My_Datastore/vmware-ovftool.tar.gz
# Modify the ovftool script to work on ESXi
sed -i 's@^#!/bin/bash@#!/bin/sh@' /vmfs/volumes/My_Datastore/vmware-ovftool/ovftool
You can’t perform that action at this time.