All you need is #!/bin/bash
Zsh, also called the Z shell, is an extended version of the Bourne Shell, with plenty of new features and support for plugins and themes.
#!/bin/bash
# It automates the git, commit, and push process (.local/bin/gitpush.sh)
cd ~/dotfiles
git add .
echo 'Enter the commit message:'
read commitMessage
git commit -m "$commitMessage"
git push
#!/bin/bash
# Script to extract files, view images, read plain text files, play music, etc.
#!/bin/bash
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.tar.xz) tar zxvf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.xz) xz -d $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.pdf) evince $1 ;; # sudo pacman -S feh evince
*.mov|*.avi|*.mpeg|*.mpg|*.flv|*.wmv|*.mp4|*.mp3) vlc $1 ;;
*.doc|*.docx|*.xls|*.xlsx|*.ppt|*.pptx|*.odf) libreoffice $1 ;;
*.txt|*.conf|*.sh|*.py|*.hs) atom --no-sandbox $1;;
*.png | *.jpeg | *.jpg) feh $1;;
*) xdg-open $1 ;;
esac
else
echo "'$1' is not recognized as a compressed file"
fi
aurpkgs="bpytop deadbeef"
for pkg in $aurpkgs; do
git clone "https://aur.archlinux.org/$pkg.git"
cd $pkg
makepkg -si
cd ..
rm -rf $pkg
done
#!/bin/sh
USER=yourUser # Your hosting's username
HOST=yourHostingIPAddress # Your hosting's IP address
DIR=httpdocs/ # The directory where your website files should go, i.e., the web server root of your website
SECONDS=0
rm -r ./public
hugo # It builds the public folder.
duration=$SECONDS # It returns a count of the number of seconds the shell has been running.
echo "$(($duration / 60)) minutes and $(($duration % 60)) seconds took the task."
rsync --compress --recursive --verbose --checksum --delete -e 'ssh -p 2222' --delete public/ ${USER}@${HOST}:~/${DIR}
The syntax is rsync OPTIONS SOURCE [USER@]HOST:DEST.
You can also use this script to backup in an external hard drive your Hugo proyect: rsync -aAXv ‐‐exclude ‘-cleanDestinationDir’ ‐‐exclude ‘-disableFastRender’ ‐‐delete $HOME/justtothepoint /run/media/nmaximo7/mydisk2/. A trailing slash on a source path (e.g., $HOME/justtothepoint/) means “copy the contents of this directory”. Without a trailing slash it means “copy the directory”.
Credits: Hugo, Deployment with Rsync, Nicholas Whittaker, A pretty Little Bit of Rsync.
More scripts: Bash file converter from (png, jpg, and jpeg) to webp., Scripts for checking broken links., Get information about your Linux system, and Awesome Bash. It is a curated list of delightful Bash scripts and resources.