Academia JavaEE Workspace in Ubuntu: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
Line 230: Line 230:
* [https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04 Install Docker on Ubuntu 20.04]
* [https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04 Install Docker on Ubuntu 20.04]
* [https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04 Install Docker on Ubuntu 18.04]
* [https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04 Install Docker on Ubuntu 18.04]
* [https://help.ubuntu.com/kubuntu/desktopguide/C/manual-install.html Debian Package Manual Install]
* [[LAMP Stack for PI]]
* [[LAMP Stack for PI]]
* [[LAPP Stack for PI]]
* [[LAPP Stack for PI]]


|}
|}

Revision as of 05:24, 12 April 2021

Java

apt install openjdk-8-jdk-headless
apt install nodejs
apt install maven
apt install npm
apt install ant

PostgreSQL

Install

apt install postgresql postgresql-contrib
createuser $USER
createdb $USER

Schema

CREATE DATABASE academia;
CREATE USER academia WITH ENCRYPTED PASSWORD 'academia';
GRANT ALL PRIVILEGES ON DATABASE academia TO academia;
psql academia < academia.sql
psql -h db00.chorke.org -p 5432 -d academia -U academia
psql -h db00.chorke.org -p 5432 -d academia -U academia -W -f academia.sql
pg_restore -h db00.chorke.org -p 5432 -d academia -U academia academia.dump

Delete

REVOKE CONNECT ON DATABASE academia FROM public;
SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity
WHERE pg_stat_activity.datname in ('academia');
ps -ef | grep postgres
kill -9 PID
DROP DATABASE IF EXISTS academia;

PgAdmin4

sudo apt install curl
sudo apt install apache2

curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add
sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > \
/etc/apt/sources.list.d/pgadmin4.list && apt update'

sudo apt install pgadmin4-web
sudo /usr/pgadmin4/bin/setup-web.sh

Redis

apt install redis-server
nano /etc/redis/redis.conf
: <<'END_COMMENT'
# If you run Redis from upstart or systemd, Redis can interact with your
# supervision tree. Options:
#   supervised no      - no supervision interaction
#   supervised upstart - signal upstart by putting Redis into SIGSTOP mode
#   supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET
#   supervised auto    - detect upstart or systemd method based on
#                        UPSTART_JOB or NOTIFY_SOCKET environment variables
# Note: these supervision methods only signal "process is ready."
#       They do not enable continuous liveness pings back to your supervisor.
supervised systemd
END_COMMENT
systemctl status redis-server

Workspace

mkdir -p $HOME/chorke
mkdir -p /opt/dev/$USER/chorke/academia
chown $USER:$USER -R /opt/dev/$USER

export ACADEMIA_WSS="$HOME/chorke/academia"
ln -s /opt/dev/$USER/chorke/academia $ACADEMIA_WSS
ls -lah $HOME/chorke
nano ~/.bashrc

Editor

sudo apt install apt-transport-https
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt update;sudo apt install sublime-text
sudo snap install notepad-plus-plus

Git SCM

ssh-keygen -t rsa -b 4096 -C "[email protected]"
: <<'END_COMMENT'
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa): /home/user/.ssh/git_academia_chorke_org_rsa
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/user/.ssh/git_academia_chorke_org_rsa
Your public key has been saved in /home/user/.ssh/git_academia_chorke_org_rsa.pub
The key fingerprint is:
SHA256:TXBbBINcPcVtdVFRjs/P+jaxMFAIwr3uqdlt8tmrLVQ [email protected]
The key's randomart image is:
+---[RSA 4096]----+
|      .oo+*++o.+@|
|       .++ =o..o+|
|          + .....|
|         + . E o |
|        S . o   o|
|         . . o o.|
|        . o   o =|
|        o+.o+  +.|
|       o..+=o+ooo|
+----[SHA256]-----+
END_COMMENT
ls -lah ~/.ssh/
cat < ~/.ssh/git_academia_chorke_org_rsa.pub
nano ~/.ssh/config
: <<'END_COMMENT'
Host git.academia.chorke.org
     HostName git.academia.chorke.org
     PreferredAuthentications publickey
     IdentityFile ~/.ssh/git_academia_chorke_org_rsa
     User git
END_COMMENT
git config --global user.email "[email protected]"
git config --global user.name "FULL NAME"
ssh -vT git.academia.chorke.org

Docker

sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
sudo apt update

apt-cache policy docker-ce
sudo apt install docker-ce
sudo systemctl status docker

#sudo usermod -aG docker academia
sudo usermod -aG docker ${USER}
su - ${USER}
id -nG

Knowledge

sudo apt install ~/Downloads/TIB_js-studiocomm_6.16.0_linux_amd64.deb 
sudo apt install ~/Downloads/anydesk_6.0.1-1_amd64.deb
sudo apt --fix-broken install
sudo apt install jq

snap install telegram-sergiusens
snap install notepad-plus-plus
snap install skype --classic
apt  install net-tools
snap install postman

ls -lah ~/.local/share/applications/
ls -lah ~/.config/autostart/
ls -lah ~/.local/share/

rm -rf ~/.local/share/applications/jetbrains-toolbox.desktop
rm -rf ~/.config/autostart/jetbrains-toolbox.desktop
rm -rf ~/.local/share/JetBrains/Toolbox
git stashing
git stash; git checkout -b new_branch; git stash pop
git add .; git commit -m "new feature added"; git push 
#nano ~/.bashrc
#nano ~/.zshenv
#nano ~/.profile
#nano ~/.bash_profile
export ACADEMIA_WSS="$HOME/chorke/academia"
export ACADEMIA_LOG_PATH="$HOME/.chorke/academia/var/http/logs"
source ~/.bashrc
source ~/.profile
source ~/.bash_profile

source ~/.zshenv
source ~/.zprofile/.zlogin
ssh-keygen -p -f ~/.ssh/git_academia_chorke_org_rsa
: <<'END_COMMENT'
Enter old passphrase: 
Key has comment '[email protected]'
Enter new passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved with the new passphrase.
END_COMMENT

References