English 中文(简体)
如何确定世界首脑会议届会的结束日期?
原标题:Ways to find out how soon the AWS session expires?
问题回答

https://man.openbsd.org/date“rel=“nofollow noreferer” (在macOS试验)。

要求>>。

aws-expiry () {
  aws configure get x_security_token_expires --profile ${AWS_PROFILE} | xargs -I {} sh -c  TZ="UTC" date -j -f "%Y-%m-%dT%H:%M:%S" "+%s" $1 2>/dev/null  -- {} | xargs date -j -f "%s"
}

https://docs.aws.amazon.com/cli/latest/userguide/sso-configure-profile-token.html SSO session cache file(只有使用SSO)。

Assumes cli_timestamp_format not configured for AWS CLI

aws-sso-expiry () {
  aws configure get sso_start_url --profile ${AWS_PROFILE} | xargs -I {} grep -h {} ~/.aws/sso/cache/*.json | jq .expiresAt | xargs -I {} sh -c  TZ="UTC" date -j -f "%Y-%m-%dT%H:%M:%S" "+%s" $1 2>/dev/null  -- {} | xargs date -j -f "%s"
}

IMPORTANT 更新:现为AWS_CREDENTIAL_EXPIRATION 页: 1

指定官员:根据上述重要最新情况修订如下:

You probably need to check for the value of $AWS_SESSION_EXPIRATION

echo $AWS_SESSION_EXPIRATION

它应当利用Zulu Time(协调一致的世界时间)使您任期届满。 页: 1

2022-05-17T20:20:40Z

www.un.org/Depts/DGACM/index_spanish.htm 然后需要比较贵系统的日期。

下述关于macOS的工作指示,对于不光彩,你可能必须修改“条形”

让我们检查祖卢时代目前的系统时间:

date -u + %Y-%m-%dT%H:%M:%SZ 

举例说:

2022-05-17T20:21:14Z

为自动化起见,您可创建一种双面功能,在~/bashrc上添加。 或有利的终端主题

aws_session_time_left() {
  zulu_time_now=$1

  aws_session_expiration_epoch="`date -j -u -f  %Y-%m-%dT%H:%M:%SZ  $AWS_SESSION_EXPIRATION  +%s `"
  zulu_time_now_epoch="`date -j -u -f  %Y-%m-%dT%H:%M:%SZ  $zulu_time_now  +%s `"

  if [[ $zulu_time_now < $AWS_SESSION_EXPIRATION ]]; then
    secs="`expr $aws_session_expiration_epoch - $zulu_time_now_epoch`"
    echo "+`printf  %dh:%02dm:%02ds
  $((secs/3600)) $((secs%3600/60)) $((secs%60))`"
  else
    secs="`expr $zulu_time_now_epoch - $aws_session_expiration_epoch`"
    echo "-`printf  %dh:%02dm:%02ds
  $((secs/3600)) $((secs%3600/60)) $((secs%60))`"
  fi
}

查阅您可以行使的职能的结果:

aws_session_time_left "`date -u + %Y-%m-%dT%H:%M:%SZ `"

www.un.org/Depts/DGACM/index_spanish.htm 本届会议仍然有效。 能够给你这样的东西:

+0h:56m:35s

<>or>/strong>(当会议闭幕时)可以给你一段自会议结束以来的多长时间:

-28h:13m:42s

<><><>>>>> 工作时间可超过24小时

简称表

例如,你还可以作为一个独立档案,即植被-aws-session-left.sh

#!/bin/bash

# Use to find out IF "aws session expiration" exist AND compare the current system time to IT
# These are the expected result types we want to have:
# - "no aws session found" (NOTE: this does not mean there is no aws session open in another terminal)
# - how long until the session expires (for example +0h:59m:45s)
# - how long since the session expired (for example -49h:41m:12s)
# NOTE: the hours do not reset at every 24 hours, we do not require to display the days
# IMPORTANT: the date function arguments work on macOS, for other OS types may need adapting

if [[ $AWS_SESSION_EXPIRATION !=    ]]; then
  zulu_time_now="`date -u + %Y-%m-%dT%H:%M:%SZ `" # TODO: see important note above

  aws_session_expiration_epoch="`date -j -u -f  %Y-%m-%dT%H:%M:%SZ  $AWS_SESSION_EXPIRATION  +%s `" # TODO: see important note above
  zulu_time_now_epoch="`date -j -u -f  %Y-%m-%dT%H:%M:%SZ  $zulu_time_now  +%s `"                   # TODO: see important note above

  if [[ $zulu_time_now < $AWS_SESSION_EXPIRATION ]]; then
    secs="`expr $aws_session_expiration_epoch - $zulu_time_now_epoch`"
    echo "+`printf  %dh:%02dm:%02ds
  $((secs/3600)) $((secs%3600/60)) $((secs%60))`"
  else
    secs="`expr $zulu_time_now_epoch - $aws_session_expiration_epoch`"
    echo "-`printf  %dh:%02dm:%02ds
  $((secs/3600)) $((secs%3600/60)) $((secs%60))`"
  fi
else
  echo "no aws session found"
fi

之后,请查阅社保会届会的到期日期。

bash get-aws-session-time-left.sh

---EDITS---

IMPORTANT: Some info about the origin of AWS_SESSION_EXPIRATION can be found here

NOTE:aws ssologin 如果有人能够澄清AWS_SESSION_EXPIRATION 只有在使用 a时才会在场。

您可使用<条码>查询,以获得到期时间:

AWS_SESSION_EXPIRATION=$(aws configure get ${AWS_PROFILE}.x_security_token_expires)

(显然以你的简介取代教育、科学和技术部)。





相关问题
Mount windows shared drive to MWAA in bootscript

In MWAA startup script sudo yum install samba-client cifs-utils -y sudo mount.cifs //dev/test/drop /mnt/dev/test-o username=testuser,password= pwd ,domain=XX Executing above commonds giving error - ...

How to get Amazon Seller Central orders programmatically?

We have been manually been keying Amazon orders into our system and would like to automate it. However, I can t seem to figure out how to go about it. Their documentation is barely there. There is: ...

Using a CDN like Amazon S3 to control access to media

I want to use Amazon S3/CloudFront to store flash files. These files must be private as they will be accessed by members. This will be done by storing each file with a link to Amazon using a mysql ...

unable to connect to database on AWS

actually I have my website build with Joomla hosted on hostmonster but all Joomla website need a database support to run this database is on AWS configuration files need to be updated for that I ...

Using EC2 Load Balancing with Existing Wordpress Blog

I currently have a virtual dedicated server through Media Temple that I use to run several high traffic Wordpress blogs. Both tend to receive sudden StumbleUpon traffic surges that (I m assuming) ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...