Academia JavaEE Workspace in Ubuntu: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
Line 10: Line 10:


==JetBrains Toolbox==
==JetBrains Toolbox==
<source lang="bash">
<syntaxhighlight lang="bash">
wget -cq https://download-cdn.jetbrains.com/toolbox/jetbrains-toolbox-1.27.2.13801.tar.gz -P ${HOME}/Downloads
wget -cq https://download-cdn.jetbrains.com/toolbox/jetbrains-toolbox-1.27.2.13801.tar.gz -P ${HOME}/Downloads
tar -xzf ${HOME}/Downloads/jetbrains-toolbox-1.27.2.13801.tar.gz -C ${HOME}/Downloads
tar -xzf ${HOME}/Downloads/jetbrains-toolbox-1.27.2.13801.tar.gz -C ${HOME}/Downloads
Line 18: Line 18:
${HOME}/Downloads/jetbrains-toolbox-1.27.2.13801/jetbrains-toolbox
${HOME}/Downloads/jetbrains-toolbox-1.27.2.13801/jetbrains-toolbox
rm -rf ${HOME}/Downloads/jetbrains-toolbox-1.27.2.13801
rm -rf ${HOME}/Downloads/jetbrains-toolbox-1.27.2.13801
</source>
</syntaxhighlight>


==Spring Tool Suite==
==Spring Tool Suite==
<source lang="bash">
<syntaxhighlight lang="bash">
sudo mkdir -p /opt/ide
sudo mkdir -p /opt/ide
sudo wget -cq https://download.springsource.com/release/STS4/4.20.0.RELEASE/dist/e4.29/spring-tool-suite-4-4.20.0.RELEASE-e4.29.0-linux.gtk.x86_64.tar.gz -P /opt/ide
sudo wget -cq https://download.springsource.com/release/STS4/4.20.0.RELEASE/dist/e4.29/spring-tool-suite-4-4.20.0.RELEASE-e4.29.0-linux.gtk.x86_64.tar.gz -P /opt/ide
Line 29: Line 29:
# https://projectlombok.org/setup/eclipse
# https://projectlombok.org/setup/eclipse
sudo java -jar ~/Downloads/lombok.jar
sudo java -jar ~/Downloads/lombok.jar
</source>
</syntaxhighlight>


<source lang="ini">
<syntaxhighlight lang="ini">
cat << EOF | sudo tee /usr/share/applications/SpringToolSuite4.desktop >>/dev/null
cat << EOF | sudo tee /usr/share/applications/SpringToolSuite4.desktop >>/dev/null
[Desktop Entry]
[Desktop Entry]
Line 44: Line 44:
Categories=Development;IDE;Java;
Categories=Development;IDE;Java;
EOF
EOF
</source>
</syntaxhighlight>


==Camunda==
==Camunda==
<source lang="bash">
<syntaxhighlight lang="bash">
sudo mkdir -p /opt/ide
sudo mkdir -p /opt/ide
sudo wget -cq https://downloads.camunda.cloud/release/camunda-modeler/5.7.0/camunda-modeler-5.7.0-linux-x64.tar.gz -P /opt/ide
sudo wget -cq https://downloads.camunda.cloud/release/camunda-modeler/5.7.0/camunda-modeler-5.7.0-linux-x64.tar.gz -P /opt/ide
Line 55: Line 55:
sudo wget -cq https://camunda.com/wp-content/uploads/2022/02/Secondary-Logo_Rounded-Black-300x300.png\
sudo wget -cq https://camunda.com/wp-content/uploads/2022/02/Secondary-Logo_Rounded-Black-300x300.png\
  -O /opt/ide/camunda-modeler-5.7.0-linux-x64/camunda-modeler.png
  -O /opt/ide/camunda-modeler-5.7.0-linux-x64/camunda-modeler.png
</source>
</syntaxhighlight>


<source lang="ini">
<syntaxhighlight lang="ini">
cat << EOF | sudo tee /usr/share/applications/CamundaModeler.desktop >>/dev/null
cat << EOF | sudo tee /usr/share/applications/CamundaModeler.desktop >>/dev/null
[Desktop Entry]
[Desktop Entry]
Line 70: Line 70:
Categories=Development;IDE;BPMN;
Categories=Development;IDE;BPMN;
EOF
EOF
</source>
</syntaxhighlight>


==JMeter==
==JMeter==
<source lang="bash">
<syntaxhighlight lang="bash">
sudo mkdir -p /opt/ide
sudo mkdir -p /opt/ide
sudo wget -cq https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-5.5.tgz -P /opt/ide
sudo wget -cq https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-5.5.tgz -P /opt/ide
sudo tar -xzf /opt/ide/apache-jmeter-5.5.tgz -C /opt/ide
sudo tar -xzf /opt/ide/apache-jmeter-5.5.tgz -C /opt/ide
sudo rm  -rf  /opt/ide/apache-jmeter-5.5.tgz
sudo rm  -rf  /opt/ide/apache-jmeter-5.5.tgz
</source>
</syntaxhighlight>


<source lang="ini">
<syntaxhighlight lang="ini">
cat << EOF | sudo tee /usr/share/applications/jmeter.desktop >>/dev/null
cat << EOF | sudo tee /usr/share/applications/jmeter.desktop >>/dev/null
[Desktop Entry]
[Desktop Entry]
Line 94: Line 94:
Categories=Development;IDE;Java;
Categories=Development;IDE;Java;
EOF
EOF
</source>
</syntaxhighlight>


