Skip to content

Instantly share code, notes, and snippets.

View rvm_z_nave_automated.sh
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() {
View remove_docker_untagged_images.sh
#!/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
@aperezm-vlex
aperezm-vlex / kodi.sh
Last active Feb 13, 2020
Raspbian: Avoid black screen on kodi exit
View kodi.sh
#!/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
You can’t perform that action at this time.