Skip to content

Instantly share code, notes, and snippets.

@akira-kuriyama
akira-kuriyama / create_public_key_for_chef.txt
Created February 4, 2014 07:23
ワンライナーで公開鍵作成
openssl genrsa 2048 > server.key
openssl req -new -key server.key -subj '/C=JP/ST=###/L=###/O=###/OU=###/CN=###' -out server.csr
openssl x509 -days 3650 -req -signkey server.key < server.csr > server.crt
package main
import (
"fmt"
"reflect"
)
func main() {
r := F([]int{1, 2, 3, 4, 5}).Map(func(x int) int { return x + 1 })
fmt.Println("result=" + fmt.Sprint(r))
@akira-kuriyama
akira-kuriyama / is_prime_number.rb
Last active August 29, 2015 14:18
Rubyで素数判定
def is_prime_number(num)
return false if num < 2 || num % 2 == 0
3.step(Math.sqrt(num), 2) { |i|
return false if num % i == 0
}
true
end
@akira-kuriyama
akira-kuriyama / easy_login.sh
Created August 6, 2013 06:03
パスワード入力なし、サーバー別名でログイン
#!/bin/bash
case $1 in
"a" ) SS=100;;
"b" ) SS=101;;
"c" ) SS=102;;
"d" ) SS=103;;
"e" ) SS=104;;
* ) SS=$1;;
esac
@akira-kuriyama
akira-kuriyama / gist:7857546
Last active December 30, 2015 16:49
Centos6でlocateを使う

CentOS6 だとlocateがないと言われる。

そういう場合は、

yum install mlocate

でインストールできる。

またインストールしたあとに最初にlocate xxxを実行すると

基本

メール送信の基本的な仕組みはメールサーバーを挟みメッセージのやり取りをする。 送信者はメールサーバーへメッセージを送信し、受信者はメールサーバーへメッセージを取りに行く。

MTA (Mail Transfer Agent)

メールサーバーが持つ、メール転送サーバソフト パソコンから送られてきたメールを受け取り、それをあて先へ送信する。あて先側のメールサーバーがそれを受け取る。

MUA (Mail User Agent)

FORMAT: 1A

ユーザAPI [/users/{id}]

Retrieve a User [GET]

  • Parameters

    • id: 1 (number, required) - ユーザID
  • Response 200 (application/json)

FORMAT: 1A

ユーザAPI [/users/{id}]

Retrieve a User [GET]

  • Parameters

    • id: 1 (number, required) - ユーザID
  • Response 200 (application/json)

FORMAT: 1A

Group ユーザAPI

ユーザ [/users/{id}]

ユーザの詳細 [GET]

処理概要

<!DOCTYPE html><html><head><meta charset="utf-8"><title>API Documentation</title><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"><style>@import url('https://fonts.googleapis.com/css?family=Roboto:400,700|Inconsolata|Raleway:200');.hljs-comment,.hljs-title{color:#8e908c}.hljs-variable,.hljs-attribute,.hljs-tag,.hljs-regexp,.ruby .hljs-constant,.xml .hljs-tag .hljs-title,.xml .hljs-pi,.xml .hljs-doctype,.html .hljs-doctype,.css .hljs-id,.css .hljs-class,.css .hljs-pseudo{color:#c82829}.hljs-number,.hljs-preprocessor,.hljs-pragma,.hljs-built_in,.hljs-literal,.hljs-params,.hljs-constant{color:#f5871f}.ruby .hljs-class .hljs-title,.css .hljs-rules .hljs-attribute{color:#eab700}.hljs-string,.hljs-value,.hljs-inheritance,.hljs-header,.ruby .hljs-symbol,.xml .hljs-cdata{color:#718c00}.css .hljs-hexcolor{color:#3e999f}.hljs-function,.python .hljs-decorator,.python .hljs-title,.ruby .hljs-function .hljs-title,.ruby .hljs-title .hljs-keyword,.perl .hljs-sub,.jav