Skip to content

Instantly share code, notes, and snippets.

@nmrmsys
nmrmsys / my_assistant.py
Created February 24, 2018 01:45
Google AIY Voice Kit - Custom Assistant Script - Support local command, button and Dangerous Shell Arts
#!/usr/bin/env python3
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@nmrmsys
nmrmsys / gist:497303aff5bb731a493b642b6e2a56fa
Last active November 29, 2017 06:54
Command to display the volume used by the container
sudo docker ps -q | xargs docker inspect -f '{{.Config.Hostname}} {{.Name}}{{println}}{{range .Mounts}} {{.Name}} {{.Destination}}{{println}}{{end}}'
Dim oArgs, oWSH, oFSO, oXLS, oWbk, oSht
Call Main
Sub Main
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oArgs = WScript.Arguments
For i = 0 to oArgs.Count - 1
Call CsvImpExcel(oArgs(i))
Next
aws ec2 describe-instances \
| jq -r '.Reservations[].Instances[] | select(.State.Name == "stopped") | [ .InstanceId, (.Tags[]? | select(.Key == "Name")).Value ] | @sh' \
| awk '{ print "echo Instance Starting... " $1 " " $2 "; aws ec2 start-instances --instance-ids " $1 }' | sh
cat sample.csv | printf %s "$(cat)" | jq -Rs 'split("\n") | map(split(",")) | map({"fld1": .[0], "fld2": .[1]})'
aws ec2 describe-instances | jq -r '.Reservations[].Instances[] | [.InstanceId, (.Tags[]? | select(.Key == "Name").Value)] | @csv'
@ECHO OFF
REM SQLB [FilePath] [ConStr]
REM デフォルト接続文字列
REM SET DCS=usr/pwd@srv
REM SET DCS=usr:pwd:db:srv\ins
REM デフォルトファイルパス
REM SET DFP=sql\*.sql