2013������09·���30������
www.myhost.com ������������������\���\���\���\��я�����Web\µ\���\��������ҡޏ�ġޏ�����·�����������쏢������¡�/article ������²¼������ typepad �������ޏ�ġޏ�����·������������������ blog.myhost.com ������\���\���\���\���\�돢�·�����ď�����������������������¾���¹��������� Haproxy ���������Ώ����������������ҏ���������㏢��������������¼������³�����돢���������ď���������\���\�����¡�
\���\���\���\���\���\������������������������ޏ������������������̏�¡�\���\���\���\��������URL������ http://www.myhost.com/article/~ ���������·�����ď�������������¡���²���\��\���\\·���������������Ï��������·���������¾\µ���¼\Ð���¼������\���\½���¼\¹�����ҏ��½¼�����µ���»��������������������������������¡�
��돫����������� /etc/haproxy.cfg ������²¼µ���������������Ï���������������������option ���������������������̏���̏�ď�䏢�«��������������������¼«��ď��������·����
�����Ώ�������������ߏ�����������²¼µ������������������¡�
\���\���\���\���\���\������������������������ޏ������������������̏�¡�\���\���\���\��������URL������ http://www.myhost.com/article/~ ���������·�����ď�������������¡���²���\��\���\\·���������������Ï��������·���������¾\µ���¼\Ð���¼������\���\½���¼\¹�����ҏ��½¼�����µ���»��������������������������������¡�
��돫����������� /etc/haproxy.cfg ������²¼µ���������������Ï���������������������option ���������������������̏���̏�ď�䏢�«��������������������¼«��ď��������·����
global���³��������������¡�����𡯏��Ð http://www.myhost.com/article/top.html ������\��\���\»\¹���¹��������������¡�http://blog.myhost.com/top.html �������������������̏��½¼�����µ��������������¡�
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
maxconn 4096
chroot /usr/share/haproxy
user haproxy
group haproxy
daemon
defaults
log global
retries 3
maxconn 2000
contimeout 15000
clitimeout 50000
srvtimeout 50000
#---------------------------------------------------------------------
frontend main
bind *:8000������#���³���³������¼«����̏����¡������������¹������������»������
mode http
option forwardfor
option dontlognull
option httplog
option httpclose
acl acl-article path_dir article # \���\¹���� /artice �����������������ď�������¡�����������������¾���·���»���������
acl acl-article path_dir blog # \���\¹���� /blog �����������������ď�������¡�����������������¾���·���»���������
acl acl-pc hdr(host) -i www.myhost.com # \���\¹\������¾���� www.myhost.com �����������������ď�����������������������»���������
use_backend article if acl-article acl-pc #�돪������叢����AND¾���·���������backend������»���������
use_backend article if acl-article or acl-pc acl-blog #AND ������ OR�������»�����Џ�¡�(acl-article) or (acl-pc AND acl-blog)
use_backend pc-front if acl-pc
backend pc-front
balance roundrobin
mode http
option redispatch
option httpchk GET /alivecheck.html HTTP/1.0
cookie SERVERID insert nocache indirect
server web1 frontend-web1:8000 cookie web1 check inter 5000
server web2 frontend-web2:8000 cookie web2 check inter 5000
backend article
mode http
reqirep ^Host:\ ([^:]*?) Host:\ blog.myhost.com #\���\¹\������¾������½��Џ����¹���
reqirep ([^\ ]*)\ /article/(.*) \1\ /\2 #\���\¹������½��Џ����¹��𡯏���\���\¹\������¾���������ޏ�����½��Џ����¹��𡯏�����OK�����������������ԏ���ߏ���
server blog blog.myhost.com:80
�����Ώ�������������ߏ�����������²¼µ������������������¡�
- ³���acl������������\������¼\��������ҡ돫����������������ޏ����Ώ��������¹������
- backend_»���������»��Џ����������ď�ԏ�����acl������»������������¹������¾���¹���
- �����ď��¾���·���������\¹\��⏢�¼\¹����������⏢����������½��Џ��������������ޏ������돪������只���쏢����AND������������������������������
- �����ď��¾���·��������� OR ���������������������²������������ OR ������������������������������
- ¾���·���1 OR ¾���·���2 ¾���·���3 ������½��Џ����������� ¾���·���1 OR (¾���·���2 AND ¾���·���3���� �����¡돪؏��������������������
- backend������»���������������������¾�������������������������¡�¾���·������̏��«�����ӏ�����¾���¹��������������ď��¾���·��������ҏ�����������½��Џ�����
- reqirep ������\���\¹\���������¹��ԏ�𡭏�����½��Џ����¹��𡯏�����\���\������¼\���
- reqirep ������HTTP\���\���\������¼������������\���\¹\������¾������½��Џ����¹��𡯏���������̏���ߏ��̏�������
- reqirep���о�������HTTP\���\���\������¼������������\¹\��⏢�¼\¹������\��\¹\�ޏ��¼\�ߏ��¹����������̏���ߏ��̏�������
- server ������\���\¹\������¾������������������������\����¼\���������¹���������»������������¹����������̏���ߏ��̏�������
\«\���\��\�����¡�Linux
2013������06·���17������
µ�ߏ��·�����ӏ�����������autoit������»��������쏢���Ï��������·�����ď��������³��������¡��¹���������«������»������������������ҏ����돢���������������������ď���������\���\�����¡�
Windows7 + Ruby2.0�����¡����������������������돢���������ď�¡�
���½��������²½
require 'win32ole'
ai = WIN32OLE.new('AutoItX3.Control')
���\���\��\���\���\��Ï��¾������»���������
���¾����돢�������ԏ���̏�����²¼µ�������½µ������»��������Ï��³���������������������������
������¼���\���\�� [LAST]����[ACTIVE] ����(»²¹�������
���\��\��\������¾������»������������·������¼���¹���
ai.Run("calc.exe")
��� Window������\��\���\���\��\��ӏ��������¹������
ai.winActivate("(\���\���\���\���\��Ï��¾)","(�����������������������\���\\¹\������¾)",(wait��������ď��))
#����
ai.winActivate("��������·���²���","���«���������«���������������·������")
��� Window����³«���������������ҏ����ԏ�����
ai.winWaitActive("(\���\���\���\���\��Ï��¾)","(�����������������������\���\\¹\������¾)", (wait��������ď��))
#����
ai.winWaitActive("��������·���²���","���«���������«���������������·������",10)
��� \���\\¹\���\���\���\���\¹������������»��⏢����µ�����Џ��¹������
ai.ControlSetText("(\���\���\���\���\��Ï��¾)","(�����������������������\���\\¹\������¾)","[NAME:txtCondSeihinmei]", "(µ�����Џ�����»��⏪��)")
ai.ControlSetText("¾��䏢돪㏢������","","[NAME:txtCondSeihinmei]", "\���\���\���\���\���\��폢�¼\��ď��¼1000ml")
��� \���\���\��я�����²����¹
ai.ControlClick("(\���\���\���\���\��Ï��¾)","(�����������������������\���\\¹\������¾)", "[NAME:(\³\���\����¼\���\���\������¾)]", "(\���\���\¹\���\���\���)")
#����
ai.ControlClick("��������·���²���", "", "[NAME:btnDisplayDetail]", "left")
��� Window������\���\���\���\���������¼������������¹������
¼������������µ������������\���\���\���\�������������»���\³���¼\���������Shift-JIS������������������¡½���������¹��������돪������������������돪�
#window\���\���\���\���������»���������¾���¹���
ai.winGetTitle("[????:(\���\��\���\���\���\���\���\���\���ID)]")
#\���\���\¹������\���\���\¹\���\���\¹������¹���������»���������¾���¹���
ai.winGetTitle("[CLASS:(\���\���\¹���¾); INSTANCE:(\���\���\¹\���\���\¹������¹���)]")
#����
ai.winGetTitle("[CLASS:WindowsForms10.Window.8.app.0.378734a; INSTANCE:2]")
��� \���¼\���\���\��
ai.Send("(\���¼����������»���)")
#����
ai.Send("{TAB}")
ai.Send("{ENTER}")
ai.Send("^c") #ctrl + c
��� \���\���\���\��\��䏢�¼\�����������돫�
ai.ClipPut("(������»��⏪��)") #\���\���\���\��\��䏢�¼\���������µ������
ai.ClipGet() #\���\���\���\��\��䏢�¼\�������������������¼���������
ai.Send("^v") #\��⏢�¼\¹\���
��� Window�����ҏ�����������������
ai.winClose("(\���\���\���\���\��Ï��¾)","(�����������������������\���\\¹\������¾)")
#����
ai.winClose("��������·���²���")
��� Window������������돩�³������
ai.winExists("(\���\���\���\���\��Ï��¾)","(�����������������������\���\\¹\������¾)") == 1
#����
ai.winExists("��������·���²���", "") == 1
Windows7 + Ruby2.0�����¡����������������������돢���������ď�¡�
���½��������²½
require 'win32ole'
ai = WIN32OLE.new('AutoItX3.Control')
���\���\��\���\���\��Ï��¾������»���������
���¾����돢�������ԏ���̏�����²¼µ�������½µ������»��������Ï��³���������������������������
������¼���\���\�� [LAST]����[ACTIVE] ����(»²¹�������
���\��\��\������¾������»������������·������¼���¹���
ai.Run("calc.exe")
��� Window������\��\���\���\��\��ӏ��������¹������
ai.winActivate("(\���\���\���\���\��Ï��¾)","(�����������������������\���\\¹\������¾)",(wait��������ď��))
#����
ai.winActivate("��������·���²���","���«���������«���������������·������")
��� Window����³«���������������ҏ����ԏ�����
ai.winWaitActive("(\���\���\���\���\��Ï��¾)","(�����������������������\���\\¹\������¾)", (wait��������ď��))
#����
ai.winWaitActive("��������·���²���","���«���������«���������������·������",10)
��� \���\\¹\���\���\���\���\¹������������»��⏢����µ�����Џ��¹������
ai.ControlSetText("(\���\���\���\���\��Ï��¾)","(�����������������������\���\\¹\������¾)","[NAME:txtCondSeihinmei]", "(µ�����Џ�����»��⏪��)")
ai.ControlSetText("¾��䏢돪㏢������","","[NAME:txtCondSeihinmei]", "\���\���\���\���\���\��폢�¼\��ď��¼1000ml")
��� \���\���\��я�����²����¹
ai.ControlClick("(\���\���\���\���\��Ï��¾)","(�����������������������\���\\¹\������¾)", "[NAME:(\³\���\����¼\���\���\������¾)]", "(\���\���\¹\���\���\���)")
#����
ai.ControlClick("��������·���²���", "", "[NAME:btnDisplayDetail]", "left")
��� Window������\���\���\���\���������¼������������¹������
¼������������µ������������\���\���\���\�������������»���\³���¼\���������Shift-JIS������������������¡½���������¹��������돪������������������돪�
#window\���\���\���\���������»���������¾���¹���
ai.winGetTitle("[????:(\���\��\���\���\���\���\���\���\���ID)]")
#\���\���\¹������\���\���\¹\���\���\¹������¹���������»���������¾���¹���
ai.winGetTitle("[CLASS:(\���\���\¹���¾); INSTANCE:(\���\���\¹\���\���\¹������¹���)]")
#����
ai.winGetTitle("[CLASS:WindowsForms10.Window.8.app.0.378734a; INSTANCE:2]")
��� \���¼\���\���\��
ai.Send("(\���¼����������»���)")
#����
ai.Send("{TAB}")
ai.Send("{ENTER}")
ai.Send("^c") #ctrl + c
��� \���\���\���\��\��䏢�¼\�����������돫�
ai.ClipPut("(������»��⏪��)") #\���\���\���\��\��䏢�¼\���������µ������
ai.ClipGet() #\���\���\���\��\��䏢�¼\�������������������¼���������
ai.Send("^v") #\��⏢�¼\¹\���
��� Window�����ҏ�����������������
ai.winClose("(\���\���\���\���\��Ï��¾)","(�����������������������\���\\¹\������¾)")
#����
ai.winClose("��������·���²���")
��� Window������������돩�³������
ai.winExists("(\���\���\���\���\��Ï��¾)","(�����������������������\���\\¹\������¾)") == 1
#����
ai.winExists("��������·���²���", "") == 1
\«\���\��\�����¡�Ruby
2013������04·���18������
»���������Windows PC������������ Ruby2.0������¾������²�����ď�돪����������叢���������я�����������gem���������¹�����я�����������\���\���\¹\������¼\�����������������������������ď�¡�nokogiri ������½��䏢�������������������Ï��Ï��Ï�¡�����������»��������� gem ������������������¡��³��������������������������¡�
\���\���\¹\������¼\���»��Џ����� libxml2������libxslt���̏��µ���������쏢���������䏢����������������������������������¾��؏����ӏ����������������ď�����������¡�²¼µ������¾��Ï����я�����²���·������«������»�ߏ����������ď��̡�������«�����������ď�¡�»���������PC������������MinGW�����������Џ����������������쏢���������돢¡�libxml2 ������ libxslt ������\³\���\���\���\������¹�����������������������Ï��������������������������������«�����������ď�¡�
Windows������Ruby 2.0������Nokogiri������»���������
���½�����я�����»���������²���·�����������������¡�����³������¼��������쏢�����������������������������������̏�¡���aws-sdk������gem�����ҏ����Џ��������������³��������¡ߏ�¡�
���������¼���³�����������������������Ï������������������������������«���������µ�����������Џ���������̏��«��������������������¡�
���̏�¡�aws-sdk 1.8.5 �����ҏ����Џ����������ď�������¡�돪������� gem ���������������� nokogiri ���̏����Џ����������������쏢������¡��¹�����я����������� nokogiri 1.5.9 x86-mingw32 ����\���\���\¹\������¼\������µ�����������ď�¡������������ӏ��³�������������«�����������������ď��̏�¡��³���������������������·���������¹��������¡�
\���\���\¹\������¼\���»��Џ����� libxml2������libxslt���̏��µ���������쏢���������䏢����������������������������������¾��؏����ӏ����������������ď�����������¡�²¼µ������¾��Ï����я�����²���·������«������»�ߏ����������ď��̡�������«�����������ď�¡�»���������PC������������MinGW�����������Џ����������������쏢���������돢¡�libxml2 ������ libxslt ������\³\���\���\���\������¹�����������������������Ï��������������������������������«�����������ď�¡�
Windows������Ruby 2.0������Nokogiri������»���������
���½�����я�����»���������²���·�����������������¡�����³������¼��������쏢�����������������������������������̏�¡���aws-sdk������gem�����ҏ����Џ��������������³��������¡ߏ�¡�
���������¼���³�����������������������Ï������������������������������«���������µ�����������Џ���������̏��«��������������������¡�
���̏�¡�aws-sdk 1.8.5 �����ҏ����Џ����������ď�������¡�돪������� gem ���������������� nokogiri ���̏����Џ����������������쏢������¡��¹�����я����������� nokogiri 1.5.9 x86-mingw32 ����\���\���\¹\������¼\������µ�����������ď�¡������������ӏ��³�������������«�����������������ď��̏�¡��³���������������������·���������¹��������¡�
\«\���\��\�����¡�Ruby
2013������01·���22������
\³���¼\�������������돪؏�����¾���½��������� binding.pry ������½��Џ����������������쏢������������¡��½���³������ pry ����³«���������������������������̏�¡�����������������µ»��ӏ����ҏ��«������»����·�����������Ώ����ď����������������������ď�¡�
Rubyist������������\���\Ð\���\�돢����������Pry������binding.pry���̏����쏢�¹���¹������ - (��Ρ�����)o�ߏ�� sasata299's blog
�����������돢���� gem ������\���\���\¹\������¼\�����¡�
Rubyist������������\���\Ð\���\�돢����������Pry������binding.pry���̏����쏢�¹���¹������ - (��Ρ�����)o�ߏ�� sasata299's blog
�����������돢���� gem ������\���\���\¹\������¼\�����¡�
gem install pry pry-doc\��ď��¼\���\���\��������� pry �����������������������������������������я�����µ�������돢�¹��������¡�¼����������������ޏ�����\³���¼\���������binding.pry������½����������³���·�����������Ώ��������³���������������¹��������¡�
a = "hoge"pry����³«�����������ď�����a���������Џ�ď�ԏ�����������ď�������ҏ������¾�����������������Ώ����������я��������쏢����»�ߏ�����¼���¹��ԏ��¹���������������Ï��Ï���
binding.pry
puts a
NoMethodError: undefined method ����pry���� for #<0x007f82720ab508>0x007f82720ab508>