==PostgreSQL==
==PostgreSQL==
===Install===
===Install===
----
----
<source lang="bash">
<syntaxhighlight lang="bash">
sudo apt install postgresql postgresql-contrib
sudo apt install postgresql postgresql-contrib
sudo systemctl enable postgresql
sudo systemctl enable postgresql
Line 105: Line 105:
sudo systemctl start  postgresql
sudo systemctl start  postgresql
sudo systemctl daemon-reload
sudo systemctl daemon-reload
</source>
</syntaxhighlight>


<source lang="sql">
<syntaxhighlight lang="sql">
sudo -i -u postgres bash << EOF
sudo -i -u postgres bash << EOF
createuser ${USER}
createuser ${USER}
Line 115: Line 115:
DDL
DDL
EOF
EOF
</source>
</syntaxhighlight>


<source lang="bash">
<syntaxhighlight lang="bash">
pg_lsclusters
pg_lsclusters
less /var/log/postgresql/postgresql-14-main.log
less /var/log/postgresql/postgresql-14-main.log
Line 123: Line 123:
sudo pg_createcluster --start 14 mycluster
sudo pg_createcluster --start 14 mycluster
sudo pg_dropcluster    --stop 14 mycluster
sudo pg_dropcluster    --stop 14 mycluster
</source>
</syntaxhighlight>


===Schema===
===Schema===
----
----
<source lang="sql">
<syntaxhighlight lang="sql">
sudo -i -u postgres bash << EOF
sudo -i -u postgres bash << EOF
cat << DDL | psql
cat << DDL | psql
Line 140: Line 140:
DCL
DCL
EOF
EOF
</source>
</syntaxhighlight>


  psql chorke_academia_staging < chorke_academia_staging.sql
  psql chorke_academia_staging < chorke_academia_staging.sql
Line 149: Line 149:
===Revoke===
===Revoke===
----
----
<source lang="sql">
<syntaxhighlight lang="sql">
sudo -i -u postgres bash << EOF
sudo -i -u postgres bash << EOF
cat << DCL | psql
cat << DCL | psql
Line 155: Line 155:
DCL
DCL
EOF
EOF
</source>
</syntaxhighlight>


===Delete===
===Delete===
Line 162: Line 162:
  kill -9 PID
  kill -9 PID


<source lang="sql">
<syntaxhighlight lang="sql">
sudo -i -u postgres bash << EOF
sudo -i -u postgres bash << EOF
cat << DQL | psql
cat << DQL | psql
Line 175: Line 175:
DDL
DDL
EOF
EOF
</source>
</syntaxhighlight>


===DBeaver===
===DBeaver===
<source lang="bash">
<syntaxhighlight lang="bash">
sudo snap install dbeaver-ce
sudo snap install dbeaver-ce


Line 191: Line 191:
  https://dbeaver.io/debs/dbeaver-ce /
  https://dbeaver.io/debs/dbeaver-ce /
EOF
EOF
</source>
</syntaxhighlight>


===PgAdmin4===
===PgAdmin4===
----
----
<source lang="bash">
<syntaxhighlight lang="bash">
sudo apt install curl
sudo apt install curl
sudo apt install apache2
sudo apt install apache2
Line 216: Line 216:
sudo apt install pgadmin4-web
sudo apt install pgadmin4-web
sudo /usr/pgadmin4/bin/setup-web.sh
sudo /usr/pgadmin4/bin/setup-web.sh
</source>
</syntaxhighlight>


<source lang="bash">
<syntaxhighlight lang="bash">
a2enmod ssl
a2enmod ssl
a2enmod proxy
a2enmod proxy
a2enmod proxy_http
a2enmod proxy_http
a2enmod proxy_balancer
a2enmod proxy_balancer
</source>
</syntaxhighlight>


==Sencha CMD==
==Sencha CMD==
<source lang="bash">
<syntaxhighlight lang="bash">
unzip SenchaCmd-7.5.1.20-linux-amd64.sh.zip  
unzip SenchaCmd-7.5.1.20-linux-amd64.sh.zip  
sudo sh SenchaCmd-7.5.1.20-linux-amd64.sh  
sudo sh SenchaCmd-7.5.1.20-linux-amd64.sh  
Line 245: Line 245:


sencha diag show
sencha diag show
</source>
</syntaxhighlight>


==Redis==
==Redis==
<source lang="bash" highlight="13">
<syntaxhighlight lang="bash" highlight="13">
apt install redis-server
apt install redis-server
nano /etc/redis/redis.conf
nano /etc/redis/redis.conf
Line 264: Line 264:
END_COMMENT
END_COMMENT
systemctl status redis-server
systemctl status redis-server
</source>
</syntaxhighlight>


==Workspace==
==Workspace==
<source lang="bash">
<syntaxhighlight lang="bash">
mkdir -p $HOME/chorke
mkdir -p $HOME/chorke
mkdir -p /opt/dev/$USER/chorke/academia
mkdir -p /opt/dev/$USER/chorke/academia
Line 276: Line 276:
ls -lah $HOME/chorke
ls -lah $HOME/chorke
nano ~/.bashrc
nano ~/.bashrc
</source>
</syntaxhighlight>


