lots of stuff
This commit is contained in:
165
.bashrc
165
.bashrc
@@ -1,7 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
iatest=$(expr index "$-" i)
|
|
||||||
|
|
||||||
#Source global definitions
|
#Source global definitions
|
||||||
if [ -f /etc/bashrc ]; then
|
if [ -f /etc/bashrc ]; then
|
||||||
. /etc/bashrc
|
. /etc/bashrc
|
||||||
@@ -14,12 +12,6 @@ elif [ -f /etc/bash_completion ]; then
|
|||||||
. /etc/bash_completion
|
. /etc/bash_completion
|
||||||
fi
|
fi
|
||||||
|
|
||||||
reminder_output=$(remind -h ~/.config/remind/reminders)
|
|
||||||
|
|
||||||
# Check if the reminder_output is not empty
|
|
||||||
if [ -n "$reminder_output" ]; then
|
|
||||||
remind -h ~/.config/remind/reminders
|
|
||||||
fi
|
|
||||||
|
|
||||||
#######################################################
|
#######################################################
|
||||||
# EXPORTS
|
# EXPORTS
|
||||||
@@ -42,13 +34,6 @@ PROMPT_COMMAND='history -a'
|
|||||||
# Allow ctrl-S for history navigation (with ctrl-R)
|
# Allow ctrl-S for history navigation (with ctrl-R)
|
||||||
stty -ixon
|
stty -ixon
|
||||||
|
|
||||||
# Ignore case on auto-completion
|
|
||||||
# Note: bind used instead of sticking these in .inputrc
|
|
||||||
if [[ $iatest > 0 ]]; then bind "set completion-ignore-case on"; fi
|
|
||||||
|
|
||||||
# Show auto-completion list automatically, without double tab
|
|
||||||
if [[ $iatest > 0 ]]; then bind "set show-all-if-ambiguous On"; fi
|
|
||||||
|
|
||||||
# Set the default editor
|
# Set the default editor
|
||||||
export EDITOR=vim
|
export EDITOR=vim
|
||||||
export VISUAL=vim
|
export VISUAL=vim
|
||||||
@@ -67,6 +52,7 @@ export LESS_TERMCAP_se=$'\E[0m'
|
|||||||
export LESS_TERMCAP_so=$'\E[01;44;33m'
|
export LESS_TERMCAP_so=$'\E[01;44;33m'
|
||||||
export LESS_TERMCAP_ue=$'\E[0m'
|
export LESS_TERMCAP_ue=$'\E[0m'
|
||||||
export LESS_TERMCAP_us=$'\E[01;32m'
|
export LESS_TERMCAP_us=$'\E[01;32m'
|
||||||
|
|
||||||
export LC_WHO=rorlando
|
export LC_WHO=rorlando
|
||||||
|
|
||||||
# Scripts Path
|
# Scripts Path
|
||||||
@@ -75,7 +61,6 @@ PATH=$PATH:~/.local/bin
|
|||||||
PATH=$PATH:~/bin
|
PATH=$PATH:~/bin
|
||||||
PATH=$PATH:/usr/local/go/bin
|
PATH=$PATH:/usr/local/go/bin
|
||||||
|
|
||||||
|
|
||||||
# Doom Path
|
# Doom Path
|
||||||
PATH=$PATH:~/.config/emacs/bin/
|
PATH=$PATH:~/.config/emacs/bin/
|
||||||
|
|
||||||
@@ -83,8 +68,22 @@ PATH=$PATH:~/.config/emacs/bin/
|
|||||||
PATH=$PATH:/var/lib/flatpak/exports/bin
|
PATH=$PATH:/var/lib/flatpak/exports/bin
|
||||||
PATH=$PATH:/var/lib/flatpak/app
|
PATH=$PATH:/var/lib/flatpak/app
|
||||||
|
|
||||||
# deadbeef path
|
|
||||||
PATH=$PATH:/opt/deadbeef/bin
|
#######################################################
|
||||||
|
# GOPASS
|
||||||
|
#######################################################
|
||||||
|
|
||||||
|
|
||||||
|
# Ensure gopass autocompletion is sourced
|
||||||
|
source <(gopass completion bash)
|
||||||
|
|
||||||
|
# Gopass aliases
|
||||||
|
alias gpi='gopass insert --multiline'
|
||||||
|
alias gpl='gopass ls'
|
||||||
|
alias gps='gopass show'
|
||||||
|
alias gpsclip='gopass show --clip'
|
||||||
|
alias gpe='gopass edit'
|
||||||
|
|
||||||
|
|
||||||
#######################################################
|
#######################################################
|
||||||
# ALIAS
|
# ALIAS
|
||||||
@@ -92,7 +91,7 @@ PATH=$PATH:/opt/deadbeef/bin
|
|||||||
# To temporarily bypass an alias, we preceed the command with a \
|
# To temporarily bypass an alias, we preceed the command with a \
|
||||||
# EG: the ls command is aliased, but to use the normal ls command you would type \ls
|
# EG: the ls command is aliased, but to use the normal ls command you would type \ls
|
||||||
|
|
||||||
# Pacman aliases
|
# Apt aliases
|
||||||
alias install='sudo apt install'
|
alias install='sudo apt install'
|
||||||
alias update='sudo apt update'
|
alias update='sudo apt update'
|
||||||
alias update='sudo apt upgrade'
|
alias update='sudo apt upgrade'
|
||||||
@@ -100,13 +99,6 @@ alias uu='sudo apt update && sudo apt upgrade'
|
|||||||
alias search='apt search'
|
alias search='apt search'
|
||||||
alias remove='sudo apt remove'
|
alias remove='sudo apt remove'
|
||||||
|
|
||||||
# Rsync push music to jellyfin
|
|
||||||
alias music_hd_to_cleric="rsync -r -e 'ssh -p 46668' --info=progress2 /run/media/opal/e1f36c5c-4775-4549-8edc-1fa4d273b82e/music cleric:/data/media/"
|
|
||||||
|
|
||||||
# Add an "alert" alias for long running commands. Use like so:
|
|
||||||
# sleep 10; alert
|
|
||||||
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
|
||||||
|
|
||||||
# alias to show the date
|
# alias to show the date
|
||||||
alias da='date "+%Y-%m-%d %A %T %Z"'
|
alias da='date "+%Y-%m-%d %A %T %Z"'
|
||||||
|
|
||||||
@@ -154,9 +146,6 @@ alias h="history | grep "
|
|||||||
# Search files in the current folder
|
# Search files in the current folder
|
||||||
alias f="find . | grep "
|
alias f="find . | grep "
|
||||||
|
|
||||||
# Count all files (recursively) in the current folder
|
|
||||||
alias countfiles="for t in files links directories; do echo \`find . -type \${t:0:1} | wc -l\` \$t; done 2> /dev/null"
|
|
||||||
|
|
||||||
# Show current network connections to the server
|
# Show current network connections to the server
|
||||||
alias ipview="netstat -anpl | grep :80 | awk {'print \$5'} | cut -d\":\" -f1 | sort | uniq -c | sort -n | sed -e 's/^ *//' -e 's/ *\$//'"
|
alias ipview="netstat -anpl | grep :80 | awk {'print \$5'} | cut -d\":\" -f1 | sort | uniq -c | sort -n | sed -e 's/^ *//' -e 's/ *\$//'"
|
||||||
|
|
||||||
@@ -179,19 +168,10 @@ alias untar='tar -xvf'
|
|||||||
alias unbz2='tar -xvjf'
|
alias unbz2='tar -xvjf'
|
||||||
alias ungz='tar -xvzf'
|
alias ungz='tar -xvzf'
|
||||||
|
|
||||||
# Show all logs in /var/log
|
|
||||||
alias logs="sudo find /var/log -type f -exec file {} \; | grep 'text' | cut -d' ' -f1 | sed -e's/:$//g' | grep -v '[0-9]$' | xargs tail -f"
|
|
||||||
|
|
||||||
# SHA1
|
|
||||||
alias sha1='openssl sha1'
|
|
||||||
|
|
||||||
# Wireguard
|
# Wireguard
|
||||||
alias wgup='sudo wg-quick up /etc/wireguard/wg0.conf'
|
alias wgup='sudo wg-quick up /etc/wireguard/wg0.conf'
|
||||||
alias wgdown='sudo wg-quick down /etc/wireguard/wg0.conf'
|
alias wgdown='sudo wg-quick down /etc/wireguard/wg0.conf'
|
||||||
|
|
||||||
# Hugo
|
|
||||||
alias hss='hugo server --noHTTPCache'
|
|
||||||
|
|
||||||
# Work
|
# Work
|
||||||
alias stork='ssh stork'
|
alias stork='ssh stork'
|
||||||
alias mail='ssh mail'
|
alias mail='ssh mail'
|
||||||
@@ -201,61 +181,11 @@ alias keys='eval $(keychain --eval --quiet ry_ecdsa) && eval $(keychain --eval -
|
|||||||
# Wget (keeps hsts files out of $HOME)
|
# Wget (keeps hsts files out of $HOME)
|
||||||
alias wget='wget --hsts-file="$XDG_CACHE_HOME/wget-hsts"'
|
alias wget='wget --hsts-file="$XDG_CACHE_HOME/wget-hsts"'
|
||||||
|
|
||||||
alias transbr='trans :pt-BR'
|
alias tbr='trans :pt-BR'
|
||||||
|
|
||||||
# #######################################################
|
#######################################################
|
||||||
# # SPECIAL FUNCTIONS
|
# SPECIAL FUNCTIONS
|
||||||
# #######################################################
|
#######################################################
|
||||||
|
|
||||||
# Searches for text in all files in the current folder
|
|
||||||
ftext() {
|
|
||||||
# -i case-insensitive
|
|
||||||
# -I ignore binary files
|
|
||||||
# -H causes filename to be printed
|
|
||||||
# -r recursive search
|
|
||||||
# -n causes line number to be printed
|
|
||||||
# optional: -F treat search term as a literal, not a regular expression
|
|
||||||
# optional: -l only print filenames and not the matching lines ex. grep -irl "$1" *
|
|
||||||
grep -iIHrn --color=always "$1" . | less -r
|
|
||||||
}
|
|
||||||
|
|
||||||
# Copy file with a progress bar
|
|
||||||
cpp() {
|
|
||||||
set -e
|
|
||||||
strace -q -ewrite cp -- "${1}" "${2}" 2>&1 |
|
|
||||||
awk '{
|
|
||||||
count += $NF
|
|
||||||
if (count % 10 == 0) {
|
|
||||||
percent = count / total_size * 100
|
|
||||||
printf "%3d%% [", percent
|
|
||||||
for (i=0;i<=percent;i++)
|
|
||||||
printf "="
|
|
||||||
printf ">"
|
|
||||||
for (i=percent;i<100;i++)
|
|
||||||
printf " "
|
|
||||||
printf "]\r"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
END { print "" }' total_size=$(stat -c '%s' "${1}") count=0
|
|
||||||
}
|
|
||||||
|
|
||||||
# Copy and go to the directory
|
|
||||||
cpg() {
|
|
||||||
if [ -d "$2" ]; then
|
|
||||||
cp $1 $2 && cd $2
|
|
||||||
else
|
|
||||||
cp $1 $2
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Move and go to the directory
|
|
||||||
mvg() {
|
|
||||||
if [ -d "$2" ]; then
|
|
||||||
mv $1 $2 && cd $2
|
|
||||||
else
|
|
||||||
mv $1 $2
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create and go to the directory
|
# Create and go to the directory
|
||||||
mkdirg() {
|
mkdirg() {
|
||||||
@@ -263,57 +193,6 @@ mkdirg() {
|
|||||||
cd $1
|
cd $1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Goes up a specified number of directories (i.e. up 4)
|
|
||||||
up() {
|
|
||||||
local d=""
|
|
||||||
limit=$1
|
|
||||||
for ((i = 1; i <= limit; i++)); do
|
|
||||||
d=$d/..
|
|
||||||
done
|
|
||||||
d=$(echo $d | sed 's/^\///')
|
|
||||||
if [ -z "$d" ]; then
|
|
||||||
d=..
|
|
||||||
fi
|
|
||||||
cd $d
|
|
||||||
}
|
|
||||||
|
|
||||||
# Show current network information
|
|
||||||
netinfo() {
|
|
||||||
echo "--------------- Network Information ---------------"
|
|
||||||
/sbin/ifconfig | awk /'inet addr/ {print $2}'
|
|
||||||
echo ""
|
|
||||||
/sbin/ifconfig | awk /'Bcast/ {print $3}'
|
|
||||||
echo ""
|
|
||||||
/sbin/ifconfig | awk /'inet addr/ {print $4}'
|
|
||||||
|
|
||||||
/sbin/ifconfig | awk /'HWaddr/ {print $4,$5}'
|
|
||||||
echo "---------------------------------------------------"
|
|
||||||
}
|
|
||||||
|
|
||||||
# IP address lookup
|
|
||||||
alias whatismyip="whatsmyip"
|
|
||||||
function whatsmyip() {
|
|
||||||
# Dumps a list of all IP addresses for every device
|
|
||||||
# /sbin/ifconfig |grep -B1 "inet addr" |awk '{ if ( $1 == "inet" ) { print $2 } else if ( $2 == "Link" ) { printf "%s:" ,$1 } }' |awk -F: '{ print $1 ": " $3 }';
|
|
||||||
|
|
||||||
# Internal IP Lookup
|
|
||||||
echo -n "Internal IP: "
|
|
||||||
/sbin/ifconfig eth0 | grep "inet addr" | awk -F: '{print $2}' | awk '{print $1}'
|
|
||||||
|
|
||||||
# External IP Lookup
|
|
||||||
echo -n "External IP: "
|
|
||||||
wget http://smart-ip.net/myip -O - -q
|
|
||||||
}
|
|
||||||
|
|
||||||
# View Apache logs
|
|
||||||
apachelog() {
|
|
||||||
if [ -f /etc/httpd/conf/httpd.conf ]; then
|
|
||||||
cd /var/log/httpd && ls -xAh && multitail --no-repeat -c -s 2 /var/log/httpd/*_log
|
|
||||||
else
|
|
||||||
cd /var/log/apache2 && ls -xAh && multitail --no-repeat -c -s 2 /var/log/apache2/*.log
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#######################################################
|
#######################################################
|
||||||
# Prompt
|
# Prompt
|
||||||
|
|||||||
@@ -1,18 +1,16 @@
|
|||||||
|
---Reddit---
|
||||||
|
https://www.reddit.com/r/stupidpol/.rss
|
||||||
|
---News---
|
||||||
|
https://thegrayzone.com/rss
|
||||||
|
https://multipolarista.com/rss
|
||||||
|
https://www.telesurenglish.net/feed/
|
||||||
|
https://theintercept.com/feed/
|
||||||
---Tech---
|
---Tech---
|
||||||
https://landchad.net/rss.xml
|
https://landchad.net/rss.xml
|
||||||
https://videos.lukesmith.xyz/feeds/videos.xml?videoChannelId=2 "~Luke Smith (Videos)"
|
https://videos.lukesmith.xyz/feeds/videos.xml?videoChannelId=2 "~Luke Smith (Videos)"
|
||||||
https://pluralistic.net/feed/
|
https://pluralistic.net/feed/
|
||||||
https://blog.privacyguides.org/feed_rss_created.xml
|
https://blog.privacyguides.org/feed_rss_created.xml
|
||||||
---News---
|
|
||||||
https://thegrayzone.com/rss
|
|
||||||
https://multipolarista.com/rss
|
|
||||||
---Podcasts---
|
---Podcasts---
|
||||||
https://feeds.simplecast.com/dCXMIpJz "Last Podcast On the Left"
|
https://feeds.simplecast.com/dCXMIpJz "Last Podcast On the Left"
|
||||||
http://feeds.soundcloud.com/users/soundcloud:users:572119410/sounds.rss podcasts "Fall of Civilziation"
|
http://feeds.soundcloud.com/users/soundcloud:users:572119410/sounds.rss podcasts "Fall of Civilziation"
|
||||||
https://feeds.feedburner.com/dancarlin/history?format=xml podcasts "Hardcore History"
|
https://feeds.feedburner.com/dancarlin/history?format=xml podcasts "Hardcore History"
|
||||||
---Reddit---
|
|
||||||
https://www.reddit.com/r/stupidpol/.rss
|
|
||||||
https://www.reddit.com/r/redscarepod/.rss
|
|
||||||
---Youtube---
|
|
||||||
https://www.youtube.com/feeds/videos.xml?channel_id=UC3Vuq4Q1bKFtAiKYlwRv3oA
|
|
||||||
https://www.youtube.com/feeds/videos.xml?channel_id=UCXulruMI7BHj3kGyosNa0jA
|
|
||||||
|
|||||||
@@ -235,6 +235,11 @@ input type:keyboard {
|
|||||||
repeat_rate 45
|
repeat_rate 45
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# input "TPPS/2 Elan TrackPoint" {
|
||||||
|
# accel_profile "adaptive"
|
||||||
|
# pointer_accel 0.1
|
||||||
|
# }
|
||||||
|
|
||||||
# Hide mouse cursor after inactivity
|
# Hide mouse cursor after inactivity
|
||||||
seat * hide_cursor 10000
|
seat * hide_cursor 10000
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ def get_weather_icon(description):
|
|||||||
"shower rain": "",
|
"shower rain": "",
|
||||||
"light rain": "",
|
"light rain": "",
|
||||||
"rain": "",
|
"rain": "",
|
||||||
|
"moderate rain": "",
|
||||||
"thunderstorm": "",
|
"thunderstorm": "",
|
||||||
"snow": "",
|
"snow": "",
|
||||||
"mist": "",
|
"mist": "",
|
||||||
|
|||||||
Reference in New Issue
Block a user