Compare commits
33 Commits
109e1a3cf4
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
348afcf4dd | ||
cc240f07c6 | |||
ea68950dc9 | |||
821e8fbb4d | |||
8c9b91199d | |||
|
c0ef1eb332 | ||
|
381432665c | ||
08c8f0f23a | |||
e457ffaf22 | |||
|
f8506e5b4a | ||
|
367e3fc605 | ||
|
8539770f5e | ||
|
db0503aa96 | ||
b56c020c9d | |||
621ddac333 | |||
|
ea829fbfa7 | ||
f15a7c68e1 | |||
|
762eeb5b6d | ||
0aa4567a6a | |||
9e87c7e514 | |||
5cf96c89fe | |||
1c996c5222 | |||
34f1a5451e | |||
bbe0b30222 | |||
ecece1433f | |||
3e8f348302 | |||
62d571987b | |||
123289a79b | |||
047c80ba7b | |||
d9620ec7bf | |||
99e7115039 | |||
40df316fc8 | |||
211b43e5ce |
123
.bash_aliases
123
.bash_aliases
@@ -5,7 +5,7 @@ fi
|
|||||||
|
|
||||||
# Application management
|
# Application management
|
||||||
case "$ID" in
|
case "$ID" in
|
||||||
ubuntu|debian)
|
ubuntu|debian|pop)
|
||||||
# Install something bypassing the prompts
|
# Install something bypassing the prompts
|
||||||
alias inst='sudo apt-get install -y'
|
alias inst='sudo apt-get install -y'
|
||||||
# Do a basic update
|
# Do a basic update
|
||||||
@@ -59,10 +59,9 @@ case "$ID" in
|
|||||||
# Add any other distribution-specific aliases here
|
# Add any other distribution-specific aliases here
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# General
|
# General
|
||||||
# Get $HOME quick
|
# Get $HOME quick
|
||||||
alias ~='cd ~/;clear'
|
alias ~='cd $HOME;clear'
|
||||||
# A Nice display of all files in a directory
|
# A Nice display of all files in a directory
|
||||||
alias ll='ls -hog'
|
alias ll='ls -hog'
|
||||||
# Above but...different I'm sure
|
# Above but...different I'm sure
|
||||||
@@ -75,17 +74,14 @@ alias gh='history|grep'
|
|||||||
alias please='sudo !!'
|
alias please='sudo !!'
|
||||||
# sometimes it feels good
|
# sometimes it feels good
|
||||||
alias fucking='sudo'
|
alias fucking='sudo'
|
||||||
# Install bat. It's better.
|
|
||||||
alias cat='bat'
|
|
||||||
# Source this very file
|
# Source this very file
|
||||||
alias src='source ~/.bashrc'
|
alias src='source $HOME/.bashrc'
|
||||||
# Big Boy edit something
|
# Big Boy edit something
|
||||||
alias svim='sudo vim'
|
alias svim='sudo vim'
|
||||||
# Ping but with sounds
|
# Ping but with sounds
|
||||||
alias ding='ping -i 5 -a'
|
alias ding='ping -i 5 -a'
|
||||||
# An extremely useful benchmark script
|
# An extremely useful benchmark script
|
||||||
alias yabs='curl -sL yabs.sh | bash'
|
alias yabs='curl -sL yabs.sh | bash'
|
||||||
|
|
||||||
# Utilities
|
# Utilities
|
||||||
# A faster way to do the thing it does
|
# A faster way to do the thing it does
|
||||||
alias sysres='sudo systemctl restart'
|
alias sysres='sudo systemctl restart'
|
||||||
@@ -93,52 +89,21 @@ alias sysres='sudo systemctl restart'
|
|||||||
alias sysup='sudo systemctl enable --now'
|
alias sysup='sudo systemctl enable --now'
|
||||||
# Also this one
|
# Also this one
|
||||||
alias sysdn='sudo systemctl disable --now'
|
alias sysdn='sudo systemctl disable --now'
|
||||||
|
|
||||||
#opens specified command in new window in screen session
|
#opens specified command in new window in screen session
|
||||||
alias s='screen -X screen '
|
alias s='screen -X screen '
|
||||||
# Resume screen or create a new one named main
|
# Resume screen or create a new one named main
|
||||||
alias scr='screen -r || screen -S main'
|
alias scr='screen -r || screen -S main'
|
||||||
# press enter to continue. Occasionally useful
|
# press enter to continue. Occasionally useful
|
||||||
alias cnfrm='read -p "Press enter to proceed" '
|
alias cnfrm='read -p "Press enter to proceed" '
|
||||||
|
|
||||||
# A more intense ping for the professional on the go
|
# A more intense ping for the professional on the go
|
||||||
alias pang='ping -i 10 -v -a'
|
alias pang='ping -i 10 -v -a'
|
||||||
# List the mounted things
|
# List the mounted things
|
||||||
alias mnts='mount | column -t'
|
alias mnts='mount | column -t'
|
||||||
# The history command but shorter
|
# The history command but shorter
|
||||||
alias h='history'
|
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
|
# Misc
|
||||||
# Get the weather. Put your location after the command
|
# Get the weather. Put your location after the command
|
||||||
alias wttr='ansiweather -u imperial -s false -l'
|
alias wttr='ansiweather -u imperial -s false -l'
|
||||||
#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
|
# A quick lil speedyboi
|
||||||
alias speedTest='curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3 -'
|
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
|
# If you're runnng my exact mastodon setup, this will be useful
|
||||||
@@ -148,81 +113,9 @@ alias hackingtool='docker run -it --net=host --security-opt seccomp=unconfined -
|
|||||||
# Do you need to reboot? Find out here!
|
# Do you need to reboot? Find out here!
|
||||||
alias needrs='[ -f /var/run/reboot-required ] && echo "You need to reboot"'
|
alias needrs='[ -f /var/run/reboot-required ] && echo "You need to reboot"'
|
||||||
alias gitgraph='git log --graph --oneline --decorate'
|
alias gitgraph='git log --graph --oneline --decorate'
|
||||||
# Countdown Timer
|
## See open ports
|
||||||
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 '
|
alias ports='netstat -tuln '
|
||||||
|
# gping
|
||||||
|
alias gping='docker run --rm -ti --network host ghcr.io/orf/gping'
|
||||||
|
alias proxon='export ALL_PROXY=socks5://brad:963852pop@distantserver.org:666; echo "IP: $(curl -s ifconfig.me)"'
|
||||||
|
alias proxoff='unset ALL_PROXY; echo "IP: $(curl -s ifconfig.me)"'
|
||||||
|
21
.bash_docker
Normal file
21
.bash_docker
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
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 containrrr/watchtower --cleanup "
|
||||||
|
alias watchonce="docker run -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower --run-once"
|
||||||
|
alias onetower="docker run --rm -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower --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"'
|
90
.bash_functions
Normal file
90
.bash_functions
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
|
||||||
|
#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
|
||||||
|
}
|
18
.bashrc
18
.bashrc
@@ -4,8 +4,13 @@
|
|||||||
alias sudo='sudo '
|
alias sudo='sudo '
|
||||||
|
|
||||||
#what cd should do by default
|
#what cd should do by default
|
||||||
|
if command -v batcat &> /dev/null
|
||||||
|
then
|
||||||
alias cd='cd_func'
|
alias cd='cd_func'
|
||||||
alias bat='batcat '
|
alias bat='batcat '
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
cd_func ()
|
cd_func ()
|
||||||
{
|
{
|
||||||
builtin cd "$@" && ls --color=auto --group-directories-first --format=single-column
|
builtin cd "$@" && ls --color=auto --group-directories-first --format=single-column
|
||||||
@@ -63,7 +68,8 @@ if [ -n "$force_color_prompt" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$color_prompt" = yes ]; then
|
if [ "$color_prompt" = yes ]; then
|
||||||
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
#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\]┌──${debian_chroot:+($debian_chroot)──}${VIRTUAL_ENV:+(\[\033[0;1m\]$(basename $VIRTUAL_ENV)\[\033[;32m\])}(\[\033[1;34m\]\u↳\h\[\033[;32m\])-[\[\033[0;1m\]\w\[\033[;32m\]]\n\[\033[;32m\]└─\[\033[1;34m\]\$\[\033[0m\]'
|
||||||
else
|
else
|
||||||
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
|
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
|
||||||
fi
|
fi
|
||||||
@@ -128,7 +134,12 @@ fi
|
|||||||
if [ -f ~/.bashlocal ]; then
|
if [ -f ~/.bashlocal ]; then
|
||||||
. ~/.bashlocal
|
. ~/.bashlocal
|
||||||
fi
|
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
|
# enable programmable completion features (you don't need to enable
|
||||||
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
||||||
# sources /etc/bash.bashrc).
|
# sources /etc/bash.bashrc).
|
||||||
@@ -165,4 +176,5 @@ extract () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export PATH="$HOME/.cargo/bin:$HOME/.local/bin:$PATH"
|
export PATH="$HOME/.cargo/bin:$HOME/.local/bin:$PATH"
|
||||||
export CDPATH=:..:~:~/dock:/dock
|
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'
|
||||||
|
33
bashset.sh
Normal file → Executable file
33
bashset.sh
Normal file → Executable file
@@ -1,16 +1,21 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
mv ~/.bashrc ~/.bashrc.bak
|
echo $HOME/.bashrc
|
||||||
ln -s .bashrc ~/.bashrc
|
ln -s $PWD/.bashrc $HOME/.bashrc
|
||||||
ln -s .bash_aliases ~/.bash_aliases
|
echo "done"
|
||||||
touch ~/.bashlocal
|
echo $HOME/.bash_aliases
|
||||||
|
ln -s $PWD/.bash_aliases $HOME/.bash_aliases
|
||||||
echo "Would you like to intall the contents of the package list in the arch foler? (yes/no)"
|
echo $HOME/.bash_docker
|
||||||
read answer
|
ln -s $PWD/.bash_docker $HOME/.bash_docker
|
||||||
|
echo "done"
|
||||||
if [ "$answer" == "yes" ] || [ "$answer" == "y" ]; then
|
echo $HOME/.bash_functions
|
||||||
echo "Fuck yeah"
|
ln -s $PWD/.bash_functions $HOME/.bash_functions
|
||||||
sudo pacman -S --needed $(\cat arch/pkglist.txt)
|
echo "done"
|
||||||
else
|
echo $HOME/.vimrc
|
||||||
echo "Exiting the script."
|
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
|
exit 0
|
||||||
fi
|
|
||||||
|
1
netmap.txt
Normal file
1
netmap.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Starting Nmap 7.80 ( https://nmap.org ) at 2024-07-07 19:34 CDT
|
3
readme.md
Normal file
3
readme.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
## 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.
|
@@ -1,37 +0,0 @@
|
|||||||
#!/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