Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@yyano
yyano / Growi_API.md
Last active April 25, 2019 01:12
GrowiのAPIについて

はじめに

API

method path parameter others parameters
pages.list GET user ページの一覧を取得
pages.create POST ページを作成
pages.update POST ページを更新
pages.get GET ページを取得
pages.seen POST ページのタグを取得
@yyano
yyano / 2019-04-05.md
Last active April 7, 2019 04:54
Raspberry Pi 3B+セットアップメモ

2019/04/05時点

Install Raspbian

@yyano
yyano / ec2-schedule-start.js
Created March 27, 2019 00:26
AWS Lambda - node.js 6.10 でEC2インスタンスを起動したり止めたり
var AWS = require('aws-sdk');
const ec2 = new AWS.EC2();
exports.handler = (event, context, callback) => {
if(typeof(event.ec2id) !== "undefined") {
ec2.startInstances({InstanceIds: [event.ec2id]}).promise()
.then((r) => {
console.log("START EC2 instance", event.ec2id);
callback(null, 'START EC2 instance: ' + event.ec2id);
@yyano
yyano / convertFixText.ps1
Created March 19, 2019 02:26
日本語が混じる固定長のShift_JISファイルの特定位置の文字を編集(削る)するPowershell
# 固定長のShift_JISファイルの特定位置の文字を削除する
$filename = "hogehoge.txt"
$tempfile = "ZZZZZ_$filename"
$enc = [Text.Encoding]::GetEncoding("Shift_JIS")
$fhIn = New-Object System.IO.StreamReader($filename, $enc)
$fhOut = New-Object System.IO.StreamWriter($tempfile, $false, $enc)
$isCuted = $FALSE
# 1行ずつ処理
while (($l = $fhIn.ReadLine()) -ne $null) {
@yyano
yyano / get_post_stream.php
Created April 14, 2018 08:11
GET/POSTとStreamのテスト用php
<?php
$server = var_export( $_SERVER, true );
file_put_contents( date('YmdHis')."_S.txt", var_export( $server,true ) );
$method = $_SERVER['REQUEST_METHOD'];
if ($method == 'POST') {
$post = var_export( $_POST, true );
file_put_contents( date('YmdHis')."_P.txt", var_export( $post,true ) );
}
@yyano
yyano / callShellDelete.sh
Last active March 15, 2018 11:24
Amazon CloudWatch + wget + AWS Lambda + DynamoDB + S3
#!/bin/sh
ls -la /tmp/
rm -rf /tmp/wget.$1
rm /tmp/urls.txt.$1
rm /tmp/$1.tar.gz
ls -la /tmp/

最初に

@yyano
yyano / awsEC2_make_git.txt
Last active December 30, 2017 04:40
AWS EC2でgitをsorceをダウンロードして、makeする
sudo yum update
sudo yum groupinstall "Development Tools"
sudo yum install zlib-devel.x86_64
sudo yum install perl-ExtUtils-MakeMaker curl-devel expat-devel openssl-devel
wget https://www.kernel.org/pub/software/scm/git/git-2.15.1.tar.xz
tar Jxfv git-2.15.1.tar.xz
cd git-2.15.1
@yyano
yyano / Twiml Bins, fax.incoming.xml
Created December 19, 2017 13:54
Twilio FAX Receive by Twilio Function. FAX受信をTwilioで。
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Receive action="https://ceaseless-trees-XXXX.twil.io/fax.received" />
</Response>
@yyano
yyano / wikipedia_dump_xml_to_json.go
Last active December 18, 2017 12:47
wikipediaのダンプXMLのpages-articles.xmlをpageごとにjsonファイルとして出力する
package main
import (
"bufio"
"encoding/json"
"encoding/xml"
"fmt"
"io/ioutil"
"log"
"os"