To get the token:
export ARGOCD_SERVER="https://<<your-url>>"
export ARGOCD_ADMIN_PASSWORD=`aws secretsmanager get-secret-value --secret-id SecretText_odde-eks_eks1_argocd_initial-admin-secret --output json | jq -r ".SecretString"`
rm /tmp/creds.json
cat << EOF >> /tmp/creds.json
{
"username":"admin",
"password":"$ARGOCD_ADMIN_PASSWORD"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Command-line world clock - source: https://stackoverflow.com/questions/370075/command-line-world-clock | |
: ${WORLDCLOCK_ZONES:=$HOME/world_time_zones} | |
: ${WORLDCLOCK_FORMAT:='+%Y-%m-%d %H:%M:%S %Z'} | |
while read zone | |
do echo $zone '!' $(TZ=$zone date "$WORLDCLOCK_FORMAT") | |
done < $WORLDCLOCK_ZONES | | |
awk -F '!' '{ printf "%-20s %s\n", $1, $2;}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Inspired by this great answer... | |
# https://stackoverflow.com/a/60785401 | |
import yaml | |
class SafeUnknownConstructor(yaml.constructor.SafeConstructor): | |
def __init__(self): | |
yaml.constructor.SafeConstructor.__init__(self) | |
def construct_undefined(self, node): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for f in *; do | |
fuser -s "$f" || echo "$f" >> /tmp/files | |
done |
Info Question to chatGPT 4:
python deep merge two dictionaries
Response:
def deep_merge_dicts(dict1, dict2):
"""
Recursively merge two dictionaries.
"""
I hereby claim:
- I am nicc777 on github.
- I am nicc777 (https://keybase.io/nicc777) on keybase.
- I have a public key ASCw2KEtFioxkgSyfTkWNcXnjyg0xm2tNkOSqpbno20BOAo
To claim this, I am signing this object:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import datetime | |
from dateutil.tz import tzlocal # pip3 install python-dateutil | |
your_dict = {} # Data... | |
json.dumps(your_dict, sort_keys=True, default=str) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import smtplib | |
import os | |
SMTP_SERVER = os.getenv('SMTP_SERVER', 'localhost') | |
SMTP_PORT = os.getenv('SMTP_PORT', '25') | |
SENDER_EMAIL_ADDR = os.getenv('SENDER_EMAIL_ADDR', '[email protected]') | |
SENDER_NAME = os.getenv('SENDER_NAME', 'NO-REPLY') | |
RECEIVER_EMAIL_ADDR = os.getenv('RECEIVER_EMAIL_ADDR', 'root@localhost') | |
RECEIVER_NAME = os.getenv('RECEIVER_NAME', 'Root') |
Summary of info I got from this post on 2022-09-11
Shell script:
#!/bin/bash
#Variable Declaration - Change These
HOSTED_ZONE_ID="XXXXXXXXXXXX"
NAME="example.com."