add services and bash alias
wol service asd
This commit is contained in:
1 parent
4b75e4b491
commit
f84d8d137b
5 files changed
+246
No files matched your search
Executable
+198
@@ -0,0 +1,198 @@
|
||||
HOST=$(hostname)
|
||||
if [ "${HOST}" == "quiethost" ]; then
|
||||
DOC_DIR="/home/lucas/Documents"
|
||||
UNSYNCED="SW"
|
||||
elif [ "${HOST}" == "vivohost" ];then
|
||||
UNSYNCED="Music\nSW\nPictures\nDokumente/Studium\nDokumente/Auslandsdienst"
|
||||
DOC_DIR="/home/lucas/Documents"
|
||||
rasp_host="someoneslinux.ddns.net"
|
||||
elif [ "${HOST}" != "raspberry" ]; then
|
||||
UNSYNCED="Music\nSW\nPictures "
|
||||
DOC_DIR="/home/lucas/Documents"
|
||||
fi
|
||||
|
||||
if [ "${HOST}" == "raspberry" ]; then
|
||||
LOCAL_SCRIPTS="/home/lucas/Raspberry/scripts"
|
||||
DOC_DIR="/home/lucas/Documents"
|
||||
else
|
||||
LOCAL_SCRIPTS="/home/lucas/scripts"
|
||||
rasp_host=raspberry
|
||||
fi
|
||||
NC_SCRIPTS="$DOC_DIR/Dokumente/Projekte/Server/scripts"
|
||||
alias please="sudo"
|
||||
alias NC_scripts="cd ${NC_SCRIPTS}"
|
||||
alias regex_rename="${LOCAL_SCRIPTS}/rename.sh"
|
||||
alias profile="${LOCAL_SCRIPTS}/profile_motd.sh"
|
||||
alias auto_update="sudo ${LOCAL_SCRIPTS}/upgrade.sh"
|
||||
alias aptgrep="apt list --installed | grep -i "
|
||||
alias reboot="sudo /sbin/reboot"
|
||||
alias shutdown="sudo /sbin/shutdown"
|
||||
alias sound_up="pactl -- set-sink-volume 0 +10%"
|
||||
alias TU_vpn="sudo openconnect --user e1629051@student.tuwien.ac.at vpn.tuwien.ac.at"
|
||||
alias psgrep="ps -elf | grep -v grep | grep -i "
|
||||
alias vpn="sudo ${LOCAL_SCRIPTS}/network/networksettings.sh"
|
||||
alias pubip="wget -T 5 -qO- ifconfig.co"
|
||||
alias pubip_country="wget -T 5 -qO- ifconfig.co/country"
|
||||
alias ipinfo='${LOCAL_SCRIPTS}/ip_info.sh'
|
||||
alias pygen="/home/lucas/scripts/.venv/bin/python3"
|
||||
if [[ "${HOST}" == "quiethost" ]] || [[ "${HOST}" == "serverhost" ]]; then
|
||||
### Veracrypt aliases
|
||||
#Passwd Mount and Grep
|
||||
alias passwd_mount="sudo veracrypt -t --mount --non-interactive --stdin $DOC_DIR/Dokumente/Zeug/passwd /media/veracrypt_passwd && clear"
|
||||
alias passwd_dismount="sudo veracrypt --dismount $DOC_DIR/Dokumente/Zeug/passwd && touch $DOC_DIR/Dokumente/Zeug/passwd"
|
||||
alias passwd_grep="grep -i -A1 /media/veracrypt_passwd/passwd.txt -e "
|
||||
#System mounts
|
||||
alias system_mount="sudo veracrypt -t --mount --non-interactive --stdin /data/SystemData/Sys64/System_Data /media/veracrypt_system && clear"
|
||||
alias system_dismount="sudo veracrypt --dismount /data/SystemData/Sys64/System_Data"
|
||||
#vera
|
||||
alias vera_mount="sudo veracrypt -t --mount --non-interactive --stdin //media/veracrypt_system/System32/SystemData/IMG.file /media/veracrypt_vera && clear"
|
||||
alias vera_dismount="sudo veracrypt --dismount /media/veracrypt_system/System32/SystemData/IMG.file"
|
||||
#no intenet
|
||||
alias no_inet="sudo -s -g no-internet"
|
||||
alias recipeAI="~/.venv_general/bin/python3 ~/scripts/quiethost/generateNutritionInfowithGemini.py /data/Nextcloud/Documents/Dokumente/Shared/Diverses/Kochbuch/RecepiesLucas/"
|
||||
alias ffmepeg_handling="~/.venv_general/bin/python3 ~/scripts/ffmpeg_handling.py"
|
||||
fi
|
||||
|
||||
if [ "${HOST}" != "raspberry" ]; then
|
||||
# Shutdown
|
||||
alias alldown='ssh ${rasp_host} hostdown all -c'
|
||||
alias serverdown='ssh ${rasp_host} hostdown serverhost -c'
|
||||
alias delldown='ssh ${rasp_host} hostdown quiethost -c'
|
||||
# Wake
|
||||
alias serverwake="ssh ${rasp_host} wake serverhost"
|
||||
alias quietwake="bash ${LOCAL_SCRIPTS}/wol.sh quiethost"
|
||||
# SSH
|
||||
alias rasp="ssh ${rasp_host}"
|
||||
alias raspcopy='bash ${LOCAL_SCRIPTS}/copy.sh -h ${rasp_host} -f '
|
||||
#NW Stat
|
||||
alias NWscan="ssh ${rasp_host} hoststatus netw -c"
|
||||
alias hoststat="ssh ${rasp_host} hoststatus hosts -c"
|
||||
elif [ "${HOST}" != "vivohost" ];then
|
||||
# Raspberry Shutdown
|
||||
alias serverdown='hostdown serverhost -c'
|
||||
alias delldown='hostdown quiethost -c'
|
||||
alias alldown='hostdown all -c'
|
||||
alias pcdown='hostdown pc -c'
|
||||
# Raspberry Wake
|
||||
alias serverwake='wake serverhost'
|
||||
alias quietwake='wake quiethost'
|
||||
# Raspberry Hoststatus
|
||||
alias hoststat="hoststatus hosts -c"
|
||||
alias NWscan="hoststatus netw -c"
|
||||
# Raspberry Network Settings
|
||||
alias IFchange="sudo bash ${LOCAL_SCRIPTS}/IFchange.sh"
|
||||
alias IPsettings="sudo bash /home/lucas/Raspberry/scripts/iptables.sh"
|
||||
alias IPtables-save='sudo sh -c '\''iptables-save > /etc/network/iptables'\'''
|
||||
# Raspberry Owncloud
|
||||
alias syncNC="nextcloudcmd --path Dokumente/Dokumente/Projekte/Server /home/lucas/Documents/Dokumente/Projekte/Server https://lucas:S1mpleRe1e4sedP1ayingDesign@someoneslinux.ddns.net"
|
||||
fi
|
||||
if [ "${HOST}" != "serverhost" ]; then
|
||||
alias serverhost="ssh -X serverhost"
|
||||
alias lstorr="ssh serverhost du -a -d1 -h /torrent/complete/ | sed 's/\/torrent\/complete\///'g | head -n -1"
|
||||
alias delugecopy='bash ${LOCAL_SCRIPTS}/copy.sh -h deluge -f '
|
||||
alias servercopy='bash ${LOCAL_SCRIPTS}/copy.sh -h serverhost -f '
|
||||
alias scriptcopy="ssh serverhost bash /home/lucas/scripts/scriptcopy.sh"
|
||||
#Dinfo
|
||||
alias dinfo="ssh serverhost ${LOCAL_SCRIPTS}/deluge-client.sh"
|
||||
elif [ "${HOST}" != "vivohost" ];then
|
||||
# Copy Torrents
|
||||
alias ytlistdownload="screen -S ytdown bash /home/lucas/scripts/youtube.sh -L"
|
||||
copytorrents() {
|
||||
screen -S cptorr bash -c "/home/lucas/scripts/serverhost/copytorrents.sh -l -y $@; read"
|
||||
}
|
||||
# Print
|
||||
alias print="lpr -P hp-LaserJet-1300 "
|
||||
alias scriptcopy='bash ${LOCAL_SCRIPTS}/scriptcopy.sh'
|
||||
# Serverhost Network Commands
|
||||
alias occ_scan="sudo bash ${LOCAL_SCRIPTS}/Nextcloud/nextcloud_scan.sh"
|
||||
alias netstat="sudo bash ${LOCAL_SCRIPTS}/network/state.sh"
|
||||
alias routing="sudo ${LOCAL_SCRIPTS}/network/rev_routing.sh"
|
||||
alias IPtables-save="sudo sh -c 'iptables-save > /etc/network/iptables'"
|
||||
# Serverhost Deluge Commands
|
||||
alias rmTorr="bash ${LOCAL_SCRIPTS}/removeTorrents.sh"
|
||||
alias dadd='duser deluge-console add'
|
||||
alias deluge="duser deluged && sleep 0.2 && duser deluge-console"
|
||||
alias deluge-console='duser deluge-console'
|
||||
alias del='if [[ $(psgrep delug | wc -l) -eq 0 ]]; then vpn; fi; duser deluge-console'
|
||||
alias deluged="duser deluged"
|
||||
alias duser="sudo ${LOCAL_SCRIPTS}/serverhost/deluge_user_cmd.sh"
|
||||
alias dpubip="duser wget -T 5 -qO- ifconfig.co"
|
||||
alias dpubip_country="duser wget -T 5 -qO- ifconfig.co/country"
|
||||
alias lstorr="du -a -d1 -h /torrent/complete/ | sed 's/\/torrent\/complete\///'g | head -n -1"
|
||||
# Serverhost NCSync
|
||||
alias occ="sudo -u www-data php /nextcloud/nextcloud/occ"
|
||||
#Dinfo
|
||||
alias dinfo="${LOCAL_SCRIPTS}/serverhost/deluge-client.sh"
|
||||
# Wallpaper Changer
|
||||
alias WC="bash /home/lucas/scripts/serverhost/WallpaperChangerServer.sh"
|
||||
# Auto shutdown
|
||||
alias autoshutdown_enable="echo "yes" > /home/lucas/.auto_shutdown"
|
||||
alias autoshutdown_disable="echo "no" > /home/lucas/.auto_shutdown"
|
||||
fi
|
||||
if [ "${HOST}" != "quiethost" ]; then
|
||||
alias quiethost="ssh -X quiethost"
|
||||
alias quietcopy='bash ${LOCAL_SCRIPTS}/copy.sh -h quiethost -f '
|
||||
elif [ "${HOST}" != "vivohost" ];then
|
||||
# XRDP duser@serverhost
|
||||
alias serverxrdp="xfreerdp /bpp:32 /kbd:german /u:deluge-user /v:10.0.0.2 /port:3389 /cert-ignore /size:1920x950 /relax-order-checks +glyph-cache"
|
||||
# Iptables
|
||||
alias firewall="sudo /home/lucas/Documents/Dokumente/Projekte/Server/scripts/iptables_basic.sh"
|
||||
# Torrents
|
||||
alias torrentcopy="bash /home/lucas/scripts/quiethost/torrentcopy.sh"
|
||||
# Screenshot
|
||||
alias scrsht="bash /home/lucas/scripts/screenschot_grab.sh"
|
||||
# Boot to Windows
|
||||
alias winboot="sudo efibootmgr --bootnext 0000 && reboot"
|
||||
# Boot to Windows
|
||||
alias winhiber="sudo /home/lucas/scripts/enable-hibernate-reboot && sudo efibootmgr --bootnext 0003 && sudo systemctl hibernate"
|
||||
# 3DVS mount
|
||||
alias 3dvs_mount="sudo veracrypt -t --mount --non-interactive --stdin /data/SystemData/SystemGame3DSV2_10 /media/veracrypt_3DSV && clear"
|
||||
alias 3dvs_dismount="sudo veracrypt --dismount /data/SystemData/SystemGame3DSV2_10"
|
||||
# FFMPEG
|
||||
# jpg2png
|
||||
alias imconv="bash ${LOCAL_SCRIPTS}/img_type.sh"
|
||||
alias FFmpeg="bash /home/lucas/scripts/ffmpeg_handling.sh"
|
||||
# Wallpaper Changer
|
||||
alias WC="bash /data/Nextcloud/Documents/Dokumente/Projekte/Server/scripts/serverhost/WallpaperChangerServer.sh"
|
||||
# Display Modes
|
||||
alias mode_work="xrandr --output HDMI-1-1 --off && bash /home/lucas/scripts/wallpaperChanger.sh"
|
||||
alias mode_norm="xrandr --output eDP-1-1 --output HDMI-1-1 --auto --primary --left-of eDP-1-1 && bash /home/lucas/scripts/wallpaperChanger.sh"
|
||||
# Repair Mouse
|
||||
alias mouse_repair="sudo /home/lucas/scripts/repair_mouse.sh"
|
||||
alias sd_rm="rm -dr /home/lucas/stable-diffusion-webui/outputs/* /home/lucas/stable-diffusion-webui/log/images/*"
|
||||
alias stable="cd /stable/stable-diffusion-webui/ && ./webui.sh"
|
||||
alias comfiUI="cd /stable/ComfyUI/ && HSA_OVERRIDE_GFX_VERSION=10.3.0 python3 main.py"
|
||||
fi
|
||||
|
||||
if [ "${HOST}" == "vivohost" ]; then
|
||||
alias labwake="sudo etherwake B4:2E:99:F1:82:3B -i wlo1"
|
||||
#alias labhost="ssh ubuntu@LabNotebookUbuntu"
|
||||
alias labhost="ssh labhost"
|
||||
|
||||
alias serverhost="ssh -p 3032 lucas@someoneslinux.ddns.net"
|
||||
alias WC="bash /home/lucas/scripts/serverhost/WallpaperChangerServer.sh"
|
||||
alias winboot="sudo efibootmgr --bootnext 0001 && sudo /usr/sbin/reboot"
|
||||
fi
|
||||
|
||||
if [[ "${HOST}" == "quiethost" ]] || [[ "${HOST}" == "vivohost" ]]; then
|
||||
DEFAULT_SUBNET=11
|
||||
if [ "${HOST}" == "quiethost" ]; then
|
||||
DEFAULT_SUBNET=0
|
||||
fi
|
||||
alias tcmcli="/usr/bin/python3 ~/git/calibration_gui/supportScripts/send_cli_command_lucas.py"
|
||||
raspi() { x=$(echo $1 | grep -o '\.' | wc -l) ; if [[ $x -le 0 ]]; then ssh -X raspi@192.168.$DEFAULT_SUBNET.$1; elif [[ $x -eq 1 ]]; then ssh raspi@192.168.$1; elif [[ $x -eq 2 ]] ; then ssh raspi@192.$1; elif [[ $x -eq 3 ]]; then ssh raspi@$1; fi }
|
||||
fi
|
||||
dircreate() {
|
||||
for file in *; do
|
||||
[ -f "$file" ] || continue
|
||||
|
||||
dirname="${file%.*}"
|
||||
|
||||
# If no extension exists, use the full filename
|
||||
[ "$dirname" = "$file" ] && dirname="$file"
|
||||
|
||||
mkdir -p "$dirname"
|
||||
mv "$file" "$dirname/"
|
||||
done
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user