mirror of
https://github.com/Steffo99/config-fish.git
synced 2024-12-22 14:54:23 +00:00
Add some random stuff
This commit is contained in:
parent
78ef972de7
commit
ddac797bbf
5 changed files with 62 additions and 3 deletions
3
functions/btm.fish
Normal file
3
functions/btm.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function btm --description 'alias btm btm --enable_gpu_memory'
|
||||||
|
command btm --enable_gpu_memory $argv;
|
||||||
|
end
|
20
functions/dalle.fish
Normal file
20
functions/dalle.fish
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
function dalle
|
||||||
|
set base_url "https://api.openai.com"
|
||||||
|
|
||||||
|
set response (curl --silent "$base_url/v1/images/generations" -H 'Content-Type: application/json' -H "Authorization: Bearer $OPENAI_API_KEY" -d '{"n": 1, "size": "1024x1024", "prompt":"'$argv[1]'"}')
|
||||||
|
|
||||||
|
echo "$response" | jq
|
||||||
|
|
||||||
|
set error (echo "$response" | jq '.error')
|
||||||
|
|
||||||
|
if test "$error" != "null"
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
|
set timestamp (echo "$response" | jq --raw-output '.created')
|
||||||
|
set image_url (echo "$response" | jq --raw-output '.data[0].url')
|
||||||
|
|
||||||
|
set output "/home/steffo/Pictures/DALL·E²/$timestamp - "$argv[1]".png"
|
||||||
|
wget --quiet --output-document="$output" "$image_url"
|
||||||
|
open "$output" > /dev/null 2> /dev/null
|
||||||
|
end
|
|
@ -1,11 +1,11 @@
|
||||||
function discord_export
|
function discord_export
|
||||||
if test -z "$DISCORD_TOKEN_BOT"
|
if test -z "$DISCORD_TOKEN"
|
||||||
echo_error "\$DISCORD_TOKEN_BOT is not set."
|
echo_error "\$DISCORD_TOKEN is not set."
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
set channels "--channel "$argv
|
set channels "--channel "$argv
|
||||||
set channels (string split -- " " "$channels")
|
set channels (string split -- " " "$channels")
|
||||||
|
|
||||||
discord-chat-exporter-cli export --bot $channels
|
discord-chat-exporter-cli export --bot --token $DISCORD_TOKEN $channels
|
||||||
end
|
end
|
||||||
|
|
33
functions/redocker.fish
Normal file
33
functions/redocker.fish
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
function redocker
|
||||||
|
set project (docker compose config --format json | jq .name)
|
||||||
|
|
||||||
|
echo_progress "Pulling images used by "
|
||||||
|
echo_highlight "$project"
|
||||||
|
echo_progress "..."
|
||||||
|
echo
|
||||||
|
docker compose pull
|
||||||
|
|
||||||
|
echo_progress "Building images using by "
|
||||||
|
echo_highlight "$project"
|
||||||
|
echo_progress "..."
|
||||||
|
echo
|
||||||
|
docker compose build
|
||||||
|
|
||||||
|
echo_progress "Taking down "
|
||||||
|
echo_highlight "$project"
|
||||||
|
echo_progress "..."
|
||||||
|
echo
|
||||||
|
docker compose down
|
||||||
|
|
||||||
|
echo_progress "Bringing up "
|
||||||
|
echo_highlight "$project"
|
||||||
|
echo_progress "..."
|
||||||
|
echo
|
||||||
|
docker compose up -d
|
||||||
|
|
||||||
|
echo_progress "Opening logs of "
|
||||||
|
echo_highlight "$project"
|
||||||
|
echo_progress "..."
|
||||||
|
echo
|
||||||
|
docker compose logs -f
|
||||||
|
end
|
3
functions/telegram-emoji.fish
Normal file
3
functions/telegram-emoji.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function telegram-emoji
|
||||||
|
magick -background none "$argv[1]" -resize "100x100^" -gravity "center" -extent "100x100" "$argv[1].telegram-emoji.png"
|
||||||
|
end
|
Loading…
Reference in a new issue