Skip to content

Instantly share code, notes, and snippets.

View ThanosDi's full-sized avatar

Thanos Di ThanosDi

View GitHub Profile
@ThanosDi
ThanosDi / toggle-audio-output.sh
Created June 22, 2022 14:02
Toggle audio output device
#!/bin/bash
# Execute manualy the command:
# $pactl list short sinks
# find your 2 device names
# and replace the names of the variables $output_device1 and $output_device2
# then run the script to switch between these 2 audio devices
# or even better use a keyboard shortcut.
output_device1="alsa_output.pci-0000_0a_00.1.hdmi-stereo-extra2"
@ThanosDi
ThanosDi / azure-docker-registry-delete-tags
Last active August 27, 2019 07:20
Mass delete azure docker repositories based on tag
# This will delete all tags starting with what you type in the tag. For example if you type v2 it will delete all tags v2.x.x
az acr repository show-tags -n <registry-name> --repository <repository-name> | grep \"<tag> | sed 's/,*$//g' | xargs -I X az acr repository delete -n <registry-name> --image <repository-name>:X --yes
#output
#This operation will delete the manifest 'sha256:xxxxxxxxxxxxx' and all the following images: '<repository-name>:v2.0.0-alpha'
#This operation will delete the manifest 'sha256:xxxxxxxxxxxxx' and all the following images: '<repository-name>:v2.1.0'
#This operation will delete the manifest 'sha256:xxxxxxxxxxxxx' and all the following images: '<repository-name>:v2.2.0'
#This operation will delete the manifest 'sha256:xxxxxxxxxxxxx' and all the following images: '<repository-name>:v2.3.0'
#This operation will delete the manifest 'sha256:xxxxxxxxxxxxx' and all the following images: '<repository-name>:v2.4.0'
#This operation will delete the manifest 'sha256:xxxxxxxxxxxxx' and all the f
@ThanosDi
ThanosDi / toggle-monitor.sh
Last active May 15, 2019 09:38
Turn off or on your second monitor. Second monitor assume its on the right of your main monitor.
#!/bin/bash
monitors=`xrandr --listactivemonitors | head -n1 | cut -d " " -f 2`
if [ "$monitors" == 1 ]
then
`xrandr --output DVI-I-1 --right-of DP-2 --auto` #change DVI-I-1 to your monitor connection running `xrandr`
else
`xrandr --output DVI-I-1 --off` #change DVI-I-1 to your monitor connection running `xrandr`
fi