This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ss = SpreadsheetApp.openById("{スプレッドシートのID}"); | |
var sh = ss.setActiveSheet(getTargetSheet(ss.getSheets(), "{シートの名前}")); | |
function import() { | |
// 最新mailからCSVを取得 | |
var csv = getNewestCSVFromGmailAttachment(); | |
// シートをまっさらに | |
sh.clear(); | |
// シートに書き込み |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var GMAIL_SEARCH_QUERY = "{Gmailの検索キーワード}"; | |
var ATTACHMENT_NAME = "{CSVのファイル名}"; | |
function getNewestCSVFromGmailAttachment() { | |
// 最新5件まで検索する | |
var thread = GmailApp.search(GMAIL_SEARCH_QUERY, 0, 5); | |
var messagesArray = GmailApp.getMessagesForThreads(thread); | |
// 中でも最新の1件の該当ファイルがついているメールから添付ファイルを変数にいれる | |
var newestAttachment, newestAttachmentDate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf-8 | |
parameters = dict( | |
owner=u"のぶじゃす", | |
name=u"31歳独身貴族日記", | |
action=u"楽しく暮らす", | |
target=u"山とカメラとプログラム", | |
) | |
formats = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import requests, datetime | |
import simplejson as json | |
SPACENAME = "xxxxxx" | |
APIKEY = "xxxxxxxxxxxxxxxxxxxxxxx" | |
PROJECT_NAME = u"xxx" | |
FIX_TEXT = u"完了" | |
USER_NAME = u"xxxxxxxxxxxx" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TODO: ルートユーザーにauthorized_keysを足すのが上手くいってない | |
# root_usersには該当するユーザー名のリストが入っている | |
# 各ユーザーのauthorized_keysを持ってきて root に足したい | |
# 各ユーザーのkeysが複数行だった場合にどんどん行数が増えてしまう | |
# そして冪等性が保たれない。つらい | |
- name: read root user's authorized_keys | |
shell: cat /home/{{item}}/.ssh/authorized_keys | |
with_items: root_users | |
register: output_keys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in `find . -name "*.*"` ; do for attr in `xattr $f` ; do xattr -d $attr $f ; done ; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Apache2 モジュール有効化 | |
action: command a2enmod {{item}} | |
tags: apache2 | |
register: result | |
changed_when: "'already enabled' not in result.stdout" | |
with_items: | |
- expires | |
- headers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set:PRIMARY> use dbname; | |
set:PRIMARY> db.collectionname.drop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget "http://nginx.org/keys/nginx_signing.key" | |
sudo apt-key add nginx_signing.key | |
sudo vi /etc/apt/sources.list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ pip install PIL |
NewerOlder