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
View next-execution-date-for-spring-cron-expressions.md

I usually use Groovy Console to run code below to get next execution date for Spring cron expressions.

new org.springframework.scheduling.support.CronSequenceGenerator("0 0/5 * * * *").next(new Date())
View mockito-deep-stubs.md
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
private NestedObject nestedObject;

example usage in a test method:

when(nestedObject.getStatusInfo().getValue().getStatus()).thenReturn(1);