Removed unused software

Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
Tuan-Dat Tran
2024-03-15 16:39:01 +01:00
parent 5f3703da07
commit 4be55c69b4
9 changed files with 0 additions and 1000 deletions

View File

@@ -1,7 +0,0 @@
#!/usr/bin/env nu
let filename = (date now | date format "%s")
while 1 == 1 {
(sudo tlp-stat -b | grep Charge | split column '=' | str trim ) | insert a (date now | date format "%s") | reject column1 | rename Charge Timestamp | to csv -n | str replace " \\[%\\]" "" | save -a $"($filename).csv";
sleep 50ms;
}

View File

@@ -1,17 +0,0 @@
# clean-nushell-db
#!/usr/bin/env nu
let db = "~/dotfiles/nushell/.config/nushell/history.sqlite3"
def get_current_row [] {
let current_row = (^sqlite3 $db "SELECT COUNT(*) FROM history h")
echo $"current rows: ($current_row)"
}
get_current_row
# Remove failed commands
sqlite3 $db "DELETE FROM history WHERE exit_status != 0"
# Remove duplicates. But keep one.
# https://stackoverflow.com/a/53693544/6000005
sqlite3 $db "DELETE FROM history WHERE id NOT IN (SELECT MIN(id) FROM history h GROUP BY command_line);"
get_current_row