'via Blog this'より。 LWPでHostヘッダーを指定したいときには、
my $ua = new LWP::UserAgent;
print $ua->get("http://1.2.3.4/", Host => "www.domain.com")->content;
とするといいみたいです。
VirtualHostでわけているときはこんな感じですね。
my $ua = new LWP::UserAgent;
print $ua->get("http://1.2.3.4/", Host => "www.domain.com")->content;
とするといいみたいです。
VirtualHostでわけているときはこんな感じですね。
* Mac OS での設定例 Mac OS では eclipse.ini は Eclipse.app/Contents/MacOS/ にあります。 また、後述の no.mnemonic オプションは自動的に有効になります。 相対パスで指定する場合 -javaagent:../../../plugins/jp.sourceforge.mergedoc.pleiades/pleiades.jar 絶対パスで指定する場合 -javaagent:/Applications/eclipse/plugins/jp.sourceforge.mergedoc.pleiades/pleiades.jar
cd /usr/share/ssl/certs sudo wget https://www.digicert.com/testroot/DigiCertHighAssuranceEVRootCA.crt sudo chmod 666 ca-bundle.crt sudo cat DigiCertHighAssuranceEVRootCA.crt >> ca-bundle.crt sudo chmod 644 ca-bundle.crtこれでOK。vundleとか使っているとforce的にするもの面倒なのでこんな風に対処するといいらしい。
$ curl -Lk https://raw.github.com/gugod/App-perlbrew/master/perlbrew-install | bash curl: (60) SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed More details here: http://curl.haxx.se/docs/sslcerts.html curl performs SSL certificate verification by default, using a "bundle" of Certificate Authority (CA) public keys (CA certs). The default bundle is named curl-ca-bundle.crt; you can specify an alternate file using the --cacert option. If this HTTPS server uses a certificate signed by a CA represented in the bundle, the certificate verification probably failed due to a problem with the certificate (it might be expired, or the name might not match the domain name in the URL). If you'd like to turn off curl's verification of the certificate, use the -k (or --insecure) option.追記:こんな感じでエラーになっているときにも同じ方法で対応できる。
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt i386 : wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm x86_64 : wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm rpm -K rpmforge-release-0.5.2-2.el5.rf.*.rpm rpm -i rpmforge-release-0.5.2-2.el5.rf.*.rpm yum install gitgitってplusとかにも入っていないんですね。
#!perl
use LWP;
use Data::Dumper;
sub _system {
my ($cmd) = @_;
my $res = `$cmd`;
chomp $res;
return $res;
}
my %args = (
login => _system("git config --get github.user"),
token => _system("git config --get github.token"),
name => _system("git config --get github.user"),
description => 'test-repos',
homepage => '',
);
print Dumper \%args;
my $ua = LWP::UserAgent->new(
cookie_jar => +{},
);
my $res = $ua->post(
'https://github.com/api/v2/json/repos/create' => \%args
);
print $res->status_line . "\n";