azure】 azure命令行工具【win】


安装 azure 命令行

sudo apt-get install nodejs-legacy

sudo apt-get install npm

sudo npm install -g azure-cli

这将输出一个网址和一个设备代码,供你使用浏览器登录

azure login

这将在控制台中提示你的密码

azure login -u

这将使用一个服务委托人登录

azure login -u "" -p "" --service-principal --tenant ""

查找名称中含有Linux的image

azure vm image list | grep "Linux"

启动一个新的虚拟机(在asm模式下)

azure vm create ${vm_name} ${image_name} -u ${azureuser} -p "${password}" -z "Small" -e -l "West US"

列出虚拟机的磁盘

azure vm disk list

移除标有LABEL的虚拟机的所有磁盘

for disk in $(azure vm disk list | grep LABEL | awk '{print $2}')

do

    azure vm disk delete --blob-delete "$disk"

done

在 "West US "创建存储账户$myacct

azure storage account create ${storage_account} --label ${storage_account} --location 'West US'

设置默认账户环境变量

export AZURE_STORAGE_ACCOUNT=$account_name

export AZURE_STORAGE_ACCESS_KEY=$account_key

基于存储文件创建一个虚拟机镜像

azure vm image create ${image_name} --os linux -l 'West Europe' --blob-url https:${storage_account}.blob.core.windows.net:443/vms/${image_name}.vhd -v

分享一个文件(例如一个vm image)

azure storage blob sas create -a ${storage_account} --container ${container} --blob ${filename} --permissions r

使用curl/wget从blob存储中下载一个文件

头部变量的值可以像这样计算: https:gist.github.com/jrwren/ff46f4ba177f042ccdc48c080c198f60

curl -v \

  -H "$x_ms_date_h" \

  -H "$x_ms_version_h" \

  -H "$authorization_header" \

"$URL"

svgo】 【Nodejs】


svgo

SVG Optimizer: a Nodejs-based tool for optimizing Scalable Vector Graphics files.

It applies a series of transformation rules (plugins), which can be toggled individually.

Optimize a file using the default plugins (overwrites the original file):

svgo test.svg

Optimize a file and save the result to another file:

svgo test.svg test.min.svg

Optimize all SVG files within a folder (overwrites the original files):

svgo -f path/to/folder/with/svg/files

Optimize all SVG files within a folder and save the resulting files to another folder:

svgo -f path/to/input/folder -o path/to/output/folder

Optimize SVG content passed from another command, and save the result to a file:

cat test.svg | svgo -i - -o test.min.svg

Optimize a file and print out the result:

svgo test.svg -o -

Optimize a file making sure a given plugin is enabled:

svgo --enable=plugin_name

Show available plugins:

svgo --show-plugins

分类列表:



腾图小抄 SCWY.net v0.03 小抄561条 自2022-01-02访问317694次