==Editor==
==Editor==
===Install Sublime===
===Install Sublime===
----
----
<source lang="bash">
<syntaxhighlight lang="bash">
sudo apt install curl apt-transport-https
sudo apt install curl apt-transport-https
# wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
# wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
Line 297: Line 297:
sudo apt update;sudo apt install sublime-text
sudo apt update;sudo apt install sublime-text
sudo snap install notepad-plus-plus
sudo snap install notepad-plus-plus
</source>
</syntaxhighlight>


===Install & Config Tmux===
===Install & Config Tmux===
----
----
<source lang="bash">
<syntaxhighlight lang="bash">
sudo apt install tmux
sudo apt install tmux


Line 322: Line 322:
unbind %
unbind %
EOF
EOF
</source>
</syntaxhighlight>


==Git SCM==
==Git SCM==
<source lang="bash">
<syntaxhighlight lang="bash">
sudo apt -y install gitk
sudo apt -y install gitk
ssh-keygen -t rsa -b 4096 -C "[email protected]"
ssh-keygen -t rsa -b 4096 -C "[email protected]"
Line 352: Line 352:
ls -lah ~/.ssh/
ls -lah ~/.ssh/
cat < ~/.ssh/git_academia_chorke_org_rsa.pub
cat < ~/.ssh/git_academia_chorke_org_rsa.pub
</source>
</syntaxhighlight>


<source lang="bash">
<syntaxhighlight lang="bash">
nano ~/.ssh/config
nano ~/.ssh/config
: <<'END_COMMENT'
: <<'END_COMMENT'
Line 363: Line 363:
     User git
     User git
END_COMMENT
END_COMMENT
</source>
</syntaxhighlight>


<source lang="bash">
<syntaxhighlight lang="bash">
git config --global user.email "[email protected]"
git config --global user.email "[email protected]"
git config --global user.name "FULL NAME"
git config --global user.name "FULL NAME"
ssh -vT git.academia.chorke.org
ssh -vT git.academia.chorke.org
</source>
</syntaxhighlight>


<source lang="bash">
<syntaxhighlight lang="bash">
# add the new key(s) to known_hosts
# add the new key(s) to known_hosts
ssh-keyscan -H git.academia.chorke.org >> ~/.ssh/known_hosts
ssh-keyscan -H git.academia.chorke.org >> ~/.ssh/known_hosts
Line 377: Line 377:
# remove the old key(s) from known_hosts
# remove the old key(s) from known_hosts
ssh-keygen -R git.academia.chorke.org
ssh-keygen -R git.academia.chorke.org
</source>
</syntaxhighlight>


==Podman==
==Podman==
Line 384: Line 384:
  podman -v
  podman -v


<source lang="bash">
<syntaxhighlight lang="bash">
cat << EOF | sudo tee -a /etc/containers/registries.conf >/dev/null
cat << EOF | sudo tee -a /etc/containers/registries.conf >/dev/null
[registries.search]
[registries.search]
Line 394: Line 394:
podman images
podman images
podman info
podman info
</source>
</syntaxhighlight>


==Vagrant==
==Vagrant==
<source lang="bash">
<syntaxhighlight lang="bash">
curl -fsSL https://apt.releases.hashicorp.com/gpg\
curl -fsSL https://apt.releases.hashicorp.com/gpg\
  | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
  | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
Line 411: Line 411:
sudo apt upgrade && sudo apt install vagrant
sudo apt upgrade && sudo apt install vagrant
vagrant -v
vagrant -v
</source>
</syntaxhighlight>


<source lang="bash">
<syntaxhighlight lang="bash">
sudo apt install -y qemu-kvm virt-manager libvirt-daemon-system virtinst libvirt-clients bridge-utils
sudo apt install -y qemu-kvm virt-manager libvirt-daemon-system virtinst libvirt-clients bridge-utils


Line 428: Line 428:
newgrp libvirt
newgrp libvirt
newgrp kvm
newgrp kvm
</source>
</syntaxhighlight>


<source lang="bash">
<syntaxhighlight lang="bash">
sudo systemctl disable --now libvirt-guests.service
sudo systemctl disable --now libvirt-guests.service
sudo systemctl disable --now virtlogd.service
sudo systemctl disable --now virtlogd.service
Line 441: Line 441:
sudo systemctl disable --now libvirtd-ro.socket
sudo systemctl disable --now libvirtd-ro.socket
sudo systemctl disable --now libvirtd.socket
sudo systemctl disable --now libvirtd.socket
</source>
</syntaxhighlight>


==Docker==
==Docker==
<source lang="bash">
<syntaxhighlight lang="bash">
sudo apt install apt-transport-https ca-certificates curl software-properties-common
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 -
# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Line 469: Line 469:
su - ${USER}
su - ${USER}
id -nG
id -nG
</source>
</syntaxhighlight>


