Mercurial > hgrepos > hgweb.cgi > skipweb
changeset 430:7034d4e4a062
copy file
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coop/#entry.rb?240999# Wed Dec 18 19:33:12 2013 +0900 @@ -0,0 +1,8 @@ +#!/usr/bin/env ruby +# coding: euc-jp + +idlist = (1..100).collect{rand(10000000)} +if idlist.index(ARGV[0].to_i) + print"hogehoge" +end +printf"%s",ARGV[0]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coop/entry.html Wed Dec 18 19:33:12 2013 +0900 @@ -0,0 +1,21 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> +<title>さんぷる</title> +<style type="text/css"> +<!-- + +--> +</style> +<link rel="stylesheet" type="text/css" href="ほげ.css"> +</head> + +<body> +<h1>QRコード</h1> +<p> +<img src="8178850.png" alt="QRコード" width="212" height="212"></p> +<address>c110128@f.koeki-u.ac.jp</address> + +</body> +</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coop/entry.rb Wed Dec 18 19:33:12 2013 +0900 @@ -0,0 +1,59 @@ +#!/usr/bin/env ruby +# coding: euc-jp + +require 'pg' +require 'cgi' +require 'date' + +c = CGI.new(:accept_charset => "EUC-JP") + +pghost = "localhost" +pgport = 5432 +pgoptions = nil +pgtty = nil +dbname = "coop" +dbuser = "c110128" +passwd = nil + +i = 0 +ip = ENV['REMOTE_ADDR'] + +print "Content-type: text/html; charset=EUC-JP\n\n" +print "<html> +<head><title>サンプル</title><link rel=\"stylesheet\" +type = \"text/css\" href=\"data.css\"></head><body>" + +begin + conn = PGconn.connect(pghost,pgport,pgoptions,pgtty,dbname,dbuser,passwd) + tuple = conn.exec( + "select count(*) from log;" + ) +rescue + print"<p>error</p>" +else + tuple.each{|line| + for comp in line + i = comp[1].to_i + end + } +end + +if i < 100 + i = i + 1 + + srand(56384679263254687) + 10000.times {rand(1000000)} + idlist = (1..100).collect{rand(10000000)} + if idlist.index(ARGV[0].to_i) + print"<p>おめでとう</p>" + print"<p>#{ip}</p>" + end +elsif i >= 100 + print"<p>ごめんなさい</p>" + print"<p>もう品切れです</p>" +else + print"<p>error</p>" + +end + +print"</body></html>\n"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coop/login.html Wed Dec 18 19:33:12 2013 +0900 @@ -0,0 +1,24 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> +<title>サンプルページ</title> +<style type="text/css"> +<!-- + +--> +</style> +<link rel="stylesheet" type="text/css" href="ほげ.css"> +</head> + +<body> +<h1>ああああ</h1> +<p>御利用ありがとうございます</p> + + + + +<address>c110128@f.koeki-u.ac.jp</address> + +</body> +</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coop/login.rb Wed Dec 18 19:33:12 2013 +0900 @@ -0,0 +1,87 @@ +#!/usr/bin/env ruby +# coding: euc-jp + +require 'pg' +require 'cgi' +require 'date' + +c = CGI.new(:accept_charset => "EUC-JP") + +i = 0 +pa = [] +day = [] +ip = ENV['REMOTE_ADDR'] + +pghost = "localhost" +pgport = 5432 +pgoptions = nil +pgtty = nil +dbname = "coop" +dbuser = "c110128" +passwd = nil + +print "Content-type: text/html; charset=EUC-JP\n\n" +print "<html> +<head><title>サンプル</title><link rel=\"stylesheet\" +type = \"text/css\" href=\"data.css\"></head><body>" +print"<p>#{ip}</p>" +begin + conn = PGconn.connect(pghost,pgport,pgoptions,pgtty,dbname,dbuser,passwd) + tuple = conn.exec( + "select count(*) from log;" + ) +rescue + print"<p>error</p>" +else + tuple.each{|line| + for comp in line + i = comp[1].to_i + end + } +end + +if i < 100 + + i = i + 1 + begin + conn = PGconn.connect(pghost,pgport,pgoptions,pgtty,dbname,dbuser,passwd) + tuple = conn.exec( + "select pass from pass where id = #{i};" + ) + rescue + print"<p>error</p>" + else + tuple.each{|line| + for comp in line + pa = comp[1] + print"<p>おめでとう</p>" + print"<p>パスワードは#{pa}です</p>" + end + } + end + day = Time.now + + begin + conn = PGconn.connect(pghost,pgport,pgoptions,pgtty,dbname,dbuser,passwd) + tuple = conn.exec( + "insert into log values('#{pa}','#{ip}','#{day}');" + ) + rescue + print"<p>error</p>" + else + tuple.each{|line| + for comp in line + + end + } + end + +elsif i >= 100 + print"<p>ごめんなさい</p>" + print"<p>もう品切れです</p>" +else + print"<p>error</p>" + +end + +print"</body></html>\n"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coop/pass.csv Wed Dec 18 19:33:12 2013 +0900 @@ -0,0 +1,100 @@ +1,UeJkolZs +2,wTA9lnSY +3,kPTprdhQ +4,yVikbT2a +5,PYluIVXR +6,JdQVITR5 +7,QrsuHXpx +8,qDPHfQ4F +9,ZFnABQa7 +10,AcjvugyH +11,UZ8cufiW +12,H5a0CWVZ +13,AnrHyNQz +14,nGEtA2OD +15,DTrGteal +16,8jGviSpf +17,P920GcXQ +18,Nrv23uR1 +19,pYxgyJVK +20,cLSDnAZa +21,nQ42IwbK +22,s0POX19K +23,wej2oiMc +24,NoR3Djdf +25,hCOSmfVp +26,HLvIdYUS +27,F2vTPCNS +28,PmEyxc0h +29,YxPbuGF7 +30,FwrKAdRD +31,0kWHDtLE +32,HpxdVKJe +33,8DzjJePu +34,FmI2ujGZ +35,eqWVFcgx +36,G2dgVlnA +37,bA7CYiDy +38,Aqnw2WM9 +39,0nDNaF1L +40,IKhT8QEY +41,73uAQwzi +42,CegT9jqp +43,lItzu7v9 +44,7E2vDgJ4 +45,gqNMI7Qt +46,gOG1nzqo +47,zvKlGiEp +48,rpASeJtu +49,LJosh6ue +50,59PR4p6l +51,K0D9ktGp +52,yE3CAhJc +53,vBf9EaeW +54,Xceu5YAF +55,tVPOi5vB +56,bJcQFHxL +57,JzagE6Ww +58,pfB3PSeU +59,9QE3z4ak +60,eZpKirGg +61,LqrmFvYI +62,ZnoClqwu +63,nU60X2Mi +64,Rd3OlvAX +65,TjsYnv1W +66,5EK4mD8R +67,YkhgylKO +68,kJ72X15P +69,j1NMZbyg +70,6idROeQc +71,Z3JbDWex +72,fvDtNzAZ +73,34YNS9xD +74,kp7SNDhd +75,KeLdI4ua +76,g6OMNYa5 +77,NV8LJYAc +78,2yPGFblv +79,3vljUb9O +80,nwpa3OEU +81,xUTDbEJP +82,pnaUvf7d +83,uf2dVhy9 +84,vZw5JGSs +85,u871exsP +86,H1rOpkfW +87,oP9sJxtL +88,C1vXmxpL +89,RhacbQ4l +90,QadAOuU6 +91,hRPVAaZQ +92,u0yphb5g +93,9MVrhAXO +94,CQEruboX +95,2osWTYKn +96,SZHxhebt +97,s4xjzeTL +98,1Fa50jXP +99,zUck5JaP +100,CShpV6eB
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coop/pass.rb Wed Dec 18 19:33:12 2013 +0900 @@ -0,0 +1,37 @@ +#!/usr/bin/env ruby +# coding: euc-jp + +pass = [] +c = [] +b = 0 + +def shuffle(a) + srand + 0.upto(a.length-1) do |i| + j = rand(a.length) + w = a[i] + a[i] = a[j] + a[j] = w + end + a +end + +pass = ("a".."z").to_a+("0".."9").to_a+("A".."Z").to_a + + + +while b <= 100 +pass = shuffle(pass) +c << pass[0..7].join + +b += 1 +end +b = 1 +c.uniq! + +open("pass.txt", "w") do |pass2| + while b <= 100 + pass2.printf("%d,%s\n",b,c[b]) + b += 1 + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coop/url.rb Wed Dec 18 19:33:12 2013 +0900 @@ -0,0 +1,22 @@ +#!/usr/bin/env ruby +# coding: euc-jp + + +pass = [] +i = 0 + +srand(56384679263254687) +10000.times {rand(1000000)} +idlist = (1..100).collect{rand(10000000)} + +while i <= 100 + pass << idlist[i] + i+=1 +end + +i=0 + +while i <= 100 + system("qrencode -o #{pass[i]}.png 'http://roy.e.koeki-u.ac.jp/~c110128/mycgi/coop/entry.rb?#{pass[i]}' ") + i+=1 +end