Instantly share code, notes, and snippets.

View realtime-tracking-stdout-line-count.sh
docker logs -f --since 2s $(docker ps -qa --filter "name=CONTAINER_NAME") | pv -l -c > /dev/null
View last-records-on-elasticsearch.sh
curl -XGET "http://ES_CLUSTER/_search" -H 'Content-Type: application/json' -d'
{
"query": {
"range" : {
"@timestamp" : {
"gte" : "now-15m",
"lt" : "now"
}
}
}
View macos-mail-gmail-mail-complete.md
  • Address Book uygulamasında Preferences > Account sekmesinde Google hesabını etkinleştir.
  • Uygulamanın sunucuyla senkronize olmasını bekle.
  • Mail uygulamasını kapat aç.
View delete-by-query.json
POST INDEX_NAME/_delete_by_query
{
"query": {
"bool": {
"must": [
{
"term": {
"field1": "100"
}
},
View disable-vino-encryption.sh
gsettings set org.gnome.Vino require-encryption false
View update-rows-using-subquery.sql
UPDATE cars
SET model = subNewCarsTable.newModelName
FROM (SELECT
nc.id AS carId,
nc.model AS newModelName
FROM new_cars nc
WHERE year=2018) subNewCarsTable
WHERE subNewCarsTable.carId = cars.id;
View elasticsearch-adjust-max-result-window.sh
# tested on Elasticseach 6.0.0
curl -XPUT "http://es-host:9200/my_index/_settings" -H 'Content-Type:application/json' -d '{ "index" : { "max_result_window" : 1000000 } }'
View adjust-fileupload-size-ingress.yml
# tested on kubernetes 1.10.5
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
# "0" for unlimited fileupload size
nginx.org/client-max-body-size: "100m"
name: myproject-gateway-ingress
View adjust-timeouts-ingress.yml
# tested on kubernetes 1.10.5
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/proxy-connect-timeout: "750"
nginx.ingress.kubernetes.io/proxy-read-timeout": "600"
name: my-project-gateway-ingress
View adjust-payload-size-ingress.yml
# tested on kubernetes 1.10.5
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/proxy-body-size": "100m"
name: myproject-gateway-ingress