# задаем уникальное имя хоста
$ sudo hostnamectl set-hostname etcd2.qwerty.local --static
# проверяем
$ hostname
# задаем уникальное имя хоста
$ sudo hostnamectl set-hostname etcd2.qwerty.local --static
# проверяем
$ hostname
# создание пода
$ kubectl apply -f pod.yml
https://github.com/rokshd/kuber-stepik/blob/main/kube-config/pod.yml
# создание сервиса
$ kubectl apply -f node-port.yml
https://github.com/rokshd/kuber-stepik/blob/main/kube-config/node-port.yml
# посмотреть все, что есть в кластере
# kubectl get all
# посмотреть доступные поды
$ kubectl get pods
# посмотреть доступные сервисы
$ kubectl get services
# посмотреть описание пода
$ kubectl describe pods short-app
# посмотреть описание сервиса
$ kubectl describe services short-app-port
To fix this, press Windows + R and then type "control keyboard" and press okay. A popup box opens named "Keyboard properties". Over there in the "speed" tab, make sure that the "Repeat delay" is all the way towards "short" and the "Repeat rate" is all the way towards "fast" and then click the apply and okay button.
This should solve the slow backspace issue.$ apt install bzip2 tar gcc make perl
$ ./VBoxLinuxAdditions.run
$ rcvboxadd setup
$ rcvboxadd reload
$ reboot
$ cat ~/.m2/settings.xml
<?xml version="1.0" encoding="UTF-8"?>$ cat .profile | tail
...
export MAVEN_PATH=/home/user/BUILD_ENV/MAVEN/LATEST
export PATH=${PATH}:${MAVEN_PATH}/bin
$ keytool -v -list -keystore test.jks
$ keytool -genseckey -alias aes-key-1 -keyalg aes -keysize 128 -storetype jceks -keystore ks.jks
$ keytool -genseckey -alias aes-key-2 -keyalg aes -keysize 128 -storetype pkcs12 -keystore ks.p12
$ keytool -importkeystore -srckeystore aes-ks.p12 -destkeystore aes-ks.jks -srcstoretype pkcs12 -alias aes-key-2
$ keytool -importkeystore -srckeystore aes-ks.jks -destkeystore aes-ks.p12 -srcstoretype jceks -alias aes-key-1
$ keytool -delete -alias aes-key-2 -keystore aes-ks.jks
Download Gradle and extract it to /usr/gradle/
Set PATH to extracted archive
$ vim ~/.profile
export GRADLE_PATH=/usr/gradle/7.x
export PATH=${PATH}:${GRADLE_PATH}/bin
$ source ~/.profile
$ ./gradlew build -x test
$ ./gradlew clean --quiet
1. Download archive with Idea from official website.
2. Copy it to special folder
$ sudo mkdir /usr/idea
$ sudo cp ~/Downloads/ideaIC-2023.3.4.tar.gz /usr/idea
$ rm ~/Downloads/ideaIC-2023.3.4.tar.gz
3. Unpack the archive
$ cd /usr/idea
$ sudo tar xvfz ideaIC-2023.3.4.tar.gz
$ sudo rm ideaIC-2023.3.4.tar.gz
4. Add environment variable
$ vim ~/.profile
export IDEA_HOME=/usr/idea/idea-IC-233.14475.28
export PATH=${PATH}:${IDEA_HOME}/bin
5. Apply changes
$ source ~/.profile
6. Start Idea
$ idea.sh
7. Create Desktop Entry
Settings (gear) > Create Desktop Entry...
$ sudo dpkg -i foundationdb-clients_*.deb foundationdb-server_*.deb
$ fdbcli
Using cluster file `/etc/foundationdb/fdb.cluster'.
The database is available.
Welcome to the fdbcli. For help, type `help'.
fdb>
$ sudo su
$ vim /etc/foundationdb/fdb.cluster
<some symbols>:<some symbols>@127.0.0.1:4500:tls
$ fdbcli
ERROR: fdbcli is not configured with TLS, but all of the coordinators have TLS addresses.
$ cd ~
$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout private.key -out cert.crt
$ cat cert.crt private.key > fdb.pem
$ sudo cp * /etc/foundationdb/
$ chmod +r /etc/foundationdb/private.key
$ sudo vim /etc/foundationdb/foundationdb.conf
...
[fdbserver.4500]
Public - address = 127.0.0.1:4500: TLS
listen-address = public
tls_certificate_file = /etc/foundationdb/fdb.pem
tls_ca_file = /etc/foundationdb/cert.crt
tls_key_file = /etc/foundationdb/private.key
tls_verify_peers= Check.Valid=0
...
$ fdbcli -C /etc/foundationdb/fdb.cluster --tls_certificate_file /etc/foundationdb/cert.crt --tls_ca_file /etc/foundationdb/cert.crt --tls_verify_peers "Check.Valid=0" --tls-key-file /etc/foundationdb/private.key
Using cluster file `/etc/foundationdb/fdb.cluster'.
The database is available.
Welcome to the fdbcli. For help, type `help'.
fdb>
$ export FDB_TLS_CERTIFICATE_FILE=/etc/foundationdb/cert.crt
$ export FDB_TLS_CA_FILE=/etc/foundationdb/cert.crt
$ export FDB_TLS_KEY_FILE=/etc/foundationdb/private.key
$ export FDB_TLS_VERIFY_PEERS=Check.Valid=0
$ fdbcli
Using cluster file `/etc/foundationdb/fdb.cluster'.
The database is available.
Welcome to the fdbcli. For help, type `help'.
fdb>
Link to official site - https://docs.testfully.io/docs/download/
$ sudo tar -xvz -f testfully_1.69.0_amd64.AppImage.tar.gz
$ sudo mkdir /opt/testfully
$ sudo mv testfully_1.69.0_amd64.AppImage /opt/testfully
$ cd /usr/share/applications/
$ sudo touch Testfully.desktop && sudo vim Testfully.desktop
[Desktop Entry]
Encoding=UTF-8
Name=Testfully
Exec=/opt/testfully/testfully_1.69.0_amd64.AppImage
Terminal=false
Type=Application
Categories=Development
Plus - Import or Export
Show all topics via Kafka:
./bin/kafka-topics.sh --bootstrap-server=localhost:9092 --listInstall VNC server
$ sudo apt-get install tightvncserver -y
Create display
$ vncserver -geometry 1920x1080
5901 - display 1
5902 - display 2
Check port
$ netstat -an | grep 5901
Kill display
$ vncserver -kill :1
$ sudo apt update
$ sudo apt install openvas
$ sudo gvm-setup
$ sudo gvm-start
Open web UI: http://localhost:9392
Add "Target" (hosts)
Check "Scan Configs"
Create new "Task"
Check results and report
How to manage services via cmd?
> sc \\comp-name config AVP start=demand
> sc \\comp-name config AVP start=disabled
> sc \\comp-name config AVP start=auto
How to escalade priv up to system?
1. Download and extract pack from Mark Russinovich
2. Run cmd from administrator
3. > psexec.exe -i -s cmd.exe
4. > whoami
5. > procexp64.exe
6. Find service with system priv
7. Open properties and permissions
8. Add user permissions for the current service
9. Go to the services and edit settings for service
Where is the hosts file?
C:\Windows\System32\drivers\etc\hosts
How to increase the hard disk size?
- shutdown VM
- add VirtualBox path to the PATH env. variable via computer properties
C:\Program Files\Oracle\VirtualBox
- open the cmd and go to the hard disk location
- modify disk
> VBoxManage modifyhd YOUR_HARD_DISK.vdi --resize SIZE_IN_MB
How to add shared folder?
- add folder via gui
- add current user to vbox group
$ sudo adduser $USER vboxsf
- logout
Victoria ( hdd[dot]by/victoria )
MiniTool Partition Wizard ( partitionwizard[dot]com )
...
...
How to create a systemd service?
Application:
$ cat myapp.sh
#!/usr/bin/bash
echo "I'm a test app" > /tmp/test.file
Service:
$ cat /etc/systemd/system/myapp.service
...$ sudo systemctl start myapp
Start on boot:
$ sudo systemctl enable myapp
How to disable beep speaker?
# temporary
$ sudo rmmod pcspkr
# permanently
$ sudo gedit /etc/modprobe.d/blacklist
blacklist pcspkr
$ reboot
SSH by key
$ ssh-keygen -t ed25519 -C "new"
$ cat ~/.ssh/config
Host x.x.x.x
HostName x.x.x.x$ ssh x.x.x.x
Target OS is Cent OS 7.
Step 1. Install Java
Download RPM Linux x64 RPM Package from oracle.com - jdk-11.0.11_linux-x64_bin.rpm1. Download archive with JDK from oracle website.
2. Copy it to special folder
$ sudo mkdir /usr/java
$ sudo cp ~/Downloads/jdk-8u281-linux-x64.tar.gz /usr/java
$ rm ~/Downloads/jdk-8u281-linux-x64.tar.gz
3. Unpack the archive
$ cd /usr/java
$ sudo tar xvfz jdk-8u281-linux-x64.tar.gz
$ sudo rm jdk-8u281-linux-x64.tar.gz
4. Add environment variable
$ vim ~/.profile
export JAVA_HOME=/usr/java/jdk1.8.0_281
export PATH=${PATH}:${JAVA_HOME}/bin
5. Apply changes
$ source ~/.profile
6. Check JAVA version
$ java -version
java version "1.8.0_281"
Java(TM) SE Runtime Environment (build 1.8.0_281-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.281-b09, mixed mode)
####################
F3 - View file
F4 - Edit file
F5 - Copy file / folder
F6 - Move file / folder
F7 - Create new folder
F8 - Delete file / folder (via recycle bin)
####################
Shift + F4 - Create file
Shift + F6 - Rename file / folder
Shift + Delete - Delete file / folder (without recycle bin)
####################
Alt + F1 - Change drive ( left side)
Alt + F2 - Change drive ( right side)
Alt + F11 - Display view and edit history
Alt + F12 - Display folder history
####################
Ctrl + O - Hide/show both panels ( show cmd )
Ctrl + \ - Go to the root folder
Ctrl + Enter - Insert file name to cmd
Open Regedit:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Lenovo\System Update\Preferences\UserSettings\Scheduler
Set "Frequency" to "No"
Export cert from keystore
$ openssl pkcs12 -in keystore.p12 -out cert.pem -nodes
Show cert details
$ openssl x509 -in cert.pem -text -noout
Export public key from cert
$ openssl x509 -pubkey -noout -in cert.crt > pubkey.pem
Export private key from keystore in pem format
$ openssl pkcs12 -in keystore.p12 -nocerts -nodes -out key.pem
Convert key from pem to der format
$ openssl rsa -pubin -inform PEM -in pubkey.pem -outform DER -out pubkey.der
$ openssl rsa -pubin -inform PEM -in key.pem -outform DER -out key.der
Decrypt private key
$ openssl rsa -in key.pem -out private.key
Calculate Shake256 hash
$ cat public.key | openssl shake256
$ touch -a -m -t 202108180130.09 <file name>
show
$ netstat -rn
delete
$ sudo route delete default gw 192.168.88.1 eth1
send post request
$ curl -H "Content-Type: application/json" --data @body.json http://localhost:8080/ui/webapp/confExtract
$ tar -xvzf image.tar.gz
Create
$ tar -czvf image.tar.gz /path/to/dir
Show content
$ tar -ztvf image.tar.gz
Add padding to file
$ dd if=/dev/zero bs=1 count=8 >> public.pad.key
Replace A to B in file
$ cat input.file | sed 's/A/B/g' > output.file
Show contains
$ keytool -list -v -keystore keystore.jks
Convert keystore in JCEKS format to P12
$ keytool -importkeystore -srckeystore keystore.jks -destkeystore keystore.p12 -srcstoretype jceks -alias mycert
Import key/cert into jceks keystore from other
$ keytool -importkeystore -srckeystore source.jks -destkeystore keystore.jceks -srcstoretype jceks -alias mycert
Change password for key in keystore:
$ keytool -keypasswd -alias mycert -keystore keystore.jks
Delete alias from keystore:
$ keytool -delete -alias mycert -keystore keystore.jks
sudo apt-get install kodi
$ git config --global user.name "Ivan Ivanov"
$ git config --global user.email ivanov@example.com
$ git config --list
$ git config --global http.sslVerify false
# RSA (Rivest–Shamir–Adleman)
$ ssh-keygen -b 2048 -t rsa
# EdDSA (Edwards-curve Digital Signature Algorithm)
$ ssh-keygen -t ed25519 -C "rokshd@example.org"
Copy key pair to ~/.ssh/
Add path to key to config C:\Program Files\Git\etc\ssh\ssh_config
IdentityFile ~/.ssh/your-ssh-private-key
$ git init
$ git clone https://path/to/the/repository.git
$ git remote add origin git@github.com:path/to/the/repository.git
$ git push -u origin master
$ git -c http.sslVerify=false clone https://path/to/the/repository.git
Show current branch name$ git reset <file>
After committing changes to your branch, checkout master and pull it to get its latest changes from the repo
$ git checkout master
$ git pull origin master
Then checkout your branch and rebase your changes on master
$ git checkout RB
$ git rebase master...
or last two commands in one line:
$ git rebase master RB
$ python -m SimpleHTTPServer 8080
$ python -m http.server 8080
import http.server, ssl$ python3 ws.py
server_address = ('192.168.0.1', 8443)
httpd = http.server.HTTPServer(server_address, http.server.SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket(httpd.socket,server_side=True,certfile='cert.pem',ssl_version=ssl.PROTOCOL_TLSv1_2)
httpd.serve_forever()
# задаем уникальное имя хоста $ sudo hostnamectl set-hostname etcd2.qwerty.local --static # проверяем $ hostname