Skip to content

Instantly share code, notes, and snippets.

View KentaroAOKI's full-sized avatar

kekekekenta KentaroAOKI

View GitHub Profile
@KentaroAOKI
KentaroAOKI / aws_usage.py
Created September 7, 2011 09:02 — forked from noneal/aws_usage.py
A script to query the AWS usage reports programmatically.
#!/usr/bin/env python
"""
A script to query the Amazon Web Services usage reports programmatically.
Ideally this wouldn't exist, and Amazon would provide an API we can use
instead, but hey - that's life.
Basically takes your AWS account username and password, logs into the
website as you, and grabs the data out. Always gets the 'All Usage Types'
@KentaroAOKI
KentaroAOKI / aws_all_prev_usage.sh
Created September 7, 2011 10:09
A script to use https://gist.github.com/1200104 to query the All AWS usage reports programmatically.
#!/bin/sh
AWSUSAGE=aws_usage.py
TEMPFILE=/tmp/aws_all_prev_usage$$.xml
USERID=$1
PASSWORD=$2
if [ "" = "$USERID" ]
then
exit
@KentaroAOKI
KentaroAOKI / Dockerfile
Created December 23, 2014 02:03
Creating a base Docker image with ASP.NET vNext and Mono.
# We will use an existing image based on the
# verson 3.10 of Mono.
# This will be automatically retrieved from the Docker Hub.
# Docker Hub is Dockers community repository of pre-built containers
FROM mono:3.10
# Ensure everything is up to date on the machine and install unzip
RUN apt-get -qq update && apt-get -qqy install unzip
# Install ASP.NET vNext and latest K Runtime Environment (KRE)
RUN curl -s https://raw.githubusercontent.com/aspnet/Home/master/kvminstall.sh | sh
RUN bash -c "source /root/.kre/kvm/kvm.sh \
@KentaroAOKI
KentaroAOKI / Dockerfile
Created December 23, 2014 07:06
Creating an ASP.NET vNext Docker Image for "/aspnet/Home/samples/HelloMvc"
FROM microsoft/aspnet
# copy the contents of the local directory to /app/ on the image
ADD . /app/
# set the working directory for subsequent commands
WORKDIR /app
# fetch the NuGet dependencies for our application
RUN kpm restore
# set the working directory for subsequent commands
WORKDIR /app/Home/samples/HelloMvc
# expose TCP port 5000 from container
@KentaroAOKI
KentaroAOKI / project.json
Created December 23, 2014 07:19
/Home/samples/HelloMvc/project.json for Nowin
{
"dependencies": {
"Kestrel": "1.0.0-*",
"Microsoft.AspNet.Diagnostics": "1.0.0-*",
"Microsoft.AspNet.Hosting": "1.0.0-*",
"Microsoft.AspNet.Mvc": "6.0.0-*",
"Nowin.vNext": "1.0.0-*"
},
"commands": {
"web": "Microsoft.AspNet.Hosting --server Nowin.vNext",
@KentaroAOKI
KentaroAOKI / gist:d0c8c8e7d96eeed25410
Created June 2, 2015 07:19
url encode for azure ml
# Map 1-based optional input ports to variables
dataset <- maml.mapInputPort(1) # class: data.frame
library(RCurl)
id <- dataset[[1]]
text <- dataset[[2]]
text <- curlEscape(text)
text <- gsub("%20", " ", text, ignore.case = TRUE)
# The script MUST contain a function named azureml_main
# which is the entry point for this module.
#
# The entry point function can contain up to two input arguments:
# Param<dataframe1>: a pandas.DataFrame
# Param<dataframe2>: a pandas.DataFrame
def azureml_main(dataframe1 = None, dataframe2 = None):
# Execution logic goes here
print('Input pandas.DataFrame #1:\r\n\r\n{0}'.format(dataframe1))
@KentaroAOKI
KentaroAOKI / letteranalysis.py
Created June 20, 2015 07:28
Japanese letter analysis for feature hashing
# The script MUST contain a function named azureml_main
# which is the entry point for this module.
#
# The entry point function can contain up to two input arguments:
# Param<dataframe1>: a pandas.DataFrame
# Param<dataframe2>: a pandas.DataFrame
# coding: UTF-8
def azureml_main(dataframe1 = None, dataframe2 = None):
import numpy as np
from pandas import Series, DataFrame
@KentaroAOKI
KentaroAOKI / azureml_divideletters.py
Created August 6, 2015 14:00
divide letters for text analysis
# The script MUST contain a function named azureml_main
# which is the entry point for this module.
#
# The entry point function can contain up to two input arguments:
# Param<dataframe1>: a pandas.DataFrame
# Param<dataframe2>: a pandas.DataFrame
# coding: UTF-8
def azureml_main(dataframe1 = None, dataframe2 = None):
import numpy as np
from pandas import Series, DataFrame
Private Function getRequestBody() As String
On Error GoTo ErrorsHandler
Dim BodyTemplate As String
Dim Params As String
Dim Values As String
Dim Body As String
Dim MyBody As String
Dim ParamName As String
Dim ParamValue As String