idek whats in here, there might even be some password idk
This commit is contained in:
parent
44d2ac2019
commit
8b24c9f318
55
bashrc
55
bashrc
@ -26,6 +26,15 @@ source ~/.bash-seafly-prompt/command_prompt.bash
|
||||
cd(){ builtin cd "$@" && pwd > ~/.cache/whereami;}
|
||||
cdl(){ cd $(cat ~/.cache/whereami);};cdl
|
||||
|
||||
ip(){
|
||||
if [[ $1 == "info" ]]
|
||||
then
|
||||
curl -s https://ipinfo.io/$2 | jq
|
||||
else
|
||||
command ip "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
####### ALIASES ##########
|
||||
# add features
|
||||
@ -33,12 +42,11 @@ cdl(){ cd $(cat ~/.cache/whereami);};cdl
|
||||
alias hdd='cd /mnt/hdd'
|
||||
alias drag=ripdrag
|
||||
|
||||
|
||||
#Adding output colors
|
||||
alias ls='ls --color=always'
|
||||
alias grep='grep --color=auto'
|
||||
alias less='less -R'
|
||||
|
||||
alias ping='ping -O'
|
||||
# fix typos
|
||||
alias ckear=clear
|
||||
alias sl=ls
|
||||
@ -46,13 +54,13 @@ alias ks=ls
|
||||
alias dc=cd
|
||||
#########################
|
||||
|
||||
docker(){
|
||||
if [[ $1 == "compose" && $2 == "up" && $# -eq 2 ]]; then
|
||||
docker compose up -d && docker compose logs -f
|
||||
else
|
||||
command docker "$@"
|
||||
fi
|
||||
}
|
||||
#docker(){
|
||||
# if [[ $1 == "compose" && $2 == "up" && $# -eq 2 ]]; then
|
||||
# docker compose up -d && docker compose logs -f
|
||||
# else
|
||||
# command docker "$@"
|
||||
# fi
|
||||
#}
|
||||
|
||||
##################### Some cool funcations hehe ###############################
|
||||
# do math in shell
|
||||
@ -97,6 +105,35 @@ enter () {
|
||||
fi
|
||||
}
|
||||
|
||||
extract() {
|
||||
if [ -f "$1" ] ; then
|
||||
local folder_name=$(basename "$1" | sed -e 's/\..*$//')
|
||||
mkdir -p "$folder_name"
|
||||
case "$1" in
|
||||
*.tar.bz2) tar xvjf "$1" -C "$folder_name" ;;
|
||||
*.tar.gz) tar xvzf "$1" -C "$folder_name" ;;
|
||||
*.bz2) bunzip2 -k "$1" && mv "${1%.*}" "$folder_name" ;;
|
||||
*.rar) unrar x "$1" "$folder_name" ;;
|
||||
*.gz) gunzip -k "$1" && mv "${1%.*}" "$folder_name" ;;
|
||||
*.tar) tar xvf "$1" -C "$folder_name" ;;
|
||||
*.tbz2) tar xvjf "$1" -C "$folder_name" ;;
|
||||
*.tgz) tar xvzf "$1" -C "$folder_name" ;;
|
||||
*.zip) unzip "$1" -d "$folder_name" ;;
|
||||
*.Z) uncompress "$1" && mv "${1%.*}" "$folder_name" ;;
|
||||
*.7z) 7z x "$1" -o"$folder_name" ;;
|
||||
*.xz) xz --decompress --keep "$1" && mv "${1%.*}" "$folder_name" ;;
|
||||
*) echo "'$1' cannot be extracted via extract()" ;;
|
||||
esac
|
||||
else
|
||||
echo "'$1' is not a valid file"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#load neofetch
|
||||
#neofetch
|
||||
source /usr/share/nvm/init-nvm.sh
|
||||
|
||||
PATH=$PATH:/home/shihaam/.wine/drive_c/users/shihaam/AppData/Roaming/.tlauncher/legacy/Minecraft
|
||||
shopt -s cdspell
|
||||
#fastfetch
|
||||
|
@ -212,7 +212,7 @@ exec --no-startup-id picom
|
||||
# Start bluetooth system tray applet at login
|
||||
exec --no-startup-id blueman-applet
|
||||
|
||||
exec --no-startup-id /home/shihaam/.scripts/scrcpy-autostart
|
||||
#exec --no-startup-id /home/shihaam/.scripts/scrcpy-autostart
|
||||
|
||||
# start power mmanager
|
||||
exec --no-startup-id xfce4-power-manager
|
||||
@ -231,11 +231,12 @@ exec --no-startup-id dunst
|
||||
|
||||
|
||||
# start kde connect
|
||||
exec --no-startup-id /usr/lib/kdeconnectd
|
||||
exec --no-startup-id kdeconnectd
|
||||
|
||||
#set a wallpaper
|
||||
exec --no-startup-id feh --no-fehbg --bg-scale /usr/share/backgrounds/archlinux/split.png
|
||||
|
||||
#start ibus
|
||||
exec --no-startup-id ibus start
|
||||
#exec_always polybar
|
||||
|
||||
|
||||
|
48
scripts/get-http
Executable file
48
scripts/get-http
Executable file
@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Usage check
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Usage: $0 <URL>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Extract the protocol, hostname, port, and path from the URL
|
||||
url=$1
|
||||
protocol="${url%%://*}"
|
||||
host_port="${url#*://}"
|
||||
host="${host_port%%/*}"
|
||||
path="/${host_port#*/}"
|
||||
port=80
|
||||
|
||||
# Check if the protocol is HTTP
|
||||
if [ "$protocol" != "http" ]; then
|
||||
echo "Only HTTP protocol is supported."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if a port is specified
|
||||
if [[ $host == *:* ]]; then
|
||||
IFS=':' read -ra ADDR <<< "$host"
|
||||
host=${ADDR[0]}
|
||||
port=${ADDR[1]}
|
||||
fi
|
||||
|
||||
# Open connection to the host
|
||||
exec 3<>/dev/tcp/$host/$port
|
||||
|
||||
# Send HTTP GET request
|
||||
echo -e "GET $path HTTP/1.1\r\nHost: $host\r\nConnection: close\r\n\r\n" >&3
|
||||
|
||||
# Read the response and output the file content
|
||||
{
|
||||
# Skip HTTP headers
|
||||
while IFS= read -r line; do
|
||||
[[ $line == $'\r' ]] && break
|
||||
done
|
||||
|
||||
# Output the body (file content)
|
||||
cat >&1
|
||||
} <&3
|
||||
|
||||
# Close the connection
|
||||
exec 3<&-
|
27
scripts/i3lock-finger
Executable file
27
scripts/i3lock-finger
Executable file
@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Ensure the directory for failed fingerprint images exists
|
||||
mkdir -p ~/pictures/failed_finger
|
||||
|
||||
# Lock the screen with all passed arguments
|
||||
i3lock "$@" &
|
||||
|
||||
while true; do
|
||||
# Run the fingerprint verification and redirect output to /dev/null
|
||||
fprintd-verify &> /dev/null
|
||||
|
||||
# Capture the exit code
|
||||
exit_code=$?
|
||||
|
||||
# Check the exit code
|
||||
if [ $exit_code -eq 0 ]; then
|
||||
pkill i3lock
|
||||
exit 0
|
||||
elif [ $exit_code -eq 1 ]; then
|
||||
timestamp=$(date "+%Y%m%d_%H%M%S")
|
||||
timestamp_human=$(date -d "${timestamp:0:8} ${timestamp:9:2}:${timestamp:11:2}:${timestamp:13:2}" "+%Y-%h-%d %H:%M:%S")
|
||||
ffmpeg -f video4linux2 -s 1280x720 -i /dev/video0 -frames:v 1 ~/pictures/failed_finger/$timestamp.png
|
||||
kdeconnect-cli --device $(kdeconnect-cli -a --id-only) --ping-msg "Failed to unlock at $timestamp_human"
|
||||
fi
|
||||
done
|
||||
|
72
scripts/netscan
Executable file
72
scripts/netscan
Executable file
@ -0,0 +1,72 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check if an interface name is provided
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: $0 <network-interface>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
INTERFACE=$1
|
||||
|
||||
# Get the IP subnet for the provided network interface
|
||||
IP_SUBNET=$(ip route show dev "$INTERFACE" | grep -v default | awk '{print $1}')
|
||||
|
||||
|
||||
# Check if the IP information was found
|
||||
if [ -z "$IP_SUBNET" ]; then
|
||||
echo "No IP address found for interface $INTERFACE."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Scan the subnet using nmap, running as root
|
||||
echo "Scanning the subnet $IP_SUBNET..."
|
||||
OUTPUT=$(sudo nmap -sP "$IP_SUBNET")
|
||||
|
||||
# Parse the nmap output and present it in a table
|
||||
#echo "$OUTPUT" | awk '/Nmap scan report for/{
|
||||
# if ($5 ~ /^\(/) { ip=$5; name="Unknown"; }
|
||||
# else if ($6 ~ /^\(/) { name=$5; ip=$6; }
|
||||
# else { name="Unknown"; ip=$5; }
|
||||
#
|
||||
# ip=gensub(/\(|\)/, "", "g", ip); # Remove parentheses from IP
|
||||
#
|
||||
# getline; getline; mac=$3; brand="";
|
||||
#
|
||||
# # Capture the entire remainder as brand, remove parentheses
|
||||
# for (i=4; i<=NF; i++) brand = brand $i " ";
|
||||
# brand=gensub(/^\(|\)$/, "", "g", brand); # Clean brand formatting
|
||||
# print name, ip, mac, brand
|
||||
#}' | column -t -s ' ' -o ' | ' | awk 'BEGIN {print "Name | IP Address | MAC Address | Brand\n-----------------------------------------------------------------"} {print}'
|
||||
|
||||
# Parse the nmap output and present it in a table
|
||||
echo "$OUTPUT" | awk '/Nmap scan report for/{
|
||||
if ($5 ~ /^\(/) { ip=$5; name="Unknown"; }
|
||||
else if ($6 ~ /^\(/) { name=$5; ip=$6; }
|
||||
else { name="Unknown"; ip=$5; }
|
||||
|
||||
ip=gensub(/\(|\)/, "", "g", ip); # Remove parentheses from IP
|
||||
|
||||
getline; getline; mac=$3; brand=$4; # Skip status line and move to MAC and Brand
|
||||
gsub(/\(|\)/, "", brand); # Clean brand formatting
|
||||
print name, ip, mac, brand
|
||||
}' | column -t -s ' ' -o ' | ' | awk 'BEGIN {print "Name | IP Address | MAC Address | Brand\n-----------------------------------------------------------------"} {print}'
|
||||
|
||||
|
||||
## Parse the nmap output and present it in a table
|
||||
#echo "$OUTPUT" | awk '/Nmap scan report for/{
|
||||
# if ($5 ~ /^\(/) { ip=$5; name="Unknown"; }
|
||||
# else if ($6 ~ /^\(/) { name=$5; ip=$6; }
|
||||
# else { name="Unknown"; ip=$5; }
|
||||
#
|
||||
# ip=gensub(/\(|\)/, "", "g", ip); # Remove parentheses from IP
|
||||
#
|
||||
# getline; getline; mac=$3; brand="";
|
||||
#
|
||||
# # Capture the entire remainder as brand
|
||||
# if ($(NF-1) ~ /^\(/) { # Check if the second last field starts with (
|
||||
# for (i=4; i<=NF; i++) brand = brand $i " ";
|
||||
# sub(/\s+$/, "", brand); # Trim trailing space
|
||||
# brand=gensub(/\((.*)\)/, "\\1", "g", brand); # Remove outer parentheses
|
||||
# }
|
||||
# print name, ip, mac, brand
|
||||
#}' | column -t -s ' ' -o ' | ' | awk 'BEGIN {print "Name | IP Address | MAC Address | Brand\n--------------------------------------------------------------------------------"} {print}'
|
BIN
scripts/output.jpg
Normal file
BIN
scripts/output.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 31 KiB |
Loading…
x
Reference in New Issue
Block a user