Run - Edit Configurations - Environment variables
Read it from code:import os
RT_USER = os.environ["rt_user"]
How to install python package?
Settings - Project - Python Interpreter
####################
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()
# скачиваем deb пакет с официального сайта https://www.happ.su/main/ru # установка deb пакета $ sudo dpkg -i /tmp/Happ.linux.x64.deb # устан...