Friday, October 22, 2021
EKS : Kubernetes : AWS : Install Kubernetes on Control Plane and Configure EKS with kubectl
Linux : PING - Internet Speed Test : 8.8.8.8 - Google DNS
https://wisetut.com/best-ping-test-ip-addresses-google-dns-8-8-8-8-cloudflare-dns-1-1-1-1/
The network connection to the 8.8.8.8 Google DNS service can be tested with the ping command like below.
$ ping 8.8.8.8
The output is like below as we can see that the time or RTT is very low.
Linux:/etc/shells or /etc/os-release
eks@GRDLUSAWSAMUT01:~$ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.6 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.6 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
eks@GRDLUSAWSAMUT01:~$ cat /etc/shells
# /etc/shells: valid login shells
/bin/sh
/bin/bash
/bin/rbash
/bin/dash
/usr/bin/tmux
/usr/bin/screen
eks@GRDLUSAWSAMUT01:~$
Linux:Kubectl : Add New User: Add User to secondary group : Change default Shell of a user
https://linuxize.com/post/how-to-create-users-in-linux-using-the-useradd-command/
sudo useradd -m username
ls -la /home/username/
https://careerkarma.com/blog/linux-add-user-to-group/
sudo usermod -a -G group_to_add username
https://www.tecmint.com/change-a-users-default-shell-in-linux/
usermod --shell /bin/bash tecmint
admin@MACHINEVM01:~$ hostname -I
10.102.25.95 172.17.0.1 172.19.0.1
admin@MACHINEVM01:~$ getent passwd|grep admin
admin:*:16777219:16777220:Kaw, Karan:/home/admin:/bin/bash
admin@MACHINEVM01:~$ getent group|grep docker
docker:x:118:
admin@MACHINEVM01:~$ groups admin
admin : domain users BUILTIN\users
admin@MACHINEVM01:~$ sudo useradd -m eks
[sudo] password for admin:
admin@MACHINEVM01:~$ groups eks
eks : eks
admin@MACHINEVM01:~$ id eks
uid=1006(eks) gid=1006(eks) groups=1006(eks)
admin@MACHINEVM01:~$ getent group|grep eks
eks:x:1006:
admin@MACHINEVM01:~$ getent passwd|grep eks
eks:x:1006:1006::/home/eks:/bin/sh
admin@MACHINEVM01:~$ sudo usermod -a -G docker eks
admin@MACHINEVM01:~$ getent passwd|grep eks
eks:x:1006:1006::/home/eks:/bin/sh
admin@MACHINEVM01:~$ groups eks
eks : eks docker
admin@MACHINEVM01:~$
Docker-Compose Comands
apt install docker.io
apt install docker-compose
docker-compose up
docker-compose up -d
docker image ls
docker container ls
======================
docker ps
docker images
docker-compose -f docker-compose.yml down
docker-compose -f docker-compose.yml up -d
netstat -tulpn|grep LISTEN
tail -f nohup.out
Thursday, October 21, 2021
Linux : Bash-Completion :Kubernetes
kubernetes.io/docs/tasks/tools/included/optional-kubectl-configs-bash-linux/
apt-get install bash-completion
or yum install bash-completion
o find out, reload your shell and run type _init_completion
. If the command succeeds, you're already set, otherwise add the following to your ~/.bashrc
file:
source /usr/share/bash-completion/bash_completion
The kubectl completion script for Bash can be generated with the command
kubectl completion bash
kubectl rollout history deployment vea-cc -n fda
Tuesday, October 19, 2021
Linux: SSH:Password for Few Users
/etc/ssh/sshd_config
Match User <username>
PasswordAuthentication yes
Match all
/etc/ssh/sshd_config
Match User <username>
PasswordAuthentication yes
Match User all
PasswordAuthentication no
https://stackoverflow.com/questions/15543032/connecting-aws-ec2-instance-asks-for-password-although-pem-file-is-provided
https://aws.amazon.com/premiumsupport/knowledge-center/new-user-accounts-linux-instance/
https://linuxize.com/post/how-to-list-users-in-linux/
https://serverfault.com/questions/797482/how-to-make-ec2-user-data-script-run-again-on-startup
https://aws.amazon.com/premiumsupport/knowledge-center/execute-user-data-ec2/
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/connect-to-serial-console.html
AWS : Userdata after every restart
Monday, October 18, 2021
AWS : Userdata - Bash Script Fired Once
https://aws.amazon.com/premiumsupport/knowledge-center/ec2-user-account-cloud-init-user-data/
docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#retrieving-the-public-key
github.com/Cloud-Yeti/aws-ec2-course/blob/master/labs/lab07-ec2-userdata-ssh-with-password.MD
aws.amazon.com/blogs/aws/troubleshoot-boot-and-networking-issues-with-new-ec2-serial-console/
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html
sed 's/PasswordAuthentication no/PasswordAuthentication yes/' -i /etc/ssh/sshd_config
systemctl restart sshd
service sshd restart
useradd bob
# TODO: replace password123 with desired password and change bob to your username chosen in useradd
echo "password123" | passwd --stdin bob
AWS : SSH Issue - Permission denied
https://stackoverflow.com/questions/36300446/ssh-permission-denied-publickey-gssapi-with-mic
(publickey,gssapi-keyex,gssapi-with-mic).
ssh -i "CCA_Product.pem" ec2-user@10.79.197.206
ssh-keygen -m PEM
pem
pub
docs.aws.amazon.com/AWSEC2/latest/UserGuide/connect-to-serial-console.html#sc-connection-methods
Push your SSH public key to the instance to start a serial console session
aws ec2-instance-connect send-serial-console-ssh-public-key \
--instance-id i-06a0d8564550494b0 \
--serial-port 0 \
--ssh-public-key file://serialAccess.pub \
--region us-east-1
Connect to the serial console using your private key
ssh -i serialAccess i-06a0d8564550494b0.port0@serial-console.ec2-instance-connect.us-east-1.aws
i-06a0d8564550494b0
Linux : KDE Neon
https://linuxhint.com/install-kde-neon-oracle-virtualbox/
KDE Neon --- Derivative of Ubuntu Linux
Konsole ---- Transparent
LINUX:TMUX
tecmint.com/tmux-to-access-multiple-linux-terminals-inside-a-single-console/
https://askubuntu.com/questions/850055/ctrl-b-c-n-w-etc-not-working-in-tmux-console
https://ostechnix.com/tmux-command-examples-to-manage-multiple-terminal-sessions
tmux
ctrl+b and Shift+% ::: Split Vertically
ctrl+b and Shift+" ::: Split Horizontally
Type "exit" from a particular window To kill that window/screen
ctrl+b and d ::: End Session
for example, to create a new terminal hold ctrl+b and release it then press shift+5 (%)
Wednesday, October 6, 2021
Maven : Snippet to copy all dependencies in 1 Folder
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>3.1.2</version> <executions> <execution> <id>copy-dependancies-to-libs</id> <phase>package</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory>${project.parent.basedir}/dependent-libs</outputDirectory> <overWriteReleases>false</overWriteReleases> <overWriteSnapshots>false</overWriteSnapshots> <overWriteIfNewer>true</overWriteIfNewer> </configuration> </execution> </executions> </plugin> |
Tuesday, October 5, 2021
Kubectl : Copy from Host to Kubectl POD - Logs Kubernetes Tail
https://support.sitecore.com/kb?id=kb_article_view&sysparm_article=KB0383441
docker cp <src-path> <container>:<dest-path>
kubectl cp <src-path> <your-pod-name>:<dest-path>
kubectl cp /data/ids_runtime_docker/DB_Script/IDS_Extraction_Application_Form_CS.tar mongodb-0:/tmp
https://zoomadmin.com/HowToInstall/UbuntuPackage/less
sudo apt-get install -y less
https://kubernetes.io/docs/reference/kubectl/cheatsheet/
kubectl logs my-pod -f
Azure - Pipeline - Add Approver for Stage
https://learn.microsoft.com/en-us/azure/devops/pipelines/process/approvals?view=azure-devops&tabs=check-pass
-
https://www.baeldung.com/spring-properties-file-outside-jar https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-featu...
-
https://learn.microsoft.com/en-us/azure/devops/pipelines/process/approvals?view=azure-devops&tabs=check-pass
-
The decision was made to block such external HTTP repositories by default https://stackoverflow.com/questions/66980047/maven-build-failure-d...