
Size: a a a
<(expression)
- результатом ее выполнения будет путь к файловому дескриптору. bash-3.2$ echo <(echo '123')Что можно делать такой штукой? довольно прикольные вещи:
/dev/fd/63
bash-3.2$ cat <(echo '123')
123
diff <(ls dirA) <(ls dirB)
тыц2: mysql < <(echo "str")
тут можно прочитать поподробнее: https://superuser.com/questions/1059781/what-exactly-is-in-bash-and-in-zshgetSalt(user_id)
checkPassword(user_id, hashed_password)
openssl genrsa -out ca.key 40962. create key (root) [ca server]
openssl req -new -x509 -days 3650 -key ca.key -out ca.crt -subj "/C=RU/ST=Moscow/L=Moscow/O=Company/OU=OU/CN=CN/emailAddress=mail@example.com"3. gen server key and csr [ca server]
openssl req -new -utf8 -nameopt multiline,utf8 -config server.conf -newkey rsa:4096 -keyout server.key -nodes -out server.csr4. put server.conf. change file according to your dns [ca server]
[req]5. sign server csr [ca server]
prompt = no
distinguished_name = dn
req_extensions = ext
[dn]
CN = <put dns here>
emailAddress = email@example.com
O = Moscow
OU = SOC
L = Moscow
C = RU
[ext]
subjectAltName = DNS:<put dns here>,IP:<optional put ip here>
openssl x509 -req -days 3650 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.crt -extfile server.conf -extensions ext6. create client key, csr [ca server]
openssl req -new -utf8 -nameopt multiline,utf8 -newkey rsa:2048 -nodes -keyout client.key -out client.csr -subj "/C=RU/ST=Moscow/L=Moscow/O=Company/OU=OU/CN=CN/emailAddress=mail@example.com"7. sign client ca [ca server]
openssl x509 -req -days 3650 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.crt -extfile server.cnf -extensions ext8. generate p12 container to use it in browser [ca server]
openssl pkcs12 -export -in client.crt -inkey client.key -certfile ca.crt -out client.p12 -passout pass:q1w2e39. put server.key, ca.crt, server.crt to /etc/nginx/ssl [nginx server]
server {11.1 if u r using auth in browser: install p12 from step 8 to keychain or directly into browser. On macos chrome uses system keychain. after importing u should edit trust settings on key and cert in keychain to make it work
listen 80;
server_name _;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name example.com;
ssl_protocols TLSv1.1 TLSv1.2;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
ssl_client_certificate /etc/nginx/ssl/ca.crt;
ssl_verify_client on;
# u can use "opional" instead of "on" to configure auth on locations. see below
location / {
# if the client-side certificate failed to authenticate, show a 403 message to the client
# if ($ssl_client_verify != SUCCESS) {
# return 403;
# }
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass https://<put ip here>;
}
}
curl -k --key client.key --cert client.crt --url "https://site.com"
## 0.14.0 (Unreleased)More
ENHANCEMENTS:
* cli: A new global command line option `-chdir=...`, placed before the selected subcommand, instructs Terraform to switch to a different working directory before executing the subcommand. This is similar to s...
CURL
умеет работать с smtp://
схемой. (Нет, я конечно знал что он может многое, но как-то не осмеливался задуматься что он умеет еще больше).curl -k --url "smtp://127.0.0.1" --mail-from "spoofing@example.com" --mail-rcpt "jdoe2@example.com" --upload-file ./message --user 'jdoe2@example.com:password' --ssl
user_list:Нужно получить:
- name: core
ssh_keys:
- name: main
type: "ecdsa-sha2-nistp256"
value: "AAAA..."
pubkey: "ecdsa-sha2-nistp256 AAAA....."Как это в итоге получилось, для переменной в hostvars:
pubkey: "{% set core_main_ssh_params =#ansible #jinja #дичь
user_list |
selectattr('name', 'equalto', 'core') |
sum(attribute='ssh_keys', start=[]) |
selectattr('name', 'equalto', 'main') |
list | first -%}
{{ core_main_ssh_params.type }} {{ core_main_ssh_params.value }}"