Skip to content

Instantly share code, notes, and snippets.

@JackPoint
JackPoint / mute_media_player_on_call.yaml
Last active December 8, 2022 18:13
HomeAssistant Blueprint - Mute media player when phone rings or is calling. Only when person is home and the mediaplayer is playing.
blueprint:
name: Mute mediaplayer when calling.
description: >
Mute a mediaplayer when phone rings or is calling.
Only when person is home and the mediaplayer is playing.
domain: automation
input:
phone_state:
name: Phone State sensor
description: All sensors form the mobile app. Select the phone state sensor here.
@JackPoint
JackPoint / gist:5983128
Created July 12, 2013 09:33
Remove old DirectAdmin system backups
find /backup -mtime +7 -type d -depth -exec rm -r {} \;
@JackPoint
JackPoint / gist:5983099
Created July 12, 2013 09:25
Find large files
find / -type f -size +10000k -exec ls -lh {} \; | awk '{print $5 ": " $NF}'
@JackPoint
JackPoint / gist:5650323
Last active December 17, 2015 17:59
Laravel remove trailing slash
Route::get('{any}', function($url){
return Redirect::to(mb_substr($url, 0, -1), 301);
})->where('any', '(.*)\/$');