Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
if test $# -lt 2; then
echo "Usage: $0 <common name> <output> [ca options ...]" >&2
exit 1
fi
cn=$1
out=$2
shift 2
@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 / 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)
@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 <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 / 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
$ ansible-playbook -i localhost, basicexp-playbook.yml
PLAY [localhost] **************************************************************
TASK: [OK: ['a', 'b', 'c']] ***************************************************
ok: [localhost] => {
"msg": [
"a",
"b",
"c"
@yaegashi
yaegashi / a
Created September 30, 2016 02:29
a
#!/bin/sh
# Start ssh-agent and register environment variables permanently in HKCU.
# Copyright (C) 2013 YAEGASHI Takeshi <t@keshi.org>
# Use a fixed path for the ssh-agent socket endpoint.
# SSH_FIXED_SOCK="/tmp/ssh-agent-$(id -u).sock"
eval $(ssh-agent -k)