Compare commits

...

24 Commits

Author SHA1 Message Date
Brad
348afcf4dd fucking bat 2025-06-26 02:46:52 -05:00
cc240f07c6 added colors because fuck you i like it 2024-07-09 18:29:58 -05:00
ea68950dc9 actually did the thing the last commit said i did 2024-07-03 15:47:32 -05:00
821e8fbb4d updated proxy aliases 2024-07-03 15:43:14 -05:00
8c9b91199d added dogs 2024-06-24 04:53:42 +00:00
Brad Ganley
c0ef1eb332 lol same thing as the last commit 2024-05-25 20:09:59 -05:00
Brad Ganley
381432665c Made ytdlp not the stupidest possible version of that anymore 2024-05-25 20:03:52 -05:00
08c8f0f23a added cleanup to watchtower alias 2024-03-24 13:51:57 -04:00
e457ffaf22 Added local TZ to watchtower alias 2024-03-24 13:44:29 -04:00
Brad Ganley
f8506e5b4a Added terminal socks5 proxy commands. Future iteration will allow server setting 2024-03-07 15:43:50 -06:00
Brad Ganley
367e3fc605 Made PS1 cooler 2024-03-01 00:41:05 -06:00
Brad Ganley
8539770f5e fixed the url left in the gping alias 2024-02-29 14:55:02 -06:00
Brad Ganley
db0503aa96 added docker gping alias 2024-02-29 14:46:28 -06:00
b56c020c9d deleted deprecated functions 2024-02-25 04:48:31 +00:00
621ddac333 added yapping 2024-02-25 04:46:28 +00:00
Brad Ganley
ea829fbfa7 holy fuck it finally works 2024-02-24 23:38:57 -05:00
f15a7c68e1 i'm very tired of this 2024-02-25 04:22:45 +00:00
Brad Ganley
762eeb5b6d wtf is this symlink error ahhhhhhhhh 2024-02-24 18:44:12 -05:00
0aa4567a6a god fucking damnit 2024-02-24 23:31:19 +00:00
9e87c7e514 god fucking damnit 2024-02-24 23:29:20 +00:00
5cf96c89fe Added readme and poorly wrote it 2024-02-24 23:28:41 +00:00
1c996c5222 Some cleanup 2024-02-24 23:21:10 +00:00
34f1a5451e Migrating functions to separate source file. Commented functions will be removed on next commit 2024-02-24 23:17:25 +00:00
bbe0b30222 Also made the batcat alias conditional to solve headaches I've been having for 5 years 2024-02-24 00:51:34 +00:00
8 changed files with 138 additions and 179 deletions

View File

@@ -59,10 +59,9 @@ case "$ID" in
# Add any other distribution-specific aliases here
;;
esac
# General
# Get $HOME quick
alias ~='cd ~/;clear'
alias ~='cd $HOME;clear'
# A Nice display of all files in a directory
alias ll='ls -hog'
# Above but...different I'm sure
@@ -75,17 +74,14 @@ alias gh='history|grep'
alias please='sudo !!'
# sometimes it feels good
alias fucking='sudo'
# Install bat. It's better.
alias cat='bat'
# Source this very file
alias src='source ~/.bashrc'
alias src='source $HOME/.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'
@@ -93,58 +89,21 @@ 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'
##### moved to .bash_docker will be removed in next commit #####
## 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 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'
## 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 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 "/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'
#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
@@ -154,81 +113,9 @@ 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'
# 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
## 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://brad:963852pop@distantserver.org:666; echo "IP: $(curl -s ifconfig.me)"'
alias proxoff='unset ALL_PROXY; echo "IP: $(curl -s ifconfig.me)"'

View File

@@ -5,7 +5,8 @@ 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 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'
@@ -17,4 +18,4 @@ alias dps="docker ps --format 'CONTAINER ID: {{.ID}}\nIMAGE: {{.Image}}\nCOMMAND
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 "/nasty/ytdl:/media" -it jauderho/yt-dlp:latest '
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
View 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
}

19
.bashrc
View File

@@ -4,8 +4,13 @@
alias sudo='sudo '
#what cd should do by default
alias cd='cd_func'
alias bat='batcat '
if command -v batcat &> /dev/null
then
alias cd='cd_func'
alias bat='batcat '
fi
cd_func ()
{
builtin cd "$@" && ls --color=auto --group-directories-first --format=single-column
@@ -63,7 +68,8 @@ 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='${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
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
@@ -131,7 +137,9 @@ 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).
@@ -168,4 +176,5 @@ extract () {
}
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'

35
bashset.sh Normal file → Executable file
View File

@@ -1,16 +1,21 @@
#!/bin/bash
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
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

1
netmap.txt Normal file
View File

@@ -0,0 +1 @@
Starting Nmap 7.80 ( https://nmap.org ) at 2024-07-07 19:34 CDT

3
readme.md Normal file
View 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.

View File

@@ -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"