All gists

jackz
Last active 9 hours ago

https://unix.stackexchange.com/questions/587646/how-to-get-the-total-duration-of-all-video-files-in-current-folder-and-sub-direc

0 0 1
1 # Recursive all files in dir
2 exiftool -ext mp4 -r -n -q -p '${Duration;$_ = ConvertDuration(our $total += $_)}' . | tail -n 1
3
4 # More control
5 # calc-durs Replay_* - all files matching glob in single folder only
6 # calc-durations -r Replay_* - recursive in all folders
7 calc-durs() {
8 local -a files
9 if [[ "$1" == "-r" ]]; then
10 shift
jackz
Last active 3 months ago
0 0 1
1 rename table stats_games to stats_sessions;
2 create table stats_games
3 (
4 id int unsigned auto_increment primary key,
5 uuid uuid default uuid() not null comment 'legacy campaignID' unique,
6 date_start bigint not null comment 'unix timestamp',
7 date_start_finale int null comment 'unix timestamp of finale',
8 date_end bigint null comment 'unix timestamp',
9 duration_game bigint as (`date_end` - `date_start`) comment 'seconds of game',
10 duration_finale bigint as (`date_end` - `date_start_finale`) comment 'seconds of finale',
jackz
Last active 3 months ago ntfy template
0 0 1
1 title: |
2 {{- if and .run.workflow_id (eq .action "success") }}
3 ✅ Workflow {{ .run.workflow_id }} success in {{ .run.repository.name }}
4
5 {{- else if and .run.workflow_id (eq .action "failure") }}
6 ❌ Workflow {{ .run.workflow_id }} failed in {{ .run.repository.name }}
7
8 {{- else if and .run.workflow_id (eq .action "recover") }}
9 ℹ️ Workflow {{ .run.workflow_id }} recovered in {{ .run.repository.name }}
10