This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -x BW_USER '<YOUR-USER>' | |
function bw | |
set bw_exec (which bw) | |
set -x NODE_OPTIONS --no-deprecation | |
set -g bw_session_file '/var/root/.bitwarden.session' | |
set -g err_token_not_found "Token not found, please run bw --regenerate-session-key" | |
function _read_token_from_file | |
switch $argv[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TOP=$(journalctl -u endlessh.service | grep "time=" | awk '{split($11, time, "="); split($8, ip, ":"); print ip[4], time[2]}' | awk '{arr[$1]+=$2} END {for (i in arr) {print i,arr[i]}}' | sort -n -k2) | |
format_duration() { | |
local seconds=$(printf "%.3f" $1) # Convert seconds to 3 decimal places | |
local milliseconds=$(echo "scale=0; $seconds * 1000" | bc) # Convert seconds to milliseconds | |
local milliseconds=${milliseconds%.*} # Remove decimal part | |
# Calculate days, hours, minutes, and seconds |