Skip to content

Instantly share code, notes, and snippets.

@aperezm-vlex
aperezm-vlex / kodi.sh
Last active February 23, 2021 19:00
Raspbian: Avoid black screen on kodi exit
#!/bin/bash
LOG_FILE=$HOME/.kodi/temp/kodi.log
rm $LOG_FILE 2> /dev/null
/usr/lib/kodi/kodi.bin --standalone &
while [[ ! -f $LOG_FILE ]] ; do
sleep 1s
@aperezm-vlex
aperezm-vlex / rvm_z_nave_automated.sh
Created February 16, 2017 15:23
rvm, z and nave automated
rename_function() {
declare -F $1 > /dev/null || return 1
eval "$(echo "${2}()"; declare -f ${1} | tail -n +2)"
}
if [[ $(type -t old_cd) == "function" ]]; then
echo "old_cd already exists" > /dev/null
elif [[ $(type -t cd) == "function" ]]; then
rename_function cd old_cd
cd() {
@aperezm-vlex
aperezm-vlex / remove_docker_untagged_images.sh
Created May 24, 2016 10:47
Remove untagged docker images
#!/bin/bash
removeDockerImages () {
docker rmi $(docker images | grep "^<none>" | awk '{print $3}')
}
containersToRemove=$(removeDockerImages 2>&1 | grep "image is being used by stopped container" | sed 's/.*image is being used by stopped container//g')
if [[ ${#containersToRemove} > 0 ]]; then