Skip to content

Instantly share code, notes, and snippets.

@tekei
tekei / 1_redmine_japaneses_docker-compose.yml
Last active May 8, 2021
redmine, MySQL, phpMyAdmin とりあえず構築用 (日本語対応)
View 1_redmine_japaneses_docker-compose.yml
version: '3.7'
volumes:
mysql:
redminefiles:
networks:
redmine:
services:
redmine:
image: redmine:4.2
restart: always
@tekei
tekei / disable-ipv6.yml
Created Feb 27, 2016
ansible : (ubuntu) disable IPv6
View disable-ipv6.yml
---
- hosts: localhost
connection: local
become: yes
tasks:
- name: remove ipv6 hosts entry
shell: sed -i -e '/::/d' -e '/IPv6/d' /etc/hosts
- name: find ipv6 kernel parameter
shell: sysctl --all | egrep '^net.ipv6\..*disable' | awk '{print $1}'
register: ipv6_sysctl_list
@tekei
tekei / get-ansible-galaxy-jdk180.sh
Created Feb 27, 2016
install oracle java 1.8.0_45 use "williamyeh.oracle" (ansible-garaxy)
View get-ansible-galaxy-jdk180.sh
#!/bin/sh
ANSIBLE_DIR=$1
mkdir -p ${ANSIBLE_DIR}/roles
cd ${ANSIBLE_DIR}
cat << EOS > galaxy.yml
# java install
- src: williamyeh.oracle-java
@tekei
tekei / get_power_on_vmid.sh
Created May 6, 2015
VMWare ESXi 5.5 : 起動中のVMIDを取得
View get_power_on_vmid.sh
#!/bin/sh
for mid in `vim-cmd vmsvc/getallvms | awk '{print $1}' | grep -v "Vmid"`
do
if [ "`vim-cmd vmsvc/power.getstate ${mid} | grep 'Powered'`" == "Powered on" ]; then
echo "power on : ${mid}"
fi
done
@tekei
tekei / check_global_ip.sh
Created May 6, 2015
グローバルIP変化監視。変化したらprowlに通知。
View check_global_ip.sh
#!/bin/sh
IP_ADDR_FILE="/var/lib/jenkins/current_global_ip"
CURRENT_IP_ADDR=`curl --max-time 10 -s http://inet-ip.info/`
CURL_STATUS=$?
if [ ${CURL_STATUS} -ne 0 ]; then
echo "error HTTP response / connect NG"
exit 1
@tekei
tekei / ping_check.sh
Created May 6, 2015
pingが通るまで待つ処理。jenkinsからのサーバ自動起動用。
View ping_check.sh
#!/bin/sh
PING_TARGET=$1
COUNT_LIMIT=$2
echo "try ping to ${PING_TARGET}"
COUNT=1
while true;do
@tekei
tekei / date_sugest.coffee
Created Jul 7, 2013
HTML キーボード入力を考慮したフィールド制御 まずは、カレンダフィールドの日付補完部分 (モジュール化前の動作仕様の検討版)
View date_sugest.coffee
# キーボード入力向け日付補完
# 動作検討版
#
# sugar.jsに依存しています
class DateSuggest
now: new Date()
japan_year:
"m": 1867,
"t": 1911,
@tekei
tekei / gist:3798571
Created Sep 28, 2012
QQ English (http://www.qqeng.com) のレッスン予約をToodledoに登録する
View gist:3798571
# -*- coding: utf-8 -*-
require 'mail'
require 'active_support/core_ext'
require 'date'
require 'toodledo'
gmail_account = 'xxxxxxxxx'
gmail_password = 'xxxxxxxx'
@tekei
tekei / gist:3775681
Created Sep 24, 2012
ネストしたArray, Hashに対する stringify_keys
View gist:3775681
require 'active_support/core_ext'
Array.class_eval do
def stringify_keys
map { |v| v.respond_to?('stringify_keys') ? v.stringify_keys : v }
end
end
Hash.class_eval do
alias :old_stringify_keys :stringify_keys
@tekei
tekei / ifunbox_conv.sh
Created Sep 24, 2012
ifunboxの文字化け解消
View ifunbox_conv.sh
#!/bin/bash
# macでフォーマットしたipodをWindowsに持ってきたときUnicodeの正規化により
# 困ったことになるのを解消
# Windows上で、cygwinとnkfが入っている環境を想定。
CMD_NKF=nkf32
CMD_AWK=gawk
IFS=$'\n'