<source lang="bash">
<syntaxhighlight lang="bash">
cat << EOF | sudo tee /etc/docker/daemon.json >/dev/null
cat << EOF | sudo tee /etc/docker/daemon.json >/dev/null
{
{
Line 491: Line 491:
docker run --rm alpine cat /etc/resolv.conf
docker run --rm alpine cat /etc/resolv.conf
docker run --rm alpine cat /etc/hosts
docker run --rm alpine cat /etc/hosts
</source>
</syntaxhighlight>


==LXC==
==LXC==
<source lang="bash">
<syntaxhighlight lang="bash">
sudo apt upgrade && sudo apt autoremove
sudo apt upgrade && sudo apt autoremove
sudo snap install lxd --channel=5.11/stable
sudo snap install lxd --channel=5.11/stable
Line 501: Line 501:
lxc version
lxc version
id -nG
id -nG
</source>
</syntaxhighlight>


<source lang="bash">
<syntaxhighlight lang="bash">
sudo lxd init
sudo lxd init
:'
:'
Line 537: Line 537:
lxc launch images:alpine/3.17 academia &&
lxc launch images:alpine/3.17 academia &&
lxc exec academia sh
lxc exec academia sh
</source>
</syntaxhighlight>


==Arduino==
==Arduino==
Line 543: Line 543:
  sudo snap install arduino
  sudo snap install arduino


<source lang="bash">
<syntaxhighlight lang="bash">
sudo wget -c https://downloads.arduino.cc/arduino-1.8.19-linux64.tar.xz -P /opt/ide/
sudo wget -c https://downloads.arduino.cc/arduino-1.8.19-linux64.tar.xz -P /opt/ide/
sudo tar -xvf /opt/ide/arduino-1.8.19-linux64.tar.xz -C /opt/ide/
sudo tar -xvf /opt/ide/arduino-1.8.19-linux64.tar.xz -C /opt/ide/
Line 551: Line 551:
newgrp dialout
newgrp dialout
id -nG
id -nG
</source>
</syntaxhighlight>


==Qt Creator==
==Qt Creator==
Line 559: Line 559:


==Microsoft==
==Microsoft==
<source lang="bash">
<syntaxhighlight lang="bash">
sudo apt install apt-transport-https\
sudo apt install apt-transport-https\
  ca-certificates curl software-properties-common wget
  ca-certificates curl software-properties-common wget
Line 575: Line 575:
sudo apt upgrade && sudo apt install microsoft-edge-stable
sudo apt upgrade && sudo apt install microsoft-edge-stable
microsoft-edge -version
microsoft-edge -version
</source>
</syntaxhighlight>


==Remote==
==Remote==
Line 586: Line 586:


==DaVinci Resolve==
==DaVinci Resolve==
<source lang="bash">
<syntaxhighlight lang="bash">
wget -cq https://sw.blackmagicdesign.com/DaVinciResolve/v18.1.4/DaVinci_Resolve_18.1.4_Linux.zip\
wget -cq https://sw.blackmagicdesign.com/DaVinciResolve/v18.1.4/DaVinci_Resolve_18.1.4_Linux.zip\
?Key-Pair-Id=${KEY_PAIR_ID}==&Expires=${KEY_EXPIRES} -P ${HOME}/Downloads
?Key-Pair-Id=${KEY_PAIR_ID}==&Expires=${KEY_EXPIRES} -P ${HOME}/Downloads
Line 593: Line 593:
sudo apt install libfuse2 libxcb-cursor0 libxcb-damage0
sudo apt install libfuse2 libxcb-cursor0 libxcb-damage0
sudo ./DaVinci_Resolve_18.1.4_Linux.run -i
sudo ./DaVinci_Resolve_18.1.4_Linux.run -i
</source>
</syntaxhighlight>


==K8s Lens==
==K8s Lens==
<source lang="bash">
<syntaxhighlight lang="bash">
# install from snapcraft
# install from snapcraft
sudo snap install kontena-lens --classic
sudo snap install kontena-lens --classic
Line 612: Line 612:
sudo apt install lens
sudo apt install lens
lens-desktop
lens-desktop
</source>
</syntaxhighlight>


==Knowledge==
==Knowledge==
Line 793: Line 793:
|-
|-
| valign="bottom" |
| valign="bottom" |
<source lang="bash">
<syntaxhighlight lang="bash">
#nano ~/.bashrc
#nano ~/.bashrc
#nano ~/.zshenv
#nano ~/.zshenv
Line 800: Line 800:
export ACADEMIA_WSS="$HOME/chorke/academia"
export ACADEMIA_WSS="$HOME/chorke/academia"
export ACADEMIA_LOG_PATH="$HOME/.chorke/academia/var/http/logs"
export ACADEMIA_LOG_PATH="$HOME/.chorke/academia/var/http/logs"
</source>
</syntaxhighlight>


| valign="bottom" |
| valign="bottom" |
<source lang="bash">
<syntaxhighlight lang="bash">
source ~/.bashrc
source ~/.bashrc
source ~/.profile
source ~/.profile
Line 810: Line 810:
source ~/.zshenv
source ~/.zshenv
source ~/.zprofile/.zlogin
source ~/.zprofile/.zlogin
</source>
</syntaxhighlight>


|-
|-
Line 817: Line 817:
|-
|-
| colspan="2" |
| colspan="2" |
<source lang="bash">
<syntaxhighlight lang="bash">
ssh-keygen -p -f ~/.ssh/git_academia_chorke_org_rsa
ssh-keygen -p -f ~/.ssh/git_academia_chorke_org_rsa
: <<'END_COMMENT'
: <<'END_COMMENT'
Line 826: Line 826:
Your identification has been saved with the new passphrase.
Your identification has been saved with the new passphrase.
END_COMMENT
END_COMMENT
</source>
</syntaxhighlight>


|-
|-

Revision as of 22:06, 23 June 2024

OpenJDK

sudo apt install openjdk-21-jdk
sudo apt install openjdk-17-jdk
sudo apt install openjdk-11-jdk
sudo apt install openjdk-8-jdk
sudo apt install nodejs
sudo apt install maven
sudo apt install npm
sudo apt install ant

JetBrains Toolbox

wget -cq https://download-cdn.jetbrains.com/toolbox/jetbrains-toolbox-1.27.2.13801.tar.gz -P ${HOME}/Downloads
tar -xzf ${HOME}/Downloads/jetbrains-toolbox-1.27.2.13801.tar.gz -C ${HOME}/Downloads
rm  -rf  ${HOME}/Downloads/jetbrains-toolbox-1.27.2.13801.tar.gz
sudo apt update && sudo apt install libfuse2

${HOME}/Downloads/jetbrains-toolbox-1.27.2.13801/jetbrains-toolbox
rm -rf ${HOME}/Downloads/jetbrains-toolbox-1.27.2.13801

Spring Tool Suite

sudo mkdir -p /opt/ide
sudo wget -cq https://download.springsource.com/release/STS4/4.20.0.RELEASE/dist/e4.29/spring-tool-suite-4-4.20.0.RELEASE-e4.29.0-linux.gtk.x86_64.tar.gz -P /opt/ide
sudo tar -xzf /opt/ide/spring-tool-suite-4-4.20.0.RELEASE-e4.29.0-linux.gtk.x86_64.tar.gz -C /opt/ide
sudo rm  -rf  /opt/ide/spring-tool-suite-4-4.20.0.RELEASE-e4.29.0-linux.gtk.x86_64.tar.gz
# https://marketplace.eclipse.org/content/jaspersoft-studio
# https://projectlombok.org/setup/eclipse
sudo java -jar ~/Downloads/lombok.jar
cat << EOF | sudo tee /usr/share/applications/SpringToolSuite4.desktop >>/dev/null
[Desktop Entry]
Name=SpringSource Tool Suite 4
Comment=SpringSource Tool Suite 4
Exec=/opt/ide/sts-4.20.0.RELEASE/SpringToolSuite4
Icon=/opt/ide/sts-4.20.0.RELEASE/icon.xpm
StartupNotify=true
Terminal=false
Type=Application
Keywords=Java,Eclipse,Spring,IDE,Development
Categories=Development;IDE;Java;
EOF

Camunda

sudo mkdir -p /opt/ide
sudo wget -cq https://downloads.camunda.cloud/release/camunda-modeler/5.7.0/camunda-modeler-5.7.0-linux-x64.tar.gz -P /opt/ide
sudo tar -xzf /opt/ide/camunda-modeler-5.7.0-linux-x64.tar.gz -C /opt/ide
sudo rm  -rf  /opt/ide/camunda-modeler-5.7.0-linux-x64.tar.gz

sudo wget -cq https://camunda.com/wp-content/uploads/2022/02/Secondary-Logo_Rounded-Black-300x300.png\
 -O /opt/ide/camunda-modeler-5.7.0-linux-x64/camunda-modeler.png
cat << EOF | sudo tee /usr/share/applications/CamundaModeler.desktop >>/dev/null
[Desktop Entry]
Name=Camunda Modeler 5
Comment=SpringSource Tool Suite 4
Exec=/opt/ide/camunda-modeler-5.7.0-linux-x64/camunda-modeler
Icon=/opt/ide/camunda-modeler-5.7.0-linux-x64/camunda-modeler.png
StartupNotify=true
Terminal=false
Type=Application
Keywords=Camunda,Modeler,BPMN,IDE,Development
Categories=Development;IDE;BPMN;
EOF

JMeter

sudo mkdir -p /opt/ide
sudo wget -cq https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-5.5.tgz -P /opt/ide
sudo tar -xzf /opt/ide/apache-jmeter-5.5.tgz -C /opt/ide
sudo rm  -rf  /opt/ide/apache-jmeter-5.5.tgz
cat << EOF | sudo tee /usr/share/applications/jmeter.desktop >>/dev/null
[Desktop Entry]
Version=5.5
Terminal=false
Type=Application
Name=Apache JMeter
StartupNotify=false
Comment=Apache JMeter
Exec=/opt/ide/apache-jmeter-5.5/bin/jmeter.sh
Icon=/opt/ide/apache-jmeter-5.5/docs/images/jmeter_square.png
Keywords=Java,JMeter,Development
Categories=Development;IDE;Java;
EOF

PostgreSQL

Install


sudo apt install postgresql postgresql-contrib
sudo systemctl enable postgresql
sudo systemctl status postgresql
sudo systemctl start  postgresql
sudo systemctl daemon-reload
sudo -i -u postgres bash << EOF
createuser ${USER}
createdb   ${USER}
cat << DDL | psql
ALTER USER ${USER} WITH SUPERUSER;
DDL
EOF
pg_lsclusters
less /var/log/postgresql/postgresql-14-main.log

sudo pg_createcluster --start 14 mycluster
sudo pg_dropcluster    --stop 14 mycluster

Schema


sudo -i -u postgres bash << EOF
cat << DDL | psql
CREATE DATABASE chorke_academia_staging;
CREATE USER chorke WITH ENCRYPTED PASSWORD 'sadaqah!';
DDL
EOF

sudo -i -u postgres bash << EOF
cat << DCL | psql
GRANT ALL PRIVILEGES ON DATABASE chorke_academia_staging TO chorke;
DCL
EOF
psql chorke_academia_staging < chorke_academia_staging.sql
psql -h db00.chorke.org -p 5432 -d chorke_academia_staging -U chorke
psql -h db00.chorke.org -p 5432 -d chorke_academia_staging -U chorke -W -f chorke_academia_staging.sql
pg_restore -h db00.chorke.org -p 5432 -d chorke_academia_staging -U chorke chorke_academia_staging.dump

Revoke


sudo -i -u postgres bash << EOF
cat << DCL | psql
REVOKE CONNECT ON DATABASE chorke_academia_staging FROM public;
DCL
EOF

Delete


ps -ef | grep postgres
kill -9 PID
sudo -i -u postgres bash << EOF
cat << DQL | psql
SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity 
WHERE pg_stat_activity.datname in ('chorke_academia_staging');
DQL
EOF

sudo -i -u postgres bash << EOF
cat << DDL | psql
DROP DATABASE IF EXISTS chorke_academia_staging;
DDL
EOF

DBeaver

sudo snap install dbeaver-ce

# register apt-get repository
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://dbeaver.io/debs/dbeaver.gpg.key\
| sudo gpg --dearmor -o /etc/apt/keyrings/dbeaver.gpg.key

cat << EOF | sudo tee /etc/apt/sources.list.d/dbeaver.list >/dev/null
deb [arch=$(dpkg --print-architecture)\
 signed-by=/etc/apt/keyrings/dbeaver.gpg.key]\
 https://dbeaver.io/debs/dbeaver-ce /
EOF

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 mkdir -p /etc/apt/keyrings
curl -fsSL https://www.pgadmin.org/static/packages_pgadmin_org.pub\
| sudo gpg --dearmor -o /etc/apt/keyrings/pgadmin4.gpg

cat << EOF | sudo tee /etc/apt/sources.list.d/pgadmin4.list >/dev/null
deb [arch=$(dpkg --print-architecture)\
 signed-by=/etc/apt/keyrings/pgadmin4.gpg]\
 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main
EOF

sudo apt update
sudo apt install pgadmin4-web
sudo /usr/pgadmin4/bin/setup-web.sh
a2enmod ssl
a2enmod proxy
a2enmod proxy_http
a2enmod proxy_balancer

Sencha CMD

unzip SenchaCmd-7.5.1.20-linux-amd64.sh.zip 
sudo sh SenchaCmd-7.5.1.20-linux-amd64.sh 
export SENCHA_CMD='/opt/cli/sencha/cmd'
export OPENSSL_CONF='/etc/ssl'
export PATH=$PATH:$SENCHA_CMD

mkdir -p ~/.sencha/cmd
cat << EOF > $HOME/.sencha/cmd/sencha.cfg
#------------------------------------------------------------------------------
# The folder for the local package repository. By default, this folder is shared
# by all versions of Sencha Cmd. In other words, upgrading Sencha Cmd does not
# affect the local repository.

repo.local.dir=${HOME}/.sencha/cmd/repo

EOF

sencha diag show

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

Install Sublime


sudo apt install curl 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

curl -fsSL https://download.sublimetext.com/sublimehq-pub.gpg\
| sudo gpg --dearmor -o /usr/share/keyrings/sublimehq-pub.gpg

cat << EOF | sudo tee /etc/apt/sources.list.d/sublime-text.list >/dev/null
deb [arch=$(dpkg --print-architecture)\
 signed-by=/usr/share/keyrings/sublimehq-pub.gpg]\
 https://download.sublimetext.com/ apt/stable/
EOF

sudo apt update;sudo apt install sublime-text
sudo snap install notepad-plus-plus

Install & Config Tmux


sudo apt install tmux

cat << EOF | tee ${HOME}/.tmux.conf >/dev/null
set -g base-index 1
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix

set -g default-terminal 'screen-256color'
set -g history-limit 10000
set -g status-fg  green
set -g status-bg  black

# Window/pane split
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
EOF

Git SCM

sudo apt -y install gitk
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
# add the new key(s) to known_hosts
ssh-keyscan -H git.academia.chorke.org >> ~/.ssh/known_hosts

# remove the old key(s) from known_hosts
ssh-keygen -R git.academia.chorke.org

Podman

sudo apt update
sudo apt install podman
podman -v
cat << EOF | sudo tee -a /etc/containers/registries.conf >/dev/null
[registries.search]
registries=["registry.access.redhat.com", "registry.fedoraproject.org", "docker.io"]
EOF

podman search ubuntu
podman pull ubuntu
podman images
podman info

Vagrant

curl -fsSL https://apt.releases.hashicorp.com/gpg\
 | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
 
 
cat << EOF | sudo tee /etc/apt/sources.list.d/hashicorp.list >/dev/null
deb [arch=$(dpkg --print-architecture)\
 signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg]\
 https://apt.releases.hashicorp.com $(lsb_release -cs) main
EOF

sudo apt update  && sudo apt list  --upgradeable
sudo apt upgrade && sudo apt install vagrant
vagrant -v
sudo apt install -y qemu-kvm virt-manager libvirt-daemon-system virtinst libvirt-clients bridge-utils

sudo systemctl enable  --now libvirt-guests.service
sudo systemctl enable  --now virtlogd.service
sudo systemctl enable  --now libvirtd.service

systemctl status libvirt-guests.service
systemctl status libvirtd.service
systemctl status virtlogd.service

sudo usermod -aG libvirt $USER
sudo usermod -aG kvm $USER
newgrp libvirt
newgrp kvm
sudo systemctl disable --now libvirt-guests.service
sudo systemctl disable --now virtlogd.service
sudo systemctl disable --now libvirtd.service

sudo systemctl disable --now virtlogd-admin.socket
sudo systemctl disable --now virtlogd.socket

sudo systemctl disable --now libvirtd-admin.socket
sudo systemctl disable --now libvirtd-ro.socket
sudo systemctl disable --now libvirtd.socket

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 mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg\
| sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

cat << EOF | sudo tee /etc/apt/sources.list.d/docker.list >/dev/null
deb [arch=$(dpkg --print-architecture)\
 signed-by=/etc/apt/keyrings/docker.gpg]\
 https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable
EOF

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
cat << EOF | sudo tee /etc/docker/daemon.json >/dev/null
{
    "bip"  : "10.20.13.1/24",
    "mtu"  : 1500,
    "dns"  : [
        "8.8.8.8",
        "8.8.4.4"
    ],
    "debug": true
}
EOF

sudo systemctl stop  docker.socket 
sudo systemctl stop  docker.service
sudo systemctl start docker.service

su - ${USER}
docker run --rm alpine cat /etc/resolv.conf
docker run --rm alpine cat /etc/hosts

LXC

sudo apt upgrade && sudo apt autoremove
sudo snap install lxd --channel=5.11/stable
sudo usermod -aG lxd ${USER}
su - ${USER}
lxc version
id -nG
sudo lxd init
:'
Would you like to use LXD clustering? (yes/no) [default=no]: 
Do you want to configure a new storage pool? (yes/no) [default=yes]: 
Name of the new storage pool [default=default]: 
Name of the storage backend to use (dir, lvm, btrfs, ceph) [default=btrfs]: 
Create a new BTRFS pool? (yes/no) [default=yes]: 
Would you like to use an existing empty block device (e.g. a disk or partition)? (yes/no) [default=no]: 
Size in GiB of the new loop device (1GiB minimum) [default=30GiB]: 
Would you like to connect to a MAAS server? (yes/no) [default=no]: 
Would you like to create a new local network bridge? (yes/no) [default=yes]: 
What should the new bridge be called? [default=lxdbr0]: 
What IPv4 address should be used? (CIDR subnet notation, "auto" or "none") [default=auto]: 10.20.23.1/24
Would you like LXD to NAT IPv4 traffic on your bridge? [default=yes]: 
What IPv6 address should be used? (CIDR subnet notation, "auto" or "none") [default=auto]: 
Would you like the LXD server to be available over the network? (yes/no) [default=no]: 
Would you like stale cached images to be updated automatically? (yes/no) [default=yes]: 
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]: 
'

sudo ufw allow http
sudo ufw allow OpenSSH
sudo ufw allow in on lxdbr0
sudo ufw route allow in on lxdbr0
sudo ufw route allow out on lxdbr0

sudo ufw status verbose
sudo systemctl status ufw 
sudo ufw enable

su - ${USER}
lxc launch images:alpine/3.17 academia &&
lxc exec academia sh

Arduino

sudo apt  install arduino
sudo snap install arduino
sudo wget -c https://downloads.arduino.cc/arduino-1.8.19-linux64.tar.xz -P /opt/ide/
sudo tar -xvf /opt/ide/arduino-1.8.19-linux64.tar.xz -C /opt/ide/
sudo rm  -rf  /opt/ide/arduino-1.8.19-linux64.tar.xz
sudo /opt/ide/arduino-1.8.19/install.sh
sudo usermod -aG dialout ${USER}
newgrp dialout
id -nG

Qt Creator

sudo apt install qtcreator
sudo apt remove  qtcreator
sudo apt auto-remove qtcreator

Microsoft

sudo apt install apt-transport-https\
 ca-certificates curl software-properties-common wget

wget -qO - microsoft.gpg https://packages.microsoft.com/keys/microsoft.asc\
 | sudo gpg --dearmor -o /etc/apt/keyrings/microsoft-archive-keyring.gpg

cat << EOF | sudo tee /etc/apt/sources.list.d/microsoft-edge.list >/dev/null
deb [arch=$(dpkg --print-architecture)\
 signed-by=/etc/apt/keyrings/microsoft-archive-keyring.gpg]\
 https://packages.microsoft.com/repos/edge stable main
EOF

sudo apt update  && sudo apt list  --upgradeable
sudo apt upgrade && sudo apt install microsoft-edge-stable
microsoft-edge -version

Remote

sudo ufw allow 5900/tcp
sudo ufw status verbose
systemctl --user restart gnome-remote-desktop.service
systemctl --user status  gnome-remote-desktop.service

gsettings set org.gnome.desktop.remote-desktop.rdp screen-share-mode extend

DaVinci Resolve

wget -cq https://sw.blackmagicdesign.com/DaVinciResolve/v18.1.4/DaVinci_Resolve_18.1.4_Linux.zip\
?Key-Pair-Id=${KEY_PAIR_ID}==&Expires=${KEY_EXPIRES} -P ${HOME}/Downloads

unzip DaVinci_Resolve_18.1.4_Linux.zip -d ${HOME}/Downloads
sudo apt install libfuse2 libxcb-cursor0 libxcb-damage0
sudo ./DaVinci_Resolve_18.1.4_Linux.run -i

K8s Lens

# install from snapcraft
sudo snap install kontena-lens --classic

# license version
curl -fsSL https://downloads.k8slens.dev/keys/gpg\
| sudo gpg --dearmor -o /etc/apt/keyrings/k8slens.gpg

cat << EOF | sudo tee /etc/apt/sources.list.d/k8slens.list >/dev/null
deb [arch=$(dpkg --print-architecture)\
 signed-by=/etc/apt/keyrings/k8slens.gpg]\
 https://downloads.k8slens.dev/apt/debian stable main
EOF

sudo apt install lens
lens-desktop

Knowledge

tmux ls
tmux new -s my_session
tmux attach-session -t 0
tmux attach-session -t my_session

Ctrl + b % » Split pane horizontally
Ctrl + b " » Split pane vertically
Ctrl + b x » Close current pane
Ctrl + b c » Create a new window
Ctrl + b w » Choose window from a list
Ctrl + b 0 » Switch to window by number
Ctrl + b , » Rename the current window

Ctrl + b o » Go to the next pane
Ctrl + b ; » Toggle between pane
Ctrl + b d » Detach the session

lsblk
lscpu
lsusb
free -h
sudo lshw

ufw status
ufw status verbose
systemctl status ufw
apt list --installed
sudo ufw allow http
sudo ufw allow OpenSSH
sudo ufw allow 5900/tcp

sudo ss -tulpn | grep LISTEN
sudo ss -tulwn | grep LISTEN
sudo ss -tulpn | grep LISTEN | grep sshd
sudo ss -tulpn | grep LISTEN | grep redis
sudo ss -tulpn | grep LISTEN | grep gnome
sudo ss -tulpn | grep LISTEN | grep apache

sudo dmidecode -t
sudo dmidecode -t 1
sudo dmidecode -t 3
sudo dmidecode | grep 'SKU Number'
sudo dmidecode -s system-product-name
sudo dmidecode -s system-serial-number

disk usage
du -h /var
du -sh /var
du -csh ~/Do*
du -csh /var/log /var/lib
du -sh --apparent-size /var/lib
du -h /var/ | sort -rh | head -5
sudo dpkg --remove --force-remove-reinstreq ${PACAKGE_NAME:-vim}
sudo apt install ~/Downloads/TIB_js-studiocomm_6.16.0_linux_amd64.deb
sudo apt install ~/Downloads/code_1.74.3-1673284829_amd64.deb
sudo apt install ~/Downloads/teams_1.5.00.23861_amd64.deb
sudo apt install ~/Downloads/anydesk_6.2.1-1_amd64.deb
sudo apt install ~/Downloads/freedownloadmanager.deb
sudo apt install ~/Downloads/zoom_amd64.deb
sudo apt --fix-broken install
sudo apt install -f

sudo apt install balena-etcher-electron
sudo apt install inetutils-traceroute
sudo apt install libavcodec58 ffmpeg
sudo apt install gedit-plugins
sudo apt install sublime-text
sudo apt install obs-studio

sudo apt install mesa-utils 
sudo apt install filezilla
sudo apt install net-tools
sudo apt install neofetch
sudo apt install libfuse2
 
sudo apt install gtkhash
sudo apt install upx-ucl
sudo apt install hwinfo
sudo apt install ktouch
sudo apt install podman
sudo apt install bolt
sudo apt install tree
sudo apt install tmux
sudo apt install jq
sudo apt install mc
sudo snap install maas --channel=3.3/stable
sudo snap install dotnet-sdk --classic
sudo snap install powershell --classic
sudo snap install notepad-plus-plus
sudo snap install telegram-desktop

sudo snap install skype --classic
sudo snap install nvim --classic
sudo snap install code --classic
sudo snap install figma-linux
sudo snap install zoom-client
sudo snap install arduino

sudo snap install firefox
sudo snap install postman
sudo snap install drawio
sudo snap install maas

sudo snap disable mass
sudo snap install slack
sudo snap refresh drawio
sudo snap refresh firefox
sudo snap remove  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

lspci | grep -i thunder

git stashing
git stash; git checkout -b new_branch; git stash pop
git add .; git commit -m "new feature added"; git push
reset time zone
timedatectl set-ntp true
timedatectl set-ntp false
timedatectl set-time '2021-12-31 23:58:00'
timedatectl set-timezone 'Asia/Kuala_Lumpur'

#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

comment and uncomment sql
sed -i -e 's|^|-- |g' src/main/resources/db/migration/*.sql
sed -i -e 's|^-- ||g' src/main/resources/db/migration/*.sql
sudo systemctl enable  --now ssh
sudo systemctl disable --now ssh

hide mounted drives:
gsettings set org.gnome.shell.extensions.dash-to-dock show-mounts true
gsettings set org.gnome.shell.extensions.dash-to-dock show-mounts false

References