Skip to content

Instantly share code, notes, and snippets.

View kayo-tozaki's full-sized avatar

Kayo Tozaki kayo-tozaki

  • Japan
View GitHub Profile
@kayo-tozaki
kayo-tozaki / mail_sender.sh
Created December 16, 2016 12:28
get website status and send alert mail
LANG=ja_JP.utf8
CURL_DATA=`curl --connect-timeout 30 -vvvv http://<your.website.url> 2>&1 `
IF_DATA=`echo $CURL_DATA | grep "HTTP/1.1 200 OK"`
SENDER=`cat mail_flag`
DATE=`date +"%Y/%m/%d %H:%M:%S"`
if [ -n "$IF_DATA" ]; then
if [ "$SENDER" = "2" ]; then
echo -e "$DATE\n$CURL_DATA" | col -b | mailx -s 'Recovery' <send_alart@mail.address>
SENDER=1
@kayo-tozaki
kayo-tozaki / rbenv_installer.yml
Created April 25, 2016 07:01
install ruby via rbenv
---
- hosts: ruby
name: install ruby require packages for actioning server
become: yes
vars:
RBENV_ROOT: /usr/local/rbenv
user: hogehoge
group: fugafuga
tasks:
- name: groupadd docker hogehoge
@kayo-tozaki
kayo-tozaki / Vagrantfile
Last active May 16, 2019 09:48
vagrantfile for ubuntu-gui
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# ↓yes proxy statement / not set using NAT only
config.proxy.http = "http://your.proxy.address:port_num"
config.proxy.https = "https://your.proxy.address:port_num"
# ↓no proxy statement
#config.proxy.http = ""