2014-12-01から1ヶ月間の記事一覧

Show table sizes in gigabytes on Redshift

STV_BLOCKLIST - Amazon Redshift select name as table_name, round((count(*) / 1024.0),2) as "GB" from stv_blocklist inner join (select distinct id, name from stv_tbl_perm) as names on names.id = stv_blocklist.tbl group by name order by "GB"…

Show running SQL on Redshift

STV_RECENTS - Amazon Redshift select pid, user_name, starttime, db_name, query, status from stv_recents where 1=1 and status = 'Running';

How to post a task to a Chatwork room using api

Preparation What you needs are ChatWork API Token Account ID Room ID First of all, ChatWorkToken. You can get it from link below: ChatWork After you get your token, follow this page. 認証方法 - チャットワークAPIドキュメント Next, Account D…

How to send an email via gmail api using bash

If you want to simply send an email from your servers, I think that the easiest way is using Gmail API. Not only unnecessary to launch mail server like postfix but also verify Email Address like in AWS. #!/bin/bash user="hoge@gmail.com" pa…

How to pipe only stderr in cron, and handle it as an arguement

01 8 * * * (bash hoge.sh >> /var/log/app/result.log) |& tee -a /var/log/app/result.log | fuga.sh "$(cat -)" Bash Reference Manual Bash Reference Manual tee(1) - Linux manual page fuga.sh can receive the value of "$(cat -)" as "$1".