Skip to content

Instantly share code, notes, and snippets.

View dzeyelid's full-sized avatar
🐹
Enjoying developing! 🌠

Kazumi OHIRA dzeyelid

🐹
Enjoying developing! 🌠
View GitHub Profile
@dzeyelid
dzeyelid / example.js
Created July 6, 2012 12:38
WinJS.Namespace に 関数を登録するときのトラップ - Metro App (javascript) ref: http://qiita.com/items/f24bd52b892cfb1c4bcf
WinJS.Utilities.markSupportedForProcessing(onItemClicked);
WinJS.Namespace.define('SampleData', {onItemClicked: onItemClicked});
@dzeyelid
dzeyelid / vms.bat
Last active May 4, 2017 04:59
Utility to use Azure VMs
@echo off
set CURRENT_DIR=%CD%
pushd %0\..
setlocal enabledelayedexpansion
set RESOURCE_GROUP=%1
set ACTION=%2
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"virtualMachineSize": {
"type": "string",
"defaultValue": "Standard_F1",
"allowedValues": [
"Standard_A0",
"Standard_A1",
@dzeyelid
dzeyelid / README.md
Last active January 23, 2018 12:22
Node-RED で sshd のログを監視するフローのサンプルです。

概要

Node-RED で sshd のログを監視するフローのサンプルです。

このフローは、Ubuntu の /var/log/auth.log を監視し、不正なSSHログインを検知します。検知すると Slack へ通知し、不正ログイン状況を集計してダッシュボードに表示します。

動作環境

  • Ubuntu 16.04 LTS
@dzeyelid
dzeyelid / azure-deploy.json
Last active February 25, 2018 12:52
Ubuntu, CentOS それぞれ 1台を同一ネットワーク上に構築するARMテンプレートです。 This is an ARM template to deploy Ubuntu and CentOS server on a virtual network on Azure.
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"adminUserName": {
"type": "string",
"minLength": 1
},
"adminPublicKey": {
"type": "securestring"
@dzeyelid
dzeyelid / install-jupyterhublab.sh
Last active March 18, 2018 10:43
Installation of JupyterHub and JupyterLab with jupyterlab-hub extension.
# Set password for JupyterHub login
sudo password $USER
# Update yum pacakges
sudo yum update -y
# Install anaconda3
cd /tmp
curl -O https://repo.continuum.io/archive/Anaconda3-5.1.0-Linux-x86_64.sh
bash Anaconda3-5.1.0-Linux-x86_64.sh -b
@dzeyelid
dzeyelid / azuredeploy.json
Last active March 19, 2021 15:05
Sample of ARM template to deploy Azure Database for MySQL.
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters":{
"databaseForMySqlAdminName": {
"type": "string"
},
"databaseForMySqlAdminPassword": {
"type": "securestring"
},
@dzeyelid
dzeyelid / slsTokenCache.json
Last active October 24, 2019 06:10
Ecample of empty subscription in `~/.azure/slsTokenCache.json`. See https://link.medium.com/eEGXRL1v20
{
"entries": [
{
"tokenType": "Bearer",
"expiresIn": 3600,
"expiresOn": "2019-10-21T08:57:07.417Z",
"resource": "https://management.core.windows.net/",
"accessToken": "<hidden>",
"refreshToken": "<hidden>",
"userId": "[email protected]",
@dzeyelid
dzeyelid / gist:5a6b3d289e48fe200ecd790c536cf47b
Last active October 24, 2019 06:10
Example of an authentication error when login to Azure with using `sls deploy`. See https://link.medium.com/eEGXRL1v20
$ sls deploy
Serverless: Removing .serverless directory
Serverless: Parsing Azure Functions Bindings.json...
Serverless: Building binding for function: hello event: httpTrigger
Serverless: Parsing Azure Functions Bindings.json...
Serverless: Building binding for function: goodbye event: httpTrigger
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Logging into Azure
@dzeyelid
dzeyelid / create-env-azure-bastion.sh
Created November 16, 2019 03:18
Bash script to create an environment for Azure Bastion
PREFIX=try-bastion
RESOURCE_GROUP_NAME=${PREFIX}-rg
LOCATION=japaneast
VNET_NAME=${PREFIX}-vnet
SUBNET_NAME=${PREFIX}-subnet
BASTION_NAME=${PREFIX}-bastion
BASTION_PUBLICIP_NAME=${PREFIX}-bastion-ip