Skip to content

Instantly share code, notes, and snippets.

View hroncok's full-sized avatar

Miro Hrončok hroncok

View GitHub Profile
@hroncok
hroncok / gitrmdeleted
Created January 7, 2013 21:42
Used for deleting (git rm) already deleted (rm) files. Added as git alias: rmdeleted = !gitrmdelted
#!/bin/bash
for FILE in `git status | grep deleted | awk '{print $3}'`; do
echo $FILE
git rm $FILE
done
exit $?
@hroncok
hroncok / subrnm
Last active December 10, 2015 18:58
Renames subtitles to video file name, use as a Custom action for Thunar
#!/bin/bash
# BSDL Miro Hrončok <miro@hroncok.cz>
# subrnm .avi .srt (or vice versa)
if [ $# -ne 2 ]; then
#echo "USAGE: subrnm .avi .srt (or vice versa)"
zenity --error --text "Nebyly vybrány dva soubory"
exit 1
fi
@hroncok
hroncok / volume
Last active December 4, 2021 11:38
PulseAudio volume command for key shortcuts
#!/usr/bin/env bash
export LANG=C.utf-8
SPEAKERS=alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink
MIC=alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_6__source
if [[ $1 == "+" ]]; then
# pacmd dump|awk --non-decimal-data '$1~/set-sink-volume/{system ("pacmd "$1" "$2" "$3+2000)}' > /dev/null
volume=$(pactl get-sink-volume $SPEAKERS | head -n1 | cut -f3 -d' ')
pactl set-sink-volume $SPEAKERS $(($volume+2000))
@hroncok
hroncok / mock-mirrorlist2baseurl
Last active June 30, 2017 20:22
This Bash script helps you to replace mirrorlist with baseurl in your mock config files. It selects the first item in the mirrorlist (should be good enough). To update the mirrors, revert config from backup (.bak) and run again.
#!/usr/bin/env bash
# Copyright (c) 2013, Miro Hrončok <miro@hroncok.cz>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,