scoop install rustup
scoop install llvm
scoop install gcc
This file contains 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
{ | |
"affinity": { | |
"nodeAffinity": { | |
"requiredDuringSchedulingIgnoredDuringExecution": { | |
"nodeSelectorTerms": [ | |
{ | |
"matchExpressions": [ | |
{ | |
"key": "karpenter.sh/nodepool", | |
"operator": "DoesNotExist" |
- Prepare profile in
~/.aws/credentials
. - Change
from_profile
andto_profile
to your profile name, then Run command.
from_profile=profile-A to_profile=profile-B sts=$(aws sts assume-role --profile "${from_profile}" --role-arn $(aws configure get "${to_profile}.role_arn") --role-session-name "${to_profile}-assume"); \
export AWS_ACCESS_KEY_ID=$(echo "${sts}" | jq -r '.Credentials.AccessKeyId'); \
export AWS_SECRET_ACCESS_KEY=$(echo "${sts}" | jq -r '.Credentials.SecretAccessKey'); \
export AWS_SESSION_TOKEN=$(echo "${sts}" | jq -r '.Credentials.SessionToken') \
export AWS_EXPIRE=$(echo "${sts}" | jq -r '.Credentials.Expiration')
This file contains 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
#Requires -RunAsAdministrator | |
#Requires -Version 5.0 | |
# requires Windows 10 | |
Get-EtwTraceProvider | Select-Object SessionName, Guid | sort SessionName | |
# as Markdown | |
<# | |
#Requires -RunAsAdministrator | |
$result = Get-EtwTraceProvider | sort SessionName | |
$result | %{"|Name|GUID|";"|----|----|";}{"|$($_.SessionName)|$($_.Guid)|"} | |
#> |
This file contains 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
$ openssl s_client -servername token.actions.githubusercontent.com -showcerts -connect token.actions.githubusercontent.com:443 < /dev/null 2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sed "0,/-END CERTIFICATE-/d" > certificate.crt | |
$ openssl x509 -in certificate.crt -fingerprint -noout | cut -f2 -d'=' | tr -d ':' | tr '[:upper:]' '[:lower:]' | |
6938fd4d98bab03faadb97b34396831e3780aea1 |
This file contains 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 | |
set -e | |
extension="txt" | |
result=$(find . -type f -name "*.${extension}" | cut -d / -f 2 | sort -u) | |
if [[ -n "$result" ]]; then | |
while read -r item; do | |
echo "$PWD/$item" | |
done <<< "$result" |
This file contains 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
# connect-timeout: 1s = connect timeout. if network connect is stopped frequentry, 1s will be strong option. | |
# max-time: 10s = must finish within this time | |
# retry: 5 = retry count | |
# retry-delay: 0 = no exponential backoff | |
# retry max time: 60 = retry no longer than | |
curl --connect-timeout 1 --max-time 10 --retry 5 --retry-delay 0 --retry-max-time 60 -fsSL https://download.docker.com/linux/ubuntu/gpg |
This file contains 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
# You can specify Path and ResourceName to strictly identify. | |
Rename-DSCModuleResourcePrefix -Path c:\Path\To\Resource\Directory -ResourceName ResourcenameToRename -NewPrefix c -Verbose |
This file contains 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
$reservedMemoryMB = Get-Content -Raw -Path "${env:APPDATA}/Docker/settings.json" | ConvertFrom-Json | Select-Object -ExpandProperty memoryMiB | |
$dockerStats = docker stats --no-stream --format "{{.MemUsage}}" | |
$totalMemoryKB = 0 | |
foreach ($line in $dockerStats) { | |
$memoryUsage = $line.Split('/')[0].Trim() | |
$value = [double]($memoryUsage -replace '[^\d.]') | |
if ($memoryUsage -match "GiB") { | |
$totalMemoryKB += $value * 1024 * 1024 | |
} elseif ($memoryUsage -match "MiB") { |
NewerOlder