ubuntu_machine is a repo that aims to replicate the installation of my current ubuntu-based distro.
there is a collection of useful tools for installing packages, extracting config and common files (like an edited .bashrc and a themes directory) and backing-up directories.
- Installation
- Repo Components
- Bashrc Functions
- Bashrc Environment Variables and added paths to PATH Environment Variables
- Scripts
It can be simply installed and used by cloning the repo
git clone https://github.com/allonios/ubuntu-machine.git
cd ubuntu_machine
.bash_aliases
: contains a some aliases that I find useful.
.bashrc
: a .bashrc containing useful functions, pre-added env vars for common tools and small interface edits.
fonts
: containing fonts that will be added to the system (current only JetBrains-Mono, more fonts can be added by the
user).
Pycharm Settings
: contains backed-up pycharm settings
run.sh
: runs all the scripts in the scripts directory (not recommended due to some unstable scripts).
scripts
: contains scripts to execute certain functionalities, more here.
theme.json
: a vscode theme (monokai), used for babi editor.
the included .bashrc
contains the following functions:
used to create a directory then enter that directory, basically mkdir
and then cd
that directory.
TODO: support arguments for
mkdir
andcd
commands.
used to upload files to kn-transfer
used to activate python virtual environment by providing its base directory.
not providing a directory will presume the name .venv
as a base directory.
used to run a tensorflow docker container and start a jupyter notebook.
used to run a tensorflow docker container and attach that to bash.
used to run openvpn based on a configuration file
unfortunately right now the configuration is considered to be a bit on the fixed side, but still simple enough and can be configured using the following instructions:
- in the cloned repo, create a folder called VPN.
- place your vpn config file there + a text file containing username and password if it exists.
- in the openvpn config file add the following options for password:
auth-user-pass path/to/password/text/file.
- in .bashrc edit vpn function to run your password example: configuration file called vpn-x.ovpn can be added like the following
if [ $1 == "x" ] || [ $1 == "X" ];
then
sudo openvpn --config ~/ubuntu_machine/VPN/vpn-x.ovpn --daemon
running vpn x
or vpn X
will start the vpn file.
running vpn st
will show the current status for the vpn (on or off).
running vpn off
or vpn stop
with kill the openvpn process.
used to run a VPN before pushing to a git remote.
configured in the same manner as vpn
command.
NOTE: the cloned repo should be in the home directory.
TODO: enhance configuration process using environment variables.
the following Environment Variables where added:
NVM_DIR
PYENV_ROOT
NLTK_DATA
the following paths where added to PATH:
PYENV_ROOT
("$HOME/.pyenv"
)- path for anaconda3.
- path for golang.
- path for dotnet.
- path for babi editor.
each element in the scripts directory serves a certain functionality, and will be explained briefly here.
python3
used to backup certain directory or directories using a configuration json file.
the specified directory will be compressed and copied to a destination directory.
each attribute in the root object represents a directory path to backup.
this attribute (directory path) should specify an object that represents settings for the backup process.
{
"dir1/to/backup": {
"zip_filename": "dir1.zip",
"destination": "dist/path/",
"skip_existing": false
},
"dir2/to/backup": {
"zip_filename": "dir2.zip",
"destination": "dist/path/",
"skip_existing": true
}
}
directory object attributes:
Attribute | Type | Description |
---|---|---|
zip_filename |
strings | used to specify compressed directory filename |
destination |
string | represents backup destination (where the zip file will be copied) |
skip_existing |
bool | if true, skip the directory if it exists in the destination path |
run backup_from_config.py
to execute.
snap store:
sudo apt install snapd
used to install some common apps like:
- diodon (clipboard manager).
- VLC player.
- qbittorrent.
- SSR (simplescreenrecorder).
- and few more
NOTE: not recommended to blind-run, use what you need.
None
used to create ssh key using default settings.
None
used to install some common DBMS like:
- mariadb.
- sqlite.
- postgresql.
- mongodb.
NOTE: not recommended to blind-run, use what you need.
None
used to install docker and docker-compose, and adds docker to a sudoer group.
None
used to install dotnet sdk and runtime version 6.
NOTE: it is recommended to check for a newer version.
openjdk-8 (installation included)
used to install elasticsearch search engine version 5.
NOTE: it is recommended to check for a newer version.
None
used to install some elementary os terminal and files apps.
snap store:
sudo apt install snapd
used to install flutter sdk.
- nvidia-docker2 (installation included).
- docker (installation not included, please refer to docker).
used to install a docker image for tensorflow with gpu support.
None
used to install kite engine for code completion.
python3
used to install main packages that every system needs, the packages are mainly aimed for python development, all puthon
packages can be found under the python
, pyenv
and tkinter
sections in the script.
it has a bonus functionality that adds some useful git aliases.
nvm (installation included).
used to install node LTS version via nvm.
None
used to apply some settings configuration after main packages installation like setting terminal font, minimize windows on icon click and time sync with windows on dual boot systems.
None
used to install tensorflow with gpu support.
NOTE: not recommended to use, outdated and really hard to get right, using a docker image is recommended instead.
- nvidia-container-runtime (installation included).
- PopOS.
used to install tensorman for managing tensorflow docker images on PopOS.
None
used to unpack the following:
- edited .bashrc and .bash_aliases
- .themes directory.
- babi editor theme.
None
used to install windscribe vpn cli tool.
NOTE: windscribe cli tool is deprecated, it is recommended to use gui instead.