nginx -v
nginx version: nginx/1.20.0
more /etc/nginx/nginx.conf
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
db.person.getIndexes()
db.person.createIndex( { "personId": 1 }, { unique: true } )
Index already exists with different options
db.person.dropIndex("personId_1")
fields @timestamp, @message
| filter (@message like /records=/)
| parse @message /records=(?<records>\S+)/
| filter records >= 200
| sort @timestamp desc
| limit 2000
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# | |
# https://realpython.com/primer-on-python-decorators/ | |
import functools | |
import math | |
# a decorator: | |
# - takes a function f1 as argument | |
# - returns a new function f2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You can run the operation in the web shell below: | |
https://docs.mongodb.com/manual/tutorial/query-arrays/ | |
# to find(query) with two conditions on the same field, use $and: | |
db.inventory.find( | |
{$and: | |
[ | |
{tags: {$size:3}}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io" | |
"net" | |
) | |
func main() { | |
ln, err := net.Listen("tcp", ":8080") |
Add annotations to pod:
metadata:
annotations:
prometheus.io/scrape: 'true'
prometheus.io/path: '/data/metrics'
prometheus.io/port: '80'
-
Install session manager plugin: https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html#install-plugin-linux
-
Authorize ssh key in ec2-user
-
Set up aws profile
prd
, login into it, etc. -
Use this config: