Skip to content

Instantly share code, notes, and snippets.

View stefango's full-sized avatar
🎯
Focusing

stefango

🎯
Focusing
View GitHub Profile
@stefango
stefango / .editorconfig
Created May 31, 2021 09:35
fix format in windows
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
# delete empty folders
$tdc="DIRECTORY"
do {
$dirs = gci $tdc -directory -recurse | Where { (gci $_.fullName -Force).count -eq 0 } | select -expandproperty FullName
$dirs | Foreach-Object { Remove-Item $_ }
$count = $count + 1
} while ($dirs.count -gt 0)
echo 'empty folders deleted'
# delete files in specific format
.tmall.com,
.taobao.com,
.163.com,
.126.net,
github.com,
github.blog,
.github*.com,
.google*.com,
.amazonaws.com,
.schemastore.org,
@stefango
stefango / freeme.sh
Created October 31, 2020 08:06
autochange elastic ips by aws cli 2
# ref: https://wangfanggang.com/AWS/aws-cli-renew-ip/
FilterStr="Name=tag-key,Values=ec2"
# get ec2 instance id by tag
InstanceId=$(aws ec2 describe-instances --filters $FilterStr --query "Reservations[*].Instances[*].[InstanceId]" --output text)
OldPublicIpAddress=$(aws ec2 describe-instances --filters $FilterStr --query "Reservations[*].Instances[*].[PublicIpAddress]" --output text)
# generate an elastic ip address
NewPublicIpAddress=$(aws ec2 allocate-address --domain vpc --query "PublicIp" --output text)
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1440' height='461' viewBox='0 0 1440 461'%3E %3Cdefs%3E %3ClinearGradient id='a' x1='47.52%25' x2='105.613%25' y1='46.504%25' y2='40.293%25'%3E %3Cstop offset='0%25' stop-color='%23945DFF'/%3E %3Cstop offset='44.95%25' stop-color='%23C34CBB'/%3E %3Cstop offset='78.7%25' stop-color='%23E1418E'/%3E %3Cstop offset='95.7%25' stop-color='%23ED3D7D'/%3E %3C/linearGradient%3E %3ClinearGradient id='b' x1='103.217%25' x2='-128.059%25' y1='44.009%25' y2='67.169%25'%3E %3Cstop offset='0%25' stop-color='%23FCEE39'/%3E %3Cstop offset='100%25' stop-color='%23F37B3D'/%3E %3C/linearGradient%3E %3ClinearGradient id='c' x1='-48.456%25' x2='83.191%25' y1='84.04%25' y2='39.31%25'%3E %3Cstop offset='0%25' stop-color='%23FCEE39'/%3E %3Cstop offset='100%25' stop-color='%23F37B3D'/%3E %3C/linearGradient%3E %3ClinearGradient id='d' x1='0%25' y1='50%25' y2='50%25'%3E %3Cstop offset='0%25' stop-color='%23EF5A6B'/%3E %3Cstop offset='36.4%25' stop-