Skip to content

Instantly share code, notes, and snippets.

View tekei's full-sized avatar

Masanori Takeda tekei

  • Japan
View GitHub Profile
@tekei
tekei / gist:3219437
Created July 31, 2012 18:51
convert bookmark from diigo to instapaper
# http://www.diigo.com/tools/exportからRSS Formatで取得したファイルを
# import.txtとして保存して実行
# 量が多いと、Rate Limit Exceededになるので注意
require "cgi"
require "net/https"
ril = File.read("import.txt")
unread = ril.scan(%r{<link>(.*?)</link>}m)
@tekei
tekei / audio change.scpt
Last active January 3, 2022 07:41
Change output audio format (frequency) script for macOS mojave 10.14
set rtn to choose from list {"44,100 Hz", "48,000 Hz", "96,000 Hz"} with prompt "出力フォーマット"
if (count rtn) is 0 then
return
end if
set fmt to item 1 of rtn
set target to {"BlackHole 2ch", "BlackHole 16ch", "Background Music", "Background Music (UI Sounds)", "MacBook Proのスピーカー"}
set processName to "Audio MIDI Setup"
set windowName to "オーディオ装置"
@tekei
tekei / 1_redmine_japaneses_docker-compose.yml
Last active May 8, 2021 00:37
redmine, MySQL, phpMyAdmin とりあえず構築用 (日本語対応)
version: '3.7'
volumes:
mysql:
redminefiles:
networks:
redmine:
services:
redmine:
image: redmine:4.2
restart: always
@tekei
tekei / ping_check.sh
Created May 6, 2015 10:39
pingが通るまで待つ処理。jenkinsからのサーバ自動起動用。
#!/bin/sh
PING_TARGET=$1
COUNT_LIMIT=$2
echo "try ping to ${PING_TARGET}"
COUNT=1
while true;do
@tekei
tekei / disable-ipv6.yml
Created February 27, 2016 14:31
ansible : (ubuntu) disable IPv6
---
- 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 February 27, 2016 14:29
install oracle java 1.8.0_45 use "williamyeh.oracle" (ansible-garaxy)
#!/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 / date_sugest.coffee
Created July 7, 2013 09:30
HTML キーボード入力を考慮したフィールド制御 まずは、カレンダフィールドの日付補完部分 (モジュール化前の動作仕様の検討版)
# キーボード入力向け日付補完
# 動作検討版
#
# sugar.jsに依存しています
class DateSuggest
now: new Date()
japan_year:
"m": 1867,
"t": 1911,
@tekei
tekei / gist:3798571
Created September 28, 2012 08:07
QQ English (http://www.qqeng.com) のレッスン予約をToodledoに登録する
# -*- 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 September 24, 2012 12:20
ネストしたArray, Hashに対する stringify_keys
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 September 24, 2012 00:04
ifunboxの文字化け解消
#!/bin/bash
# macでフォーマットしたipodをWindowsに持ってきたときUnicodeの正規化により
# 困ったことになるのを解消
# Windows上で、cygwinとnkfが入っている環境を想定。
CMD_NKF=nkf32
CMD_AWK=gawk
IFS=$'\n'