The problem: Being root you would like to resume another user's screen session. Let the user be A.
You 'become' him by
su A -
or
sudo su - A
| expbackoff() { | |
| # Exponential backoff: retries a command upon failure, scaling up the delay between retries. | |
| # Example: "expbackoff my_command --with --some --args --maybe" | |
| local MAX_RETRIES=${EXPBACKOFF_MAX_RETRIES:-8} # Max number of retries | |
| local BASE=${EXPBACKOFF_BASE:-1} # Base value for backoff calculation | |
| local MAX=${EXPBACKOFF_MAX:-300} # Max value for backoff calculation | |
| local FAILURES=0 | |
| while ! "$@"; do | |
| FAILURES=$(( $FAILURES + 1 )) | |
| if (( $FAILURES > $MAX_RETRIES )); then |
| # Notify Slack - Send notifications to a Slack Channel | |
| # Copyright (C) 2016 Gustavo Arjones (@arjones) | |
| # | |
| # This program is free software; you can redistribute it and/or | |
| # modify it under the terms of the GNU General Public License | |
| # as published by the Free Software Foundation; either version 2 | |
| # of the License, or (at your option) any later version. | |
| # | |
| # Full blog post here: http://arjon.es/2016/09/15/be-notified-on-slack-when-a-long-process-finishes/ | |
| # |
| steps: | |
| - id: "Store Values" | |
| name: gcr.io/cloud-builders/curl | |
| entrypoint: /bin/bash | |
| args: | |
| - -c | |
| - | | |
| # store multiple values as environment variables | |
| # name all values with a common prefix (we'll use "build_") | |
| export build_firstname="Robin" && |
| #!/usr/bin/env bash | |
| ##################################################################### | |
| # REFERENCES | |
| # - https://cloud.google.com/kubernetes-engine/docs/add-on/backup-for-gke/concepts/backup-for-gke | |
| # - https://cloud.google.com/kubernetes-engine/docs/add-on/backup-for-gke/how-to/install | |
| ##################################################################### | |
| export PROJECT_ID=$(gcloud config get-value project) | |
| export PROJECT_USER=$(gcloud config get-value core/account) # set current user |
| #!/usr/bin/env bash | |
| # REF: https://cloud.google.com/armor/docs/integrating-cloud-armor#with_ingress | |
| # REF: https://cloud.google.com/armor/docs/configure-security-policies | |
| # REF: https://cloud.google.com/iap/docs/load-balancer-howto | |
| # REF: https://cloud.google.com/sdk/gcloud/reference/compute/url-maps/add-path-matcher | |
| # REF: https://cloud.google.com/load-balancing/docs/https/setting-up-url-rewrite | |
| export PROJECT_ID=$(gcloud config get-value project) | |
| export PROJECT_USER=$(gcloud config get-value core/account) # set current user |
| #!/usr/bin/env bash | |
| export PROJECT_ID=$(gcloud config get-value project) | |
| export PROJECT_USER=$(gcloud config get-value core/account) # set current user | |
| export PROJECT_NUMBER=$(gcloud projects describe $PROJECT_ID --format="value(projectNumber)") | |
| export IDNS=${PROJECT_ID}.svc.id.goog # workflow identity domain | |
| export GCP_REGION="us-west1" | |
| export ISTIO_VERSION="1.9.1" |
The problem: Being root you would like to resume another user's screen session. Let the user be A.
You 'become' him by
su A -
or
sudo su - A
| #!/bin/sh | |
| # this script was initially written for Redhat/CentOS | |
| # file is /etc/cron.daily/diskAlert.cron | |
| # requires enabling outgoing sendmail from localhost to a valid | |
| # smtp server, which is usually disabled by default | |
| ADMIN="jausten@adomain.com,another@adomain.com" | |
| THRESHOLD=90 | |
| df -PkH | grep -vE '^Filesystem|tmpfs|cdrom|media' | awk '{ print $5 " " $6 }' | while read output; | |
| do |
| # https://cloud.google.com/kms/docs/quickstart | |
| # https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/dlp/deid.py | |
| # https://cloud.google.com/docs/authentication/production | |
| gcloud kms keyrings create clouddlp --location global | |
| gcloud kms keys create dlp_deidentify_fpe --location global \ | |
| --keyring clouddlp --purpose encryption | |
| gcloud kms keys list --location global --keyring clouddlp |