Bash helper scripts for system package installation and python/nodejs developers. MIT license, hell yeah!
Intended to help software engineers working on python/django and nodejs environment. The scripts that were used below are only on Ubuntu 16.04 LTS, Ubuntu 18.04 LTS, Ubuntu Core 16.04 LTS. There will be no OS version specific package changes on installation script until Ubuntu 20.04 LTS release.
Legends:
bash-helpers
is the name of the repository and the folder name where this repository is cloned.helper-scripts
is that place where you place yourpersonal.sh
bash files as well as your other scripts that are meant to customize your local machine environment.
For usage instruction with new OS installations, follow these instructions.
Open terminal.
- Create Gitrepos folder in the user directory. Path will look like this: /home/$SYSTEM_USER_NAME/Gitrepos/. Here $SYSTEM_USER_NAME denotes the user name of the operating system(Ubuntu in this case) user, which is not the default root user. Create the folder using this command:
mkdir -p ~/Gitrepos
. If you are not sure about OS username, its the name that appears when login. To be sure, you can open up Terminal and see the username there. It'll be inusername@machine-name
format. - Run
sudo su
command(enter into the sudo user mode). Enter sudo user password when prompted.
- Run
sudo apt-get update
command. - Run
sudo apt-get install git
command to install git package. - Run
exit
command to exit from sudo mode user.
- Clone Bash Helper's Repository in Gitrepos folder by running following commands:
cd /home/$SYSTEM_USER_NAME/Gitrepos/
git clone https://github.com/0PEIN0/bash-helpers.git
Here $SYSTEM_USER_NAME denotes the user name of the operating system(Ubuntu in this case) user, which is not the default root user.
- After cloning, create a new directory again inside of user directory. Path will look like this: /home/$SYSTEM_USER_NAME/helper-scripts/. Here $SYSTEM_USER_NAME denotes the user name of the operating system(Ubuntu in this case) user, which is not the default root user. Create this directory by running the following command:
mkdir -p ~/helper-scripts
After you have created this folder, create a new file there(inside the newly created folder) called personal.sh and copy the file contents from sample-personal.sh file from the current repository to /home/$SYSTEM_USER_NAME/helper-scripts/personal.sh file. Run the following command to do so:
cp -f ~/Gitrepos/bash-helpers/src/bash/sample-personal.sh ~/helper-scripts/personal.sh
Then just open up personal.sh file by running gedit ~/helper-scripts/personal.sh
command and configure your info in personal.sh file like this:
SYSTEM_USER_FULL_NAME="John Doe"
SYSTEM_USER_EMAIL="john@example.com"
SYSTEM_USER_NAME="john"
DEFAULT_PERMISSION_VALUE=775
- Add the import of the /home/$SYSTEM_USER_NAME/helper-scripts/personal.sh file in ~/.bash_aliases file. Then source it.
cat <<EOF > ~/.bash_aliases
if [ -f /home/$USER/helper-scripts/personal.sh ]; then
. /home/$USER/helper-scripts/personal.sh
fi;
EOF
source ~/.bash_aliases
- Run
admin
command(enter into the sudo user mode). Enter sudo user password when prompted.
- Open ~/.bash_aliases file and add the import of the /home/$SYSTEM_USER_NAME/helper-scripts/personal.sh file there. Then source it. Run
gedit ~/.bash_aliases
from command line to open up the file. Below is a sample example for import of personal bash file in ~/.bash_aliases file. Remember to replace the $SYSTEM_USER_NAME string here with actual operating system username.
if [ -f /home/$SYSTEM_USER_NAME/helper-scripts/personal.sh ]; then
. /home/$SYSTEM_USER_NAME/helper-scripts/personal.sh
fi;
- Run
source ~/.bashrc
command. - Assuming you have ZSH shell setup, run
gedit ~/.zshrc
(change the zsh theme to "agnoster", or any of your preferred theme, and add the reference to personal bash file as well located in bash-dump folder). Same operation asgedit ~/.bash_aliases
step. Place the following script at the end of~/.zshrc
file. Remember to replace the $SYSTEM_USER_NAME string here with actual operating system username.
if [ -f /home/$SYSTEM_USER_NAME/helper-scripts/personal.sh ]; then
. /home/$SYSTEM_USER_NAME/helper-scripts/personal.sh
fi;
- Optional Step Assuming you have ZSH shell setup, do this only if
zsh
shell does not appear in terminal after rebooting or opening a new terminal. And add a line with just onlyzsh
string on a new line at the end of~/.bash_aliases
file. Then runsource ~/.zshrc
. - Run
exit
command. - Restart machine.
- Cheers! You're all set.
- To update this
bash-helpers
repository continually, runbash_helpers_fetch
command time to time.
- Assuming you have ZSH shell setup, run
gedit ~/.zshrc
(change the zsh theme to "agnoster", or any of your preferred theme, and add the reference to personal bash file as well located in bash-dump folder). Same operation asgedit ~/.bash_aliases
step. Place the following script at the end of~/.zshrc
file. Remember to replace the $SYSTEM_USER_NAME string here with actual operating system username.
if [ -f /home/$SYSTEM_USER_NAME/helper-scripts/personal.sh ]; then
. /home/$SYSTEM_USER_NAME/helper-scripts/personal.sh
fi;
- Optional Step Assuming you have ZSH shell setup, do this only if
zsh
shell does not appear in terminal after rebooting or opening a new terminal. And add a line with just onlyzsh
string on a new line at the end of~/.bash_aliases
file. Then runsource ~/.zshrc
. - Assuming you have ZSH shell setup, run
source ~/.zshrc
. If you see some weird bash error when sourcing, just ignore it. It should be fixed after restarting the machine.
- Estimated total installation time is 2-5 hours for fresh new OS installation, although it will vary based on machine and network connection performance.
- Use command
uap
to update systems daily for non sudo user(s). Anduar
command for sudo user(s), for example:root
user. Theuap
command will ensure the daily pull for latest changes on repositories that resides in~/Gitrepos
folder, sync youtube music videos and replace files from sources to destinations. To useuap
command, first create a new file insrc/python/
directory of current repository. Then add a file calledlocal_settings.py
. Yes, exactly this file name. After creating the file copy contents fromsample_local_settings.py
file tolocal_settings.py
file. Override property values inlocal_settings.py
according to your necessity. - For further OS customization, you can take a look into this file. This is a personalized OS environment file for myself, but you might get some idea as to what some of the customizations may look like.