Skip to content

Instantly share code, notes, and snippets.

View ogawa0071's full-sized avatar

Futa Ogawa ogawa0071

View GitHub Profile
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
FROM nginx
COPY ./index.html /usr/share/nginx/html
COPY ./default.conf /etc/nginx/conf.d/default.conf
FROM centos/httpd
WORKDIR /tmp
RUN yum update -y
RUN yum install -y httpd bash cyrus-sasl-lib glibc libaio libgcc libstdc++ ncurses-libs nss-softokn-freebl perl perl-Data-Dumper zlib
RUN curl -O https://download.cybozu.co.jp/cbgrn/grn-4.0.0a-linux-x64.bin
RUN curl -O https://download.cybozu.co.jp/cbgrn/grn-4.0-sp3-linux.bin
@ogawa0071
ogawa0071 / main.go
Created June 20, 2018 04:09
myhead
package main
import (
"bufio"
"flag"
"fmt"
"os"
)
func main() {
@ogawa0071
ogawa0071 / index.js
Created June 20, 2018 04:40
aws-media-services
const AWS = require("aws-sdk");
const medialive = new AWS.MediaLive({
region: "ap-northeast-1"
});
const mediapackage = new AWS.MediaPackage({
region: "ap-northeast-1"
});
const mediastore = new AWS.MediaStore({
region: "ap-northeast-1"
});
@ogawa0071
ogawa0071 / index.ts
Last active July 13, 2018 18:27
Creating Signed URLs with Node.js for Google Cloud Storage.
import Storage from "@google-cloud/storage";
const GCLOUD_STORAGE_BUCKET = (() => {
if (!process.env.GCLOUD_STORAGE_BUCKET) {
throw new Error();
}
return process.env.GCLOUD_STORAGE_BUCKET;
})();
@ogawa0071
ogawa0071 / index.ts
Created July 31, 2018 08:05
Google Cloud Storage's qmail logs to csv
import Storage from "@google-cloud/storage";
import Convert from "qmail-logs-to-csv/lib/Convert";
import readline from "readline";
import { resolve } from "path";
class Index {
async start() {
const bucket = Storage().bucket("migrate-alias-dmm-com");
const logsArray = (await bucket.getFiles({

sinmetal [09:25]
Query Magician 募集 https://gcpug.slack.com/archives/C0BCRUVNC/p1532966791000337

futa [00:00]
BigQueryでのクエリの書き方について質問させてください!

timestamp | email
というテーブルを持つEmail受信ログの元データがありまして、最終的に、60秒間に60回以上同じemailが出現している回数が何回あるか、emailごとに集計したいです。

>```sql

sudo apt-add-repository non-free && \
sudo apt-get update -y && \
sudo apt-get upgrade -y
sudo apt-get update -qq && sudo apt-get -y install \
autoconf \
automake \
build-essential \
cmake \
git-core \
const fs = require("fs");
const child_process = require("child_process")
const main = async () => {
const domainGSuite = '';
const _user = JSON.parse((await fs.promises.readFile("_user.json", { encoding: "utf8" })))
const user = JSON.parse(await fs.promises.readFile("user.json", { encoding: "utf8" }))
// const __domain = JSON.parse(await fs.promises.readFile("__domain.json", {encoding: "utf8"}))
const _domain = JSON.parse(await fs.promises.readFile("_domain.json", { encoding: "utf8" }))