Skip to content

Instantly share code, notes, and snippets.

View harupong's full-sized avatar

Haruo Nakayama harupong

View GitHub Profile
@harupong
harupong / file1.txt
Created November 21, 2013 23:23
Created via API
Demo
@harupong
harupong / curl.md
Created November 20, 2013 11:35 — forked from btoone/curl.md

Introduction

An introduction to curl using GitHub's API

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@harupong
harupong / mysb.md
Last active December 23, 2015 23:39
My SoftBank fetcher for Ruby

My SoftBank fetcher

This script fetchs and returns following data from My SoftBank(マイソフトバンク).

  • network usage
  • more to come, maybe? (bills, points, etc)

You must create/have the account for My SoftBank to use it.

How to use

最新バージョンの rdiscount だと Pro Git 原稿の HTML 変換に失敗する

回避策

rbenv でインストールした ruby にバージョン指定した rdiscount を導入する

$ rbenv version
1.9.3-p194 (set by /home/ubuntu/progit/.ruby-version)
@harupong
harupong / Vagrantfile
Created July 19, 2013 02:59
Windows 上の Vagrant を使って AWS で Ubuntu 13.04 を立ち上げたときの Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "dummy"
# https://github.com/mitchellh/vagrant-aws/issues/28
config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", disabled: true
config.vm.provider :aws do |aws|
aws.access_key_id = "<REDACTED>"

リポジトリごとに公開鍵認証を設定する

  1. 公開鍵認証用のパスフレーズ処理がめんどくさい(「/秘密のファイル/開くな.txtを開いてコピー&ペースト」)
  2. パスフレーズなしにするとセキュリティの懸念が!
  3. パスフレーズなしにして、用途限ったほうがよくね!? ←イマココ!

ということで、GitHub上にホストしてるOctopress用リポジトリ harupong/harupong.github.io 専用の公開鍵認証を設定してみた。

1. 専用の鍵を作る

@harupong
harupong / ansible_ripdiko.md
Last active August 29, 2015 13:59
Ansible で遊ぼう

TODO

linode-cli 用の apt-repo 追加で失敗する

2014-04-13 17:30 くらいの ansible.log を確認してみよう

ansible-playbook の GATHERING FACTS で SSH エラーが出た場合の検知と対応方法を探す

2014-04-13 00:31:21,448 p=2608 u=ubuntu |  PLAY [all] ********************************************************************
@harupong
harupong / error.log
Created February 10, 2014 06:20
progit/makepdfs ja error log
$ /bin/bash makepdfs ja
Will generate pdf for the following languages:
ja
The generation process will start now.
ja:
Parsing markdown... done
Creating main.tex for ja... Exception `Errno::EEXIST' at /usr/lib/ruby/1 .9.1/fileutils.rb:247 - File exists - /home/vagrant/projects/progit-ja/latex/ja
done
Running XeTeX:
@harupong
harupong / box_file_sender.rb
Last active August 29, 2015 13:56
Linux サーバー上で1日1つ生成されるファイルを Box に自動アップロードする
# coding: utf-8
# based on http://pgnote.net/?p=1842
require 'mail'
attachment = ARGV.shift
Mail.defaults do
delivery_method :smtp, {
:address => "<Server-Address>",