Console:
SELECT * FROM "cb-events"."eventType-index"
WHERE "eventType" = 'phone-updated'
AND eventDate >= '2021-10-01'
AND eventDate <= '2021-10-02'
CLI:
HANDY ONE-LINE SCRIPTS FOR AWK 30 April 2008 | |
Compiled by Eric Pement - eric [at] pement.org version 0.27 | |
Latest version of this file (in English) is usually at: | |
http://www.pement.org/awk/awk1line.txt | |
This file will also be available in other languages: | |
Chinese - http://ximix.org/translation/awk1line_zh-CN.txt | |
USAGE: |
Console:
SELECT * FROM "cb-events"."eventType-index"
WHERE "eventType" = 'phone-updated'
AND eventDate >= '2021-10-01'
AND eventDate <= '2021-10-02'
CLI:
List permissions for service account <namespace>:<serviceaccount>
in namespace <namespace>
kubectl auth can-i --list --as=system:serviceaccount:<namespace>:<serviceaccount> -n <namespace>
https://stackoverflow.com/questions/54889458/kubernetes-check-serviceaccount-permissions
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
#!/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 |
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}}, |
package main | |
import ( | |
"fmt" | |
"io" | |
"net" | |
) | |
func main() { | |
ln, err := net.Listen("tcp", ":8080") |