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-helpersis the name of the repository and the folder name where this repository is cloned.helper-scriptsis that place where you place yourpersonal.shbash 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-nameformat. - Run
sudo sucommand(enter into the sudo user mode). Enter sudo user password when prompted.
- Run
sudo apt-get updatecommand. - Run
sudo apt-get install gitcommand to install git package. - Run
exitcommand 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.gitHere $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-scriptsAfter 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.shThen 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;
EOFsource ~/.bash_aliases- Run
admincommand(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_aliasesfrom 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 ~/.bashrccommand. - 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_aliasesstep. Place the following script at the end of~/.zshrcfile. 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
zshshell does not appear in terminal after rebooting or opening a new terminal. And add a line with just onlyzshstring on a new line at the end of~/.bash_aliasesfile. Then runsource ~/.zshrc. - Run
exitcommand. - Restart machine.
- Cheers! You're all set.
- To update this
bash-helpersrepository continually, runbash_helpers_fetchcommand 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_aliasesstep. Place the following script at the end of~/.zshrcfile. 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
zshshell does not appear in terminal after rebooting or opening a new terminal. And add a line with just onlyzshstring on a new line at the end of~/.bash_aliasesfile. 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
uapto update systems daily for non sudo user(s). Anduarcommand for sudo user(s), for example:rootuser. Theuapcommand will ensure the daily pull for latest changes on repositories that resides in~/Gitreposfolder, sync youtube music videos and replace files from sources to destinations. To useuapcommand, 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.pyfile tolocal_settings.pyfile. Override property values inlocal_settings.pyaccording 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.