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
# Create user-defined overlay network | |
Prerequisites: | |
Firewall rules for Docker daemons using overlay networks | |
You need the following ports open to traffic to and from each Docker host participating on an overlay network: | |
"TCP port 2377 for cluster management communications | |
TCP and UDP port 7946 for communication among nodes | |
UDP port 4789 for overlay network traffic" | |
Before you can create an overlay network, you need to either initialize your Docker daemon as a swarm manager using: docker swarm init | |
or join it to an existing swarm using: docker swarm join | |
Either of these creates the default ingress overlay network which is used by swarm services by default. You need to do this even if you never plan to use swarm services. Afterward, you can create additional user-defined overlay networks. |
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
### | |
### This gist contains 2 files : settings.json and lambda_function.py | |
### | |
### settings.json | |
{ | |
"extensions" : ["*.hdr", "*.glb", "*.wasm"] | |
} | |
### lambda_function.py |
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
Different from bash, PowerShell is object-orriented. Understanding objects are necessary to utilize PowerShell | |
Get-NetIPAddress -AddressFamily IPV4 -AddressState Preferred -IncludeAllCompartments | Get-Member | |
TypeName: Microsoft.Management.Infrastructure.CimInstance#ROOT/StandardCimv2/MSFT_NetIPAddress | |
Name MemberType Definition | |
---- ---------- ---------- | |
ifIndex AliasProperty ifIndex = InterfaceIndex |
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
# Generate du command to check disk | |
# Ignore all the mount points nfs4. Modify the "df -t nfs4" as you want | |
# Run with lowest CPU priority and lowest diskio priority | |
# extract the content from the last column and store it in an array | |
IFS=$'\n' read -d '' -ra MOUNT_POINTS <<< "$(df -h -t nfs4 | awk '{print $NF}')" | |
# construct the new du command with the excluded mount points | |
DU_COMMAND="nice -n 19 ionice -c 3 du -shxc /* --exclude=/proc" | |
for mount_point in "${MOUNT_POINTS[@]}"; do |
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
## Clone a running OS from SD card to USD SSD, Raspberry 4B 8G | |
### Main guide | |
https://medium.com/xster-tech/move-your-existing-raspberry-pi-4-ubuntu-install-from-sd-card-to-usb-ssd-52e99723f07b | |
### References: | |
https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-boot-modes | |
https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-4-boot-flow | |
https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-4-boot-eeprom |
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
## I. Important references | |
https://developer.hashicorp.com/terraform/language/ | |
https://developer.hashicorp.com/terraform/cloud-docs | |
https://registry.terraform.io/providers/hashicorp/aws/latest/docs | |
### 1. Some points | |
Terraform HCL is similar to C syntax in some ways | |
- Comment: #, //, /* ... */ | |
- Block: <type> <label> { ... } | |
- As I understand: |
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
#### Alarm fatigue. When everything is urgent, nothing is urgent | |
https://dev.to/dvddpl/when-everything-is-urgent-nothing-is-what-is-alarm-fatigue-and-how-to-deal-with-it-1321 | |
#### ECS Desired task count | |
https://dev.to/aws-builders/understanding-the-desiredcount-and-autoscaling-behaviour-of-aws-fargate-fuckups-and-learnings-4e0 | |
#### Blameless culture. Make mistake and ask question. Psychology safety in work | |
https://dev.to/dvddpl/make-mistakes-and-ask-questions-its-ok-gah |
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
from bs4 import BeautifulSoup | |
import csv | |
import requests | |
# URL of the static HTML page | |
url = 'https://example.com/static-page.html' # Replace with your actual URL | |
# Fetch the page content | |
response = requests.get(url) |
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
grep -E '2024/(07|08|09)' $1 | awk -F, ' | |
BEGIN { | |
sum_cpu_avg = 0; | |
sum_cpu_max = 0; | |
max_cpu_avg = 0; | |
max_cpu_max = 0; | |
count = 0; | |
} | |
{ | |
sum_cpu_avg += $2; |