jq is useful to slice, filter, map and transform structured json data.
brew install jq
# Assume we are in your home directory | |
cd ~/ | |
# Clone the repo from GitLab using the `--mirror` option | |
$ git clone --mirror [email protected]:mario/my-repo.git | |
# Change into newly created repo directory | |
$ cd ~/my-repo.git | |
# Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks. |
$EC2SettingsFile="C:\\Program Files\\Amazon\\Ec2ConfigService\\Settings\\BundleConfig.xml" | |
$xml = [xml](get-content $EC2SettingsFile) | |
$xmlElement = $xml.get_DocumentElement() | |
foreach ($element in $xmlElement.Property) | |
{ | |
if ($element.Name -eq "AutoSysprep") | |
{ | |
$element.Value="Yes" | |
} |
#!/usr/bin/env python | |
import boto3 | |
import logging | |
import sys | |
from pprint import pprint | |
from time import sleep | |
import botocore.exceptions |
The various settings I use in VS Code. Useful, not only for new setups, but also sharing with others.
These preferences are organized in the order you might configure VS Code from scratch.
keybindings.json
)settings.json
)projects.code-workspace
)# list latest 10 event names and the next token | |
aws cloudtrail lookup-events \ | |
--max-items 10 \ | |
--lookup-attributes AttributeKey=EventSource,AttributeValue=ec2.amazonaws.com \ | |
--lookup-attributes AttributeKey=ReadOnly,AttributeValue=false \ | |
--starting-token "eyJOZXh0VG9rZW4iOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiOiAxMH0=" | \ | |
jq '.Events[].EventName,.NextToken' | |
"ModifyInstanceAttribute" |