Skip to content

Instantly share code, notes, and snippets.

@yaegashi
yaegashi / azuredeploy.json
Last active February 12, 2020 09:57
Create DevTest Lab attached to exsiting VNet/Subnet (redacted ARM template)
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {...},
"variables": {...},
"resources": [
{
"type": "Microsoft.Resources/deployments",
"name": "subnetTemplate",
"apiVersion": "2017-05-10",
@yaegashi
yaegashi / console.txt
Created January 18, 2020 21:39
lscpu and lspci output on Azure Standard_NV4as_v4
$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 2
Core(s) per socket: 2
Socket(s): 1
NUMA node(s): 1
@yaegashi
yaegashi / DxDiag.txt
Created January 18, 2020 21:33
DxDiag output on Azure Standard_NV4as_v4
------------------
System Information
------------------
Time of this report: 1/18/2020, 21:25:32
Machine name: d-tmpy1-win1
Machine Id: {DC52ECD2-6A96-4BED-A6AA-21A61A740026}
Operating System: Windows Server 2019 Datacenter 64-bit (10.0, Build 17763) (17763.rs5_release.180914-1434)
Language: English (Regional Setting: English)
System Manufacturer: Microsoft Corporation
System Model: Virtual Machine
@yaegashi
yaegashi / packer.py
Created November 18, 2019 09:43
connection_plugins/packer.py for Ansible 2.9.0 and Packer 1.4.5
# Copyright (c) 2012, Michael DeHaan <[email protected]>
# Copyright 2015 Abhijit Menon-Sen <[email protected]>
# Copyright 2017 Toshio Kuratomi <[email protected]>
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
@yaegashi
yaegashi / a
Created September 30, 2016 02:29
a
@yaegashi
yaegashi / exercise-web-crawler.go
Created March 19, 2016 09:34
My solution for web crawler exercise in Go tour: http://tour.golang.org/concurrency/10
package main
import (
"fmt"
)
type Fetcher interface {
// Fetch returns the body of URL and
// a slice of URLs found on that page.
Fetch(url string) (body string, urls []string, err error)
$ ansible-playbook -i localhost, basicexp-playbook.yml
PLAY [localhost] **************************************************************
TASK: [OK: ['a', 'b', 'c']] ***************************************************
ok: [localhost] => {
"msg": [
"a",
"b",
"c"
@yaegashi
yaegashi / playbook.yml
Created October 14, 2015 12:05
Ansible SSH connection using paramiko
---
- hosts: all
connection: paramiko
vars:
ansible_ssh_private_key_file: /path/to/private_key
ansible_ssh_pass: passphrase_for_private_key
tasks:
- debug:
msg: hello
@yaegashi
yaegashi / card.sh
Last active August 29, 2015 14:23
Card hand generator & matcher http://unix.stackexchange.com/a/211717/116972
#!/bin/bash
# This version conforms to Bash 3.2.53 on OS X.
stab=('\e[0;31;47m ♦' '\e[0;31;47m ♥' '\e[0;30;47m ♠' '\e[0;30;47m ♣')
ntab=(2 3 4 5 6 7 8 9 10 J Q K A)
match() {
for i; do
printf " ${stab[$((i/13))]}${ntab[$((i%13))]}\e[0m"
#!/bin/sh
set -e
if test $# -lt 2; then
echo "Usage: $0 <common name> <output> [<start> <end>]" >&2
exit 1
fi
cn=$1