I wanted to create a Windows VM using gcloud command line.
Tried the "Equivalent Command Line" syntax - the syntax failed.
After some trial and error, discovered that the --create-disk list of parameters needs to be repeated (please observe the script below).
gcloud compute instances create ifworker-0 \
--project=ceng-test \
--zone=us-east4-c \
--machine-type=n2-standard-2 \
--network-interface=nic-type=VIRTIO_NET \
--network-tier=PREMIUM \
--maintenance-policy=MIGRATE \
--provisioning-model=STANDARD \
--service-account=the-service-account \
--scopes=https://www.googleapis.com/auth/cloud-platform \
--tags=ifworker-net-0 \
--create-disk=mode=rw \
--create-disk=size=40GB \
--create-disk=type=projects/ceng-test/zones/us-central1-a/diskTypes/pd-balanced \
--create-disk=boot=yes \
--create-disk=auto-delete=yes \
--create-disk=image=projects/windows-cloud/global/images/windows-server-2022-dc-core-v20220513 \
--no-shielded-secure-boot \
--shielded-vtpm \
--shielded-integrity-monitoring \
--reservation-affinity=any
However, even then the script is failing - the error is reproduced below.
ERROR: (gcloud.compute.instances.create) Could not fetch resource:
- Invalid value for field 'resource.disks[0]': '{
"type": "PERSISTENT",
"mode": "READ_WRITE",
"boot": true,
"initializeParams": { },
"autoDele...'.
Boot disk must have a source specified.
Need some guidance here. Thanks for your attention and time.
As checked on your command, boot and image properties should be in the same line.
It should look like this.
--create-disk=boot=yes,image=projects/windows-cloud/global/images/windows-server-2022-dc-core-v20220513
Based on GCP's documentation the image properties should be included in the same line with --create-disk=[PROPERTY=VALUE,…] parameters, specifying the name of the image that will be initialized.
Below is the command that worked on my end:
gcloud compute instances create ifworker-0 \
--project=<project_name> \
--zone=us-east4-c \
--machine-type=n2-standard-2 \
--network-interface=nic-type=VIRTIO_NET \
--network-tier=PREMIUM \
--maintenance-policy=MIGRATE \
--provisioning-model=STANDARD \
--service-account=the-service-account \
--scopes=https://www.googleapis.com/auth/cloud-platform \
--tags=ifworker-net-0 \
--create-disk=mode=rw \
--create-disk=size=40GB \
--create-disk=type=projects/ceng-test/zones/us-central1-a/diskTypes/pd-balanced \
--create-disk=boot=yes,image=projects/windows-cloud/global/images/windows-server-2022-dc-core-v20220513 \
--create-disk=auto-delete=yes \
--no-shielded-secure-boot \
--shielded-vtpm \
--shielded-integrity-monitoring \
--reservation-affinity=any
Note:
Change <project_name> and/or service account details.
For "gcloud compute instances create" there should be only one --create-disk line per disk. In other cases multiple disks are created.
As we want only one disk, there should be only one line, with all parameters delimited by ",".
The correct example follows.
gcloud compute instances create ifworker-0 \
--project=<project_name> \
--zone=us-east4-c \
--machine-type=e2-micro \
--network-interface=nic-type=VIRTIO_NET \
--network-tier=PREMIUM \
--maintenance-policy=MIGRATE \
--provisioning-model=STANDARD \
--scopes=https://www.googleapis.com/auth/cloud-platform \
--tags=ifworker-net-0 \
--create-disk=mode=rw,size=40GB,type=projects/<project_name>/zones/us-central1-a/diskTypes/pd-balanced,boot=yes,auto-delete=yes,image=projects/windows-cloud/global/images/windows-server-2022-dc-core-v20220513 \
--no-shielded-secure-boot \
--shielded-vtpm \
--shielded-integrity-monitoring \
--reservation-affinity=any
I am trying to create a table from the CLI that has a few GSIs. However, It is returning an error:
Parameter validation failed: Missing required parameter in
GlobalSecondaryIndexes[5]: "IndexName" Missing required parameter in
GlobalSecondaryIndexes[5]: "KeySchema" Missing required parameter in
GlobalSecondaryIndexes[5]: "Projection"
This is what I have
aws dynamodb create-table \
--region=eu-west-2 \
--endpoint-url http://localhost:8000 \
--table-name PBA2 \
--attribute-definitions \
AttributeName=PK,AttributeType=S \
AttributeName=SK,AttributeType=S \
AttributeName=GSI1PK,AttributeType=S \
AttributeName=GSI1SK,AttributeType=S \
AttributeName=GSI2PK,AttributeType=S \
AttributeName=GSI2SK,AttributeType=S \
AttributeName=GSI3PK,AttributeType=S \
AttributeName=GSI3SK,AttributeType=S \
AttributeName=GSI4PK,AttributeType=S \
AttributeName=GSI4SK,AttributeType=S \
AttributeName=GSI5PK,AttributeType=S \
AttributeName=GSI5SK,AttributeType=S \
--key-schema \
AttributeName=PK,KeyType=HASH \
AttributeName=SK,KeyType=RANGE \
--provisioned-throughput ReadCapacityUnits=10,WriteCapacityUnits=10 \
--global-secondary-indexes \
'IndexName=GSI1,KeySchema=[{AttributeName=GSI1PK,KeyType=HASH},{AttributeName=GSI1SK,KeyType=RANGE}],Projection={ProjectionType=ALL}' \
'IndexName=GSI2,KeySchema=[{AttributeName=GSI2PK,KeyType=HASH},{AttributeName=GSI2SK,KeyType=RANGE}],Projection={ProjectionType=ALL}' \
'IndexName=GSI3,KeySchema=[{AttributeName=GSI3PK,KeyType=HASH},{AttributeName=GSI3SK,KeyType=RANGE}],Projection={ProjectionType=ALL}' \
'IndexName=GSI4,KeySchema=[{AttributeName=GSI4PK,KeyType=HASH},{AttributeName=GSI4SK,KeyType=RANGE}],Projection={ProjectionType=ALL}' \
'IndexName=GSI5,KeySchema=[{AttributeName=GSI5PK,KeyType=HASH},{AttributeName=GSI5SK,KeyType=RANGE}],Projection={ProjectionType=ALL}' \
ProvisionedThroughput="{ReadCapacityUnits=10,WriteCapacityUnits=10}"
I tried to follow this answer but as you see, I am not getting the result I want. How can I add multiple GSIs?
You have accidentally supplied ProvisionedThroughput=... as a 6th GSI.
Instead, it should be an (optional) attribute on each of the first 5 GSIs. Something like this (quote as needed:
IndexName=GSI1,KeySchema=[{AttributeName=GSI1PK,KeyType=HASH},{AttributeName=GSI1SK,KeyType=RANGE}],Projection={ProjectionType=ALL},ProvisionedThroughput={ReadCapacityUnits=10,WriteCapacityUnits=10} \
IndexName=GSI2,KeySchema=[{AttributeName=GSI2PK,KeyType=HASH},{AttributeName=GSI2SK,KeyType=RANGE}],Projection={ProjectionType=ALL},ProvisionedThroughput={ReadCapacityUnits=10,WriteCapacityUnits=10} \
....
I finally figure it out:
aws dynamodb create-table \
--region=eu-west-2 \
--endpoint-url http://localhost:8000 \
--table-name PBA2 \
--attribute-definitions \
AttributeName=PK,AttributeType=S \
AttributeName=SK,AttributeType=S \
AttributeName=GSI1PK,AttributeType=S \
AttributeName=GSI1SK,AttributeType=S \
AttributeName=GSI2PK,AttributeType=S \
AttributeName=GSI2SK,AttributeType=S \
AttributeName=GSI3PK,AttributeType=S \
AttributeName=GSI3SK,AttributeType=S \
AttributeName=GSI4PK,AttributeType=S \
AttributeName=GSI4SK,AttributeType=S \
AttributeName=GSI5PK,AttributeType=S \
AttributeName=GSI5SK,AttributeType=S \
--key-schema \
AttributeName=PK,KeyType=HASH \
AttributeName=SK,KeyType=RANGE \
--provisioned-throughput ReadCapacityUnits=10,WriteCapacityUnits=10 \
--global-secondary-indexes \
IndexName=GSI1,KeySchema=["{AttributeName=GSI1PK,KeyType=HASH}","{AttributeName=GSI1SK,KeyType=RANGE}"],Projection="{ProjectionType=ALL}",ProvisionedThroughput="{ReadCapacityUnits=10,WriteCapacityUnits=10}" \
IndexName=GSI2,KeySchema=["{AttributeName=GSI2PK,KeyType=HASH}","{AttributeName=GSI2SK,KeyType=RANGE}"],Projection="{ProjectionType=ALL}",ProvisionedThroughput="{ReadCapacityUnits=10,WriteCapacityUnits=10}" \
IndexName=GSI3,KeySchema=["{AttributeName=GSI3PK,KeyType=HASH}","{AttributeName=GSI3SK,KeyType=RANGE}"],Projection="{ProjectionType=ALL}",ProvisionedThroughput="{ReadCapacityUnits=10,WriteCapacityUnits=10}" \
IndexName=GSI4,KeySchema=["{AttributeName=GSI4PK,KeyType=HASH}","{AttributeName=GSI4SK,KeyType=RANGE}"],Projection="{ProjectionType=ALL}",ProvisionedThroughput="{ReadCapacityUnits=10,WriteCapacityUnits=10}" \
IndexName=GSI5,KeySchema=["{AttributeName=GSI5PK,KeyType=HASH}","{AttributeName=GSI5SK,KeyType=RANGE}"],Projection="{ProjectionType=ALL}",ProvisionedThroughput="{ReadCapacityUnits=10,WriteCapacityUnits=10}"
I have many Markdown files. They are in different folders and each one has its own relative links to images.
files are in folders like this:
C: \ doc \ index.md
C: \ doc \ part1 \ 1.md
C: \ doc \ part2 \ 2.md
C: \ doc \ part2 \ more \ 2.md
To run the command, I use the standard Windows console.
I can use the command:
pandoc C: \ doc \ index.md C: \ doc \ part1 \ 1.md C: \ doc \ part2 \ 2.md C: \ doc \ part2 \ more \ 2.md -o mybook.docx --toc
but it is too long.
It would be great if there was an option to input a text (or other) file with a list of Markdown files, for example, List1.txt contains:
C: \ doc \ index.md
C: \ doc \ part1 \ 1.md
C: \ doc \ part2 \ 2.md
C: \ doc \ part2 \ more \ 2.md
And the command text would look something like this:
pandoc list.txt -o mybook.docx --toc
Does anyone know this is possible?
I'm currently making a number of graphs for users on a server.
The code 'm using is as follows:
$RRDTOOL graph $SCUMCOUNTPATH/mtghour.png \
--start now-3600s --end now \
--alt-autoscale \
-w 343 -h 85 \
--lower-limit 0 \
--title "Last 90 Minutes" \
--color CANVAS#36393f00 \
--color BACK#36393f00 \
--color FONT#5b80e0 \
--color GRID#888888 \
--color MGRID#888888 \
--color SHADEA#36393f \
--color SHADEB#36393f \
--x-grid MINUTE:5:HOUR:20:MINUTE:30:0:%M \
--alt-y-grid --rigid \
--left-axis-format %2.0lf \
--rigid \
--watermark "$(date +'%a %b %d %H:%M %Z %Y')" \
DEF:nowcount=$SCUMCOUNTPATH/mtg.rrd:count:AVERAGE \
CDEF:up=nowcount,0,*,0,EQ,0,1,IF \
TICK:up#3b455e:1.0 \
LINE2:nowcount#5b80e0: \
GPRINT:nowcount:LAST:" Current\:%2.0lf" \
GPRINT:nowcount:AVERAGE:"Average\:%2.1lf" \
GPRINT:nowcount:MAX:"Maximum\:%2.0lf " >/dev/null
What this produces is this:
What I would like it to produce is this (Photoshopped):
Extra info:
I'm using RRDtool 1.5.5 in a linux environment and running the script with BASH scheduled with cron.
The option you require is --y-grid, or possibly --alt-y-grid.
First try using --alt-y-grid which tries to use a more intelligent algorithm to calculate optimum line placement. It might work better for you in general.
Failing that, try --y-grid 1:1. This means "put a line every 1.0, and label every line". As comparison, what you're seeing in your first graph (that you don't want) is --y-grid 0.1:10 where a line goes every 0.1 but only 1 in 10 are labelled.
More details in the RRDTool documentation here
I added texturePacker script to export sprite sheet and its working. I would like to know how to set 'Pre Multiply Alpha' and 'NPot any size' while exporting sheet through Xcode script?
Here is my present Code:
TP="/usr/local/bin/TexturePacker"
${TP} --smart-update \
--format cocos2d \
--padding 2 \
--main-extension "-ipadhd" \
--autosd-variant 0.5:-ipad \
--autosd-variant 0.5:-hd \
--autosd-variant 0.25: \
--opt RGBA8888 \
--data iOS/Resources/Game_SpriteSheet/CBirdSpriteSheet_1-ipadhd.plist \
--sheet iOS/Resources/Game_SpriteSheet/CBirdSpriteSheet_1-ipadhd.pvr.ccz \
SpriteSheet/Sprite_Sheet_1/*.png
Screenshot from external texture packer. I want same in script.
Have you tried adding the --premultiply-alpha and --size-constraints <value> options to the command? [1]
TP="/usr/local/bin/TexturePacker"
${TP} --smart-update \
--format cocos2d \
--padding 2 \
--main-extension "-ipadhd" \
--autosd-variant 0.5:-ipad \
--autosd-variant 0.5:-hd \
--autosd-variant 0.25: \
--opt RGBA8888 \
--premultiply-alpha \
--size-constraints NPOT \
--data iOS/Resources/Game_SpriteSheet/CBirdSpriteSheet_1-ipadhd.plist \
--sheet iOS/Resources/Game_SpriteSheet/CBirdSpriteSheet_1-ipadhd.pvr.ccz \
SpriteSheet/Sprite_Sheet_1/*.png
[1] http://www.codeandweb.com/texturepacker/documentation