This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'open-uri' | |
require 'nokogiri' | |
require 'json' | |
sessions = [] | |
%w( | |
http://cedec.cesa.or.jp/2017/session/schedule_0830/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def combination(n, r) | |
factorial(n) / factorial(r) / factorial(n - r) | |
end | |
def permutation(n, r) | |
factorial(n) / factorial(n - r) | |
end | |
$factorial = { 0 => 1 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo letsencrypt certonly --staging --verbose --email name@example.com -d example.com -w /home/www/example.com/htdocs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/main/IrcIO/Server.pm | |
+++ b/main/IrcIO/Server.pm | |
@@ -829,6 +829,9 @@ sub _MODE { | |
}; | |
for (;$mode_char_pos < $n_params;$mode_char_pos += $mode_param_offset + 1) { | |
+ if (substr($msg->param($mode_char_pos), 0, 1) eq ' ') { | |
+ next; | |
+ } | |
$mode_param_offset = 0; # これは毎回リセットする。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -ruN bind-9.9.7-P1/lib/dns/tkey.c bind-9.9.7-P2/lib/dns/tkey.c | |
--- bind-9.9.7-P1/lib/dns/tkey.c 2015-06-18 07:48:03.000000000 +0900 | |
+++ bind-9.9.7-P2/lib/dns/tkey.c 2015-07-15 08:50:22.000000000 +0900 | |
@@ -650,6 +650,7 @@ | |
* Try the answer section, since that's where Win2000 | |
* puts it. | |
*/ | |
+ name = NULL; | |
if (dns_message_findname(msg, DNS_SECTION_ANSWER, qname, | |
dns_rdatatype_tkey, 0, &name, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@download_dir = File.join(Dir.pwd, 'download') | |
FileUtils.mkdir_p(@download_dir) | |
prefs = { | |
download: { | |
prompt_for_download: false, | |
default_directory: @download_dir, | |
} | |
} | |
Selenium::WebDriver::Chrome.driver_path = File.join(Dir.pwd, 'chromedriver') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'webrick' | |
require 'webrick/httpproxy' | |
require 'optparse' | |
require 'fileutils' | |
opts = { | |
port: 8080, | |
outdir: '.', | |
} | |
optparse = OptionParser.new("USAGE: #{$0} [OPTIONS]", 20) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/main/Tiarra/Resolver.pm | |
+++ b/main/Tiarra/Resolver.pm | |
@@ -269,6 +269,8 @@ sub _paranoid_stage2 { | |
if ($entry->answer_status eq $entry->ANSWER_OK) { | |
if (grep { $data eq $_ } @{$entry->answer_data}) { | |
$closure->(1, $entry->query_data, $entry); | |
+ } else { | |
+ $closure->(0, undef, $entry); | |
} | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cli53=$HOME/bin/cli53 | |
. $HOME/.ec2/env | |
ec2-describe-instances | \ | |
perl -lane '/^INSTANCE/ and $name = $F[3]; /^TAG/ and $F[3] eq "Name" and print "$F[4] CNAME $name"' | \ | |
xargs -n 3 -r $cli53 rrcreate aws.example.com --ttl 60 --replace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'win32ole' | |
app = WIN32OLE.new('iTunes.Application') | |
# p app.ole_obj_help | |
# p app.ole_methods | |
tracks = app.LibraryPlaylist.Tracks | |
puts "Num of tracks: #{tracks.Count}" | |
tracks.each do |track| | |
%w(Artist Name Album).each do |name| |
NewerOlder