Compare commits
127 Commits
master
...
109e1a3cf4
| Author | SHA1 | Date | |
|---|---|---|---|
| 109e1a3cf4 | |||
| 5ddad72e69 | |||
| a9f4ac8d5d | |||
| 70f8090ec3 | |||
| b4b145998a | |||
| f5f78941c4 | |||
| bdfbd4419b | |||
| 769d114c86 | |||
| ba234a0dad | |||
| 70db551648 | |||
| db7a01f58e | |||
| 514dd44858 | |||
|
|
ccd61e553d | ||
| 2950c3df5c | |||
| da7ddfffb2 | |||
| cbd4e310e5 | |||
| 79c84b3eda | |||
| 79f0de702c | |||
| ff47473e0b | |||
| 7fa5fccedf | |||
| 93cc71411e | |||
| 3fb51b141d | |||
| 42e5a4e97a | |||
| 925dc2edb6 | |||
| 99b38f2872 | |||
| c5f8e3a21a | |||
| 755a02ac7a | |||
| 97112a5757 | |||
| 61de34fdb4 | |||
| 1ff4285cb5 | |||
| ea5b5126b6 | |||
| f43b2a2831 | |||
| 799387d91a | |||
| 9e332f7980 | |||
| fc1c304fdc | |||
|
|
02867aa246 | ||
|
|
f02c1cfbc7 | ||
|
|
44305865c9 | ||
|
|
3276d2aea3 | ||
|
|
5de841dda1 | ||
| ce5fb472d8 | |||
| e8d63cba72 | |||
| 0145882277 | |||
| 65dda2592a | |||
| f287a420c7 | |||
| 6d8bc3ec6b | |||
| b98177ef19 | |||
| 16c4cc9094 | |||
| 5a016d14ed | |||
|
|
829579ca90 | ||
| 74f1200c25 | |||
| 7737d68812 | |||
| 7f629e9b21 | |||
|
|
bf74b0e503 | ||
|
|
b6e12176a8 | ||
|
|
2c2479f0eb | ||
| d9375106a9 | |||
| dadc1433b5 | |||
| 9d17df58dc | |||
| f038875e1f | |||
| 855f669156 | |||
| 9c973380a1 | |||
| 04707c30c4 | |||
| a5ae3e496d | |||
| 1097d2947c | |||
| 3fd11f6524 | |||
| 38e6172d28 | |||
| f8cc38f5f0 | |||
| 5899239d7a | |||
| 923933a54e | |||
| ca14386132 | |||
| 8f77766ed6 | |||
| 665b9cc70b | |||
| bc9f171b94 | |||
| 69f610d776 | |||
| 7d25702d0d | |||
| e09f2cf730 | |||
| 093e29974c | |||
|
|
cb9ce1ce59 | ||
|
|
e70814accb | ||
|
|
34066227cc | ||
|
|
956f0fe231 | ||
|
|
cce09ab331 | ||
|
|
1c813a245c | ||
|
|
d5b7ff4dff | ||
|
|
3af68cdb8f | ||
|
|
1573eb4ce9 | ||
|
|
77f9458afb | ||
|
|
048b599636 | ||
|
|
1500a9f113 | ||
|
|
6f878edfe2 | ||
|
|
7b65517b06 | ||
|
|
58ebab4af2 | ||
|
|
a1aeef95c8 | ||
|
|
06c19651c0 | ||
|
|
e6121a2063 | ||
|
|
bf7e602d40 | ||
|
|
dbd0a31e3e | ||
|
|
61100c2321 | ||
|
|
feee3c0476 | ||
|
|
75c0464459 | ||
|
|
6f7fba09c7 | ||
|
|
9738f5facc | ||
|
|
f8b8d73a9f | ||
|
|
ace195d48e | ||
|
|
c5299b6d27 | ||
|
|
ae407bdff2 | ||
|
|
4d233a68a2 | ||
|
|
f8ef62623b | ||
|
|
594e40f661 | ||
|
|
dc30aa2f54 | ||
|
|
f422dcd8c7 | ||
|
|
da036dd7ee | ||
|
|
a504367cc3 | ||
|
|
2149d47aab | ||
|
|
84a3080a18 | ||
|
|
45a06d4f52 | ||
|
|
096c097f36 | ||
|
|
681fb493f7 | ||
|
|
3dbb02f338 | ||
|
|
b521468ae5 | ||
|
|
2b1eaa2c39 | ||
|
|
4a59e1b816 | ||
|
|
43f9c9d6e8 | ||
|
|
dd53257e10 | ||
|
|
6d977e397f | ||
|
|
b936d6c24f |
122
.bash_aliases
122
.bash_aliases
@@ -5,7 +5,7 @@ fi
|
||||
|
||||
# Application management
|
||||
case "$ID" in
|
||||
ubuntu|debian|pop)
|
||||
ubuntu|debian)
|
||||
# Install something bypassing the prompts
|
||||
alias inst='sudo apt-get install -y'
|
||||
# Do a basic update
|
||||
@@ -59,9 +59,10 @@ case "$ID" in
|
||||
# Add any other distribution-specific aliases here
|
||||
;;
|
||||
esac
|
||||
|
||||
# General
|
||||
# Get $HOME quick
|
||||
alias ~='cd $HOME;clear'
|
||||
alias ~='cd ~/;clear'
|
||||
# A Nice display of all files in a directory
|
||||
alias ll='ls -hog'
|
||||
# Above but...different I'm sure
|
||||
@@ -77,13 +78,14 @@ alias fucking='sudo'
|
||||
# Install bat. It's better.
|
||||
alias cat='bat'
|
||||
# Source this very file
|
||||
alias src='source $HOME/.bashrc'
|
||||
alias src='source ~/.bashrc'
|
||||
# Big Boy edit something
|
||||
alias svim='sudo vim'
|
||||
# Ping but with sounds
|
||||
alias ding='ping -i 5 -a'
|
||||
# An extremely useful benchmark script
|
||||
alias yabs='curl -sL yabs.sh | bash'
|
||||
|
||||
# Utilities
|
||||
# A faster way to do the thing it does
|
||||
alias sysres='sudo systemctl restart'
|
||||
@@ -91,22 +93,52 @@ alias sysres='sudo systemctl restart'
|
||||
alias sysup='sudo systemctl enable --now'
|
||||
# Also this one
|
||||
alias sysdn='sudo systemctl disable --now'
|
||||
|
||||
#opens specified command in new window in screen session
|
||||
alias s='screen -X screen '
|
||||
# Resume screen or create a new one named main
|
||||
alias scr='screen -r || screen -S main'
|
||||
# press enter to continue. Occasionally useful
|
||||
alias cnfrm='read -p "Press enter to proceed" '
|
||||
|
||||
# A more intense ping for the professional on the go
|
||||
alias pang='ping -i 10 -v -a'
|
||||
# List the mounted things
|
||||
alias mnts='mount | column -t'
|
||||
# The history command but shorter
|
||||
alias h='history'
|
||||
|
||||
# Lazy docker composing. Set the variable somewhere.
|
||||
alias doco="$DOCKER_COMPOSE_COMMAND"
|
||||
alias redoco="$DOCKER_COMPOSE_COMMAND down && $DOCKER_COMPOSE_COMMAND up -d"
|
||||
alias redog="$DOCKER_COMPOSE_COMMAND down && $DOCKER_COMPOSE_COMMAND up -d; $DOCKER_COMPOSE_COMMAND logs -f"
|
||||
alias dolog="$DOCKER_COMPOSE_COMMAND up -d; $DOCKER_COMPOSE_COMMAND logs -f"
|
||||
alias watchtower="docker run -d --restart unless-stopped --name 'watch-$(date +%H%M)' -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower "
|
||||
alias onetower="docker run --rm -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower --run-once"
|
||||
# Regain all that space taken up by projects you abandoned
|
||||
alias docprune='echo "Pruning images"; docker image prune -f && echo "Pruning networks"; docker network prune -f && echo "Pruning containers"; docker container prune -f && echo "Pruning Volumes"; docker volume prune -f'
|
||||
# Send things instantly to a pastebin. Pipe other commands into this to share their output.
|
||||
alias bin='nc termbin.com 9999'
|
||||
# Quicker Docker exec
|
||||
alias dex='docker exec'
|
||||
alias dps="docker ps --format 'CONTAINER ID: {{.ID}}\nIMAGE: {{.Image}}\nCOMMAND: {{.Command}}\nCREATED: {{.CreatedAt}}\nSTATUS: {{.Status}}\nPORTS: {{.Ports}}\nNAMES: {{.Names}}\n'|cat"
|
||||
alias lzd='docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -v ~/lzd:/.config/jesseduffield/lazydocker lazyteam/lazydocker'
|
||||
alias glance='docker run --rm -e TZ="${TZ}" -v /var/run/docker.sock:/var/run/docker.sock:ro -v /run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro --pid host --network host -it nicolargo/glances:latest-full'
|
||||
alias ytdlp='docker run --rm -v "/nasty/ytdl:/media" -it jauderho/yt-dlp:latest '
|
||||
# Misc
|
||||
# Get the weather. Put your location after the command
|
||||
alias wttr='ansiweather -u imperial -s false -l'
|
||||
alias wtr='curl -s "https://wttr.in/?format=%l:+%c+%t+%w+%p"'
|
||||
#Read the fucking manual
|
||||
rtfm() { help $@ || info $@ || man $@ || curl "http://cheat.sh/$@"; }
|
||||
# Get your public IP
|
||||
extip(){ ip=$(curl -s http://api.ipify.org);
|
||||
echo "Public IP address is $ip"
|
||||
}
|
||||
# Cheatsheet for linux commands
|
||||
ch() { curl "http://cheat.sh/$@"; }
|
||||
# You can go to noti.toad.city and generate your own code to get browser notifications. It's all explained there. You'll need to modify this value
|
||||
notica() { curl --data "d:$*" "https://noti.toad.city/?VFvu53" ; }
|
||||
|
||||
# A quick lil speedyboi
|
||||
alias speedTest='curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3 -'
|
||||
# If you're runnng my exact mastodon setup, this will be useful
|
||||
@@ -116,9 +148,81 @@ alias hackingtool='docker run -it --net=host --security-opt seccomp=unconfined -
|
||||
# Do you need to reboot? Find out here!
|
||||
alias needrs='[ -f /var/run/reboot-required ] && echo "You need to reboot"'
|
||||
alias gitgraph='git log --graph --oneline --decorate'
|
||||
## See open ports
|
||||
# Countdown Timer
|
||||
countdown() {
|
||||
start="$(( $(date '+%s') + $1))"
|
||||
while [ $start -ge $(date +%s) ]; do
|
||||
time="$(( $start - $(date +%s) ))"
|
||||
printf '%s\r' "$(date -u -d "@$time" +%H:%M:%S)"
|
||||
sleep 0.1
|
||||
done
|
||||
}
|
||||
# Random quote to avoid making useful commit messages
|
||||
function rgcm() {
|
||||
api="https://whatthecommit.com/index.txt"
|
||||
message=$(curl -s $api)
|
||||
if [[ -z $message ]]; then
|
||||
echo "Error: Failed to retrieve a random commit message"
|
||||
return 1
|
||||
fi
|
||||
git add .
|
||||
git commit -m "$message"
|
||||
echo "Git commit submitted with message: $message"
|
||||
}
|
||||
function cntdn() {
|
||||
local count=$1
|
||||
while [ $count -gt 0 ]; do
|
||||
echo -en "\n$count... "
|
||||
if [ $count -eq 3 ]; then
|
||||
echo "You've still got a few seconds to live it up before your time runs out!"
|
||||
elif [ $count -eq 2 ]; then
|
||||
echo "Tick-tock, tick-tock, time's running out!"
|
||||
elif [ $count -eq 1 ]; then
|
||||
echo "You had a good run, but it's time to face the music!"
|
||||
fi
|
||||
sleep 1
|
||||
((count--))
|
||||
done
|
||||
echo "Time's up!"
|
||||
}
|
||||
|
||||
function ramdisk() {
|
||||
if [ -z "$1" ]; then
|
||||
echo "Error: Ramdisk size not specified."
|
||||
return 1
|
||||
fi
|
||||
if [ ! -d "$HOME/ramdown" ]; then
|
||||
mkdir "$HOME/ramdown"
|
||||
fi
|
||||
|
||||
size="$1"
|
||||
|
||||
sudo mount -t tmpfs -o size="$size" tmpfs "$HOME/ramdown"
|
||||
}
|
||||
|
||||
ipin() {
|
||||
local ip=$1
|
||||
local endpoint="https://ipinfo.io"
|
||||
# Append IP to the endpoint if provided
|
||||
if [[ -n $ip ]]; then
|
||||
endpoint+="/$ip"
|
||||
fi
|
||||
endpoint+="/json?token=4ea2457429bf23"
|
||||
# Make the API call and prettify the JSON response
|
||||
curl -s "$endpoint" | jq .
|
||||
}
|
||||
# Tere function
|
||||
tere() {
|
||||
local result=$(command tere "$@")
|
||||
[ -n "$result" ] && cd -- "$result"
|
||||
}
|
||||
# Compress files. Like the name says.
|
||||
function compress_files() {
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: compress_files <archive_name.zip> <file1> <file2> ..."
|
||||
else
|
||||
zip -r "$1" "${@:2}"
|
||||
fi
|
||||
}
|
||||
# See open ports
|
||||
alias ports='netstat -tuln '
|
||||
# gping
|
||||
alias gping='docker run --rm -ti --network host ghcr.io/orf/gping'
|
||||
alias proxon='export ALL_PROXY=socks5://fatshark.duckdns.org:666; echo "IP: $(curl -s ifconfig.me)"'
|
||||
alias proxoff='unset ALL_PROXY; echo "IP: $(curl -s ifconfig.me)"'
|
||||
|
||||
21
.bash_docker
21
.bash_docker
@@ -1,21 +0,0 @@
|
||||
export DOCKER_COMPOSE_COMMAND="docker compose"
|
||||
|
||||
# Lazy docker composing. Set the variable somewhere.
|
||||
alias doco="$DOCKER_COMPOSE_COMMAND"
|
||||
alias redoco="$DOCKER_COMPOSE_COMMAND down && $DOCKER_COMPOSE_COMMAND up -d"
|
||||
alias redog="$DOCKER_COMPOSE_COMMAND down && $DOCKER_COMPOSE_COMMAND up -d; $DOCKER_COMPOSE_COMMAND logs -f"
|
||||
alias dolog="$DOCKER_COMPOSE_COMMAND up -d; $DOCKER_COMPOSE_COMMAND logs -f"
|
||||
alias dogs="$DOCKER_COMPOSE_COMMAND logs -f"
|
||||
alias watchtower="docker run -d --restart unless-stopped --name 'watch-$(date +%H%M)' -v /var/run/docker.sock:/var/run/docker.sock -v /etc/localtime:/etc/localtime:ro ghcr.io/nicholas-fedor/watchtower:latest --cleanup "
|
||||
alias watchonce="docker run -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/nicholas-fedor/watchtower:latest --run-once"
|
||||
alias onetower="docker run --rm -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/nicholas-fedor/watchtower:latest --run-once"
|
||||
alias docport='docker container ls --format "table {{.ID}}\t{{.Names}}\t{{.Ports}}" -a'
|
||||
|
||||
alias docprune='echo "Pruning images"; docker image prune -f && echo "Pruning networks"; docker network prune -f && echo "Pruning containers"; docker container prune -f && echo "Pruning Volumes"; docker volume prune -f' # Regain all that space taken up by projects you abandoned
|
||||
alias bin='nc termbin.com 9999' # Send things instantly to a pastebin. Pipe other commands into this to share their output.
|
||||
alias dex='docker exec' # Quicker Docker exec
|
||||
alias dps="docker ps --format 'CONTAINER ID: {{.ID}}\nIMAGE: {{.Image}}\nCOMMAND: {{.Command}}\nCREATED: {{.CreatedAt}}\nSTATUS: {{.Status}}\nPORTS: {{.Ports}}\nNAMES: {{.Names}}\n'|cat"
|
||||
alias lzd='docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -v ~/lzd:/.config/jesseduffield/lazydocker lazyteam/lazydocker'
|
||||
alias doctime="docker ps --format 'CONTAINER NAME: {{.Names}}\nUPTIME: {{.Status}}'|cat"
|
||||
alias glance='docker run --rm -e TZ="${TZ}" -v /var/run/docker.sock:/var/run/docker.sock:ro -v /run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro --pid host --network host -it nicolargo/glances:latest-full'
|
||||
alias ytdlp='docker run --rm -v /home/brad:/media -it --user 1000:1000 jauderho/yt-dlp:latest -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4"'
|
||||
@@ -1,90 +0,0 @@
|
||||
|
||||
#Read the fucking manual
|
||||
rtfm() { help $@ || info $@ || man $@ || curl "http://cheat.sh/$@"; }
|
||||
# Get your public IP
|
||||
extip(){ ip=$(curl -s http://api.ipify.org);
|
||||
echo "Public IP address is $ip"
|
||||
}
|
||||
|
||||
# Cheatsheet for linux commands
|
||||
ch() { curl "http://cheat.sh/$@"; }
|
||||
|
||||
# You can go to noti.toad.city and generate your own code to get browser notifications. It's all explained there. You'll need to modify this value
|
||||
notica() { curl --data "d:$*" "https://noti.toad.city/?VFvu53" ; }
|
||||
|
||||
# Countdown Timer
|
||||
countdown() {
|
||||
start="$(( $(date '+%s') + $1))"
|
||||
while [ $start -ge $(date +%s) ]; do
|
||||
time="$(( $start - $(date +%s) ))"
|
||||
printf '%s\r' "$(date -u -d "@$time" +%H:%M:%S)"
|
||||
sleep 0.1
|
||||
done
|
||||
}
|
||||
# Random quote to avoid making useful commit messages
|
||||
function rgcm() {
|
||||
api="https://whatthecommit.com/index.txt"
|
||||
message=$(curl -s $api)
|
||||
if [[ -z $message ]]; then
|
||||
echo "Error: Failed to retrieve a random commit message"
|
||||
return 1
|
||||
fi
|
||||
git add .
|
||||
git commit -m "$message"
|
||||
echo "Git commit submitted with message: $message"
|
||||
}
|
||||
function cntdn() {
|
||||
local count=$1
|
||||
while [ $count -gt 0 ]; do
|
||||
echo -en "\n$count... "
|
||||
if [ $count -eq 3 ]; then
|
||||
echo "You've still got a few seconds to live it up before your time runs out!"
|
||||
elif [ $count -eq 2 ]; then
|
||||
echo "Tick-tock, tick-tock, time's running out!"
|
||||
elif [ $count -eq 1 ]; then
|
||||
echo "You had a good run, but it's time to face the music!"
|
||||
fi
|
||||
sleep 1
|
||||
((count--))
|
||||
done
|
||||
echo "Time's up!"
|
||||
}
|
||||
|
||||
function ramdisk() {
|
||||
if [ -z "$1" ]; then
|
||||
echo "Error: Ramdisk size not specified."
|
||||
return 1
|
||||
fi
|
||||
if [ ! -d "$HOME/ramdown" ]; then
|
||||
mkdir "$HOME/ramdown"
|
||||
fi
|
||||
|
||||
size="$1"
|
||||
|
||||
sudo mount -t tmpfs -o size="$size" tmpfs "$HOME/ramdown"
|
||||
}
|
||||
|
||||
ipin() {
|
||||
local ip=$1
|
||||
local endpoint="https://ipinfo.io"
|
||||
# Append IP to the endpoint if provided
|
||||
if [[ -n $ip ]]; then
|
||||
endpoint+="/$ip"
|
||||
fi
|
||||
endpoint+="/json?token=4ea2457429bf23"
|
||||
# Make the API call and prettify the JSON response
|
||||
curl -s "$endpoint" | jq .
|
||||
}
|
||||
# Tere function
|
||||
tere() {
|
||||
local result=$(command tere "$@")
|
||||
[ -n "$result" ] && cd -- "$result"
|
||||
}
|
||||
# Compress files. Like the name says.
|
||||
function compress_files() {
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: compress_files <archive_name.zip> <file1> <file2> ..."
|
||||
else
|
||||
zip -r "$1" "${@:2}"
|
||||
fi
|
||||
}
|
||||
31
.bashrc
31
.bashrc
@@ -4,13 +4,8 @@
|
||||
alias sudo='sudo '
|
||||
|
||||
#what cd should do by default
|
||||
if command -v batcat &> /dev/null
|
||||
then
|
||||
alias cd='cd_func'
|
||||
alias bat='batcat '
|
||||
fi
|
||||
|
||||
|
||||
alias cd='cd_func'
|
||||
alias bat='batcat '
|
||||
cd_func ()
|
||||
{
|
||||
builtin cd "$@" && ls --color=auto --group-directories-first --format=single-column
|
||||
@@ -68,8 +63,7 @@ if [ -n "$force_color_prompt" ]; then
|
||||
fi
|
||||
|
||||
if [ "$color_prompt" = yes ]; then
|
||||
#PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
||||
PS1='\[\e]0;\u@\h: \w\a\]\[\033[;32m\]┌──(\[\033[1;34m\]\u\[\033[33m\]↳\[\033[35m\]\h\[\033[;32m\])-[\[\033[44;1;33m\]\w\[\033[;32m\]]\n\[\033[31m\]⇛\[\033[33m\]⇛\[\033[93;25m\]⇛\[\033[92m\]⇛\[\033[32m\]⇛\[\033[34m\]⇛\[\033[36m\]⇛ \[\033[0m\]'
|
||||
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
||||
else
|
||||
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
|
||||
fi
|
||||
@@ -134,12 +128,7 @@ fi
|
||||
if [ -f ~/.bashlocal ]; then
|
||||
. ~/.bashlocal
|
||||
fi
|
||||
if [ -f ~/.bash_docker ]; then
|
||||
. ~/.bash_docker
|
||||
fi
|
||||
if [ -f ~/.bash_functions ]; then
|
||||
. ~/.bash_functions
|
||||
fi
|
||||
|
||||
# enable programmable completion features (you don't need to enable
|
||||
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
||||
# sources /etc/bash.bashrc).
|
||||
@@ -176,14 +165,4 @@ extract () {
|
||||
}
|
||||
|
||||
export PATH="$HOME/.cargo/bin:$HOME/.local/bin:$PATH"
|
||||
export CDPATH=:..:$HOME:$HOME/dock:/dock
|
||||
alias colors='for x in {16..231}; do printf "\e[48;5;${x}m%03d\e[0m " $x; done'
|
||||
#fastfetch
|
||||
printf "\n%s %s | Load: %s | Uptime: %s\n" \
|
||||
"$(hostname -s)" \
|
||||
"$(date +%H:%M)" \
|
||||
"$(cut -d' ' -f1-3 /proc/loadavg)" \
|
||||
"$(uptime -p | sed 's/up //')"
|
||||
df -h . | awk 'NR==2{printf "Disk: %s free of %s\n",$4,$2}'
|
||||
curl -s "https://wttr.in/?format=%l:+%c+%t+%w+%p"
|
||||
echo
|
||||
export CDPATH=:..:~:~/dock:/dock
|
||||
|
||||
35
bashset.sh
Executable file → Normal file
35
bashset.sh
Executable file → Normal file
@@ -1,21 +1,16 @@
|
||||
#!/bin/bash
|
||||
echo $HOME/.bashrc
|
||||
ln -s $PWD/.bashrc $HOME/.bashrc
|
||||
echo "done"
|
||||
echo $HOME/.bash_aliases
|
||||
ln -s $PWD/.bash_aliases $HOME/.bash_aliases
|
||||
echo $HOME/.bash_docker
|
||||
ln -s $PWD/.bash_docker $HOME/.bash_docker
|
||||
echo "done"
|
||||
echo $HOME/.bash_functions
|
||||
ln -s $PWD/.bash_functions $HOME/.bash_functions
|
||||
echo "done"
|
||||
echo $HOME/.vimrc
|
||||
ln -s $PWD/.vimrc $HOME/.vimrc
|
||||
echo "done"
|
||||
echo $HOME/.bashlocal
|
||||
touch $HOME/.bashlocal
|
||||
echo "done"
|
||||
read -p "lol maybe it worked"
|
||||
source ~/.bashrc
|
||||
exit 0
|
||||
mv ~/.bashrc ~/.bashrc.bak
|
||||
ln -s .bashrc ~/.bashrc
|
||||
ln -s .bash_aliases ~/.bash_aliases
|
||||
touch ~/.bashlocal
|
||||
|
||||
echo "Would you like to intall the contents of the package list in the arch foler? (yes/no)"
|
||||
read answer
|
||||
|
||||
if [ "$answer" == "yes" ] || [ "$answer" == "y" ]; then
|
||||
echo "Fuck yeah"
|
||||
sudo pacman -S --needed $(\cat arch/pkglist.txt)
|
||||
else
|
||||
echo "Exiting the script."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
Starting Nmap 7.80 ( https://nmap.org ) at 2024-07-07 19:34 CDT
|
||||
@@ -1,3 +0,0 @@
|
||||
## These are my configs
|
||||
I usually just clone the repo into the home directory of whatever machine I'm on (`git clone https://git.toad.city/brad/configs`), `cd` into the project directory(`cd configs`), and make executable/execute the install script (`chmod +x bashset.sh; ./bashset.sh`)
|
||||
You could do something different. I don't actually care.
|
||||
37
transcribe.sh
Executable file
37
transcribe.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check if an argument was passed
|
||||
if [ $# -eq 0 ]
|
||||
then
|
||||
echo "Usage: $0 <audio file>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if the audio file exists
|
||||
if [ ! -f "$1" ]
|
||||
then
|
||||
echo "Error: File '$1' does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get the current date and time
|
||||
datetime=$(date +"%Y%m%d-%H%M%S")
|
||||
|
||||
# Determine the file extension
|
||||
extension="${1##*.}"
|
||||
|
||||
# Convert the audio file to text using Whisper
|
||||
response=$(curl -s \
|
||||
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
|
||||
-F "file=@$1" \
|
||||
-F "model=whisper-1" \
|
||||
-F "response_format=json" \
|
||||
https://api.openai.com/v1/audio/transcriptions)
|
||||
|
||||
# Extract the text from the response
|
||||
text=$(echo "$response" | jq -r '.text')
|
||||
|
||||
# Save the text to a file with a unique filename based on the date
|
||||
echo "$text" > "${datetime}.${extension}.txt"
|
||||
echo "Transcription saved to ${datetime}.${extension}.txt"
|
||||
|
||||
Reference in New Issue
Block a user