#GIT
- Modificado (modified);
- Preparado (staged/index)
- Consolidado (comitted);
| <?php | |
| if (!isset($_GET['ILoveMautic'])) { | |
| echo 'The secret phrase is wrong.'; | |
| die; | |
| } | |
| $link = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; | |
| $allowedTasks = array( | |
| 'cache:clear', |
| # -*- coding: utf-8 -*- | |
| import hashlib | |
| import boto3 | |
| class ETSManager: | |
| """ | |
| @todo: manages and provides the ets services |
| // Remove um nome de usuário reservado no WordPress Multisite | |
| function erikasarti_remove_usuario_multisite( $user_login ) { | |
| global $wpdb; | |
| $success = false; | |
| if ( false !== $wpdb->delete( $wpdb->signups, array( 'user_login' => sanitize_text_field( $user_login ) ) ) ) { | |
| $success = true; |
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(query_start, clock_timestamp()), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
| --- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md | |
| --- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192 | |
| -- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB. | |
| ------------ | |
| -- Basics -- | |
| ------------ | |
| -- Get indexes of tables |
| <script> | |
| countdown('06/26/2017 8:00 PM', 'timer'); //date format: mm/dd/yyyy hh:mm AM | |
| function countdown(dt, id) | |
| { | |
| var end = new Date(dt); | |
| var _second = 1000; | |
| var _minute = _second * 60; | |
| var _hour = _minute * 60; | |
| var _day = _hour * 24; |
| #!/bin/bash | |
| version="${VERSION:-0.18.1}" | |
| arch="${ARCH:-linux-amd64}" | |
| bin_dir="${BIN_DIR:-/usr/local/bin}" | |
| wget "https://github.com/prometheus/node_exporter/releases/download/v$version/node_exporter-$version.$arch.tar.gz" \ | |
| -O /tmp/node_exporter.tar.gz | |
| mkdir -p /tmp/node_exporter |
About kubeconfig and Sharing kubeconfigs
When you create a Google Cloud Container cluster with gcloud container clusters create it also generates a kubeconfig entry.
See the output below:
Creating cluster petclinic...done.
Created [https://container.googleapis.com/v1/projects/gcloud-testing-vish/zones/asia-east1-a/clusters/petclinic].
kubeconfig entry generated for petclinic.
NAME LOCATION MASTER_VERSION MASTER_IP MACHINE_TYPE NODE_VERSION NUM_NODES STATUS
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |