Skip to content

Instantly share code, notes, and snippets.

@yaegashi
yaegashi / azuredeploy.json
Last active Feb 12, 2020
Create DevTest Lab attached to exsiting VNet/Subnet (redacted ARM template)
View azuredeploy.json
{
"$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 Jan 18, 2020
lscpu and lspci output on Azure Standard_NV4as_v4
View console.txt
$ 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 Jan 18, 2020
DxDiag output on Azure Standard_NV4as_v4
View DxDiag.txt
------------------
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 Nov 18, 2019
connection_plugins/packer.py for Ansible 2.9.0 and Packer 1.4.5
View packer.py
# Copyright (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright 2015 Abhijit Menon-Sen <ams@2ndQuadrant.com>
# Copyright 2017 Toshio Kuratomi <tkuratomi@ansible.com>
# 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 / exercise-web-crawler.go
Created Mar 19, 2016
My solution for web crawler exercise in Go tour: http://tour.golang.org/concurrency/10
View exercise-web-crawler.go
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)
View basicexp-log.txt
$ 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 Oct 14, 2015
Ansible SSH connection using paramiko
View playbook.yml
---
- 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
View card.sh
#!/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"
View make-self-signed-cert-gnutls.sh
#!/bin/sh
set -e
if test $# -lt 2; then
echo "Usage: $0 <common name> <output> [<start> <end>]" >&2
exit 1
fi
cn=$1