2014年11月29日土曜日

"Country of Tor ipaddress" takes time.

"Country of Tor ipaddresses" takes time.

$ time ./GeoIP-Tor-stdout
{"A1":3,"AE":4,"AR":9,"AT":91,"AU":37,"AX":1,"BA":2,"BE":20,"BG":20,"BR":22,"BY":2,"CA":115,"CH":86,"CL":5,"CO":4,"CR":1,"CY":1,"CZ":69,"DE":1272,"DK":39,"EC":1,"EE":8,"EG":3,"ES":26,"FI":61,"FR":342,"GB":222,"GR":17,"HK":21,"HR":7,"HU":35,"ID":1,"IE":14,"IL":17,"IN":10,"IR":6,"IS":24,"IT":54,"JE":1,"JP":66,"KH":1,"KR":12,"KY":1,"KZ":3,"LC":1,"LT":14,"LU":19,"LV":7,"MD":4,"MK":1,"MN":2,"MT":2,"MX":9,"MY":1,"NL":355,"NO":36,"NZ":11,"PA":5,"PL":50,"PT":10,"QA":1,"RO":37,"RS":4,"RU":208,"SA":5,"SE":177,"SG":11,"SI":1,"SK":20,"TH":5,"TN":1,"TR":6,"TW":10,"UA":61,"US":1383,"UY":1,"VE":1,"VN":3,"ZA":3}

real 0m41.711s


2014年11月28日金曜日

Tor Nodes

Communication Carrier of Tor "exit-address" Nodes.
at 2014/11/28

$ grep 'Edition' tor-ip.country | grep "AT&T" | wc
     28  
grep 'Edition' tor-ip.country | grep "NTT" | wc
     14  
$ grep 'Edition' tor-ip.country | grep "KDDI" | wc
     39  
$ grep 'Edition' tor-ip.country | grep "Softbank" | wc
      4    
$ grep 'Edition' tor-ip.country | grep "Google" | wc
      5  



2014年11月26日水曜日

GoLang: ssl client

 ssl client .
POST Method.

convert Integer to String and put Temper Data to https server.


 54 func PostData(Temp int) {
 55     tr := &http.Transport{
 56         TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
 57     }
 58     client := &http.Client{Transport: tr}
 59
 60     resp, err := client.PostForm(
 61         "https://☆☆☆☆.asp",
 62         url.Values{"☆☆": {strconv.Itoa(Temp)},
 63             "☆☆": {"☆☆"},
 64         })
 65     body, err := ioutil.ReadAll(resp.Body)
 66     resp.Body.Close()
 67
 68     fmt.Println(string(body), err)
 69 }




2014年11月25日火曜日

GoLang: GeoLocation Code


 41 func GeoIP_calc(ip string) string {
 42     var country string = ""
 43
 44 
 45     file := "GeoIP.dat"
 46 
 47     gi, err := geoip.Open(file)
 48     if err != nil {
 49         fmt.Printf("Could not open GeoIP database\n")
 50     }
 51 
 52     if gi != nil {
 53         country, _ = gi.GetCountry(ip)
 54     }
 55 
 56     return country
 57 }

GoLang: Alert

・funcに切り出した場合、関数の頭で定義(var, :=)しておく必要がある。
 しないと undefined: **** コンパイルエラーになる。

・連想配列には、MAPを使う。
      test := map[string]int{
          "a: 0,
       }



  

2014年11月24日月曜日

Go Lang Test

Go Lang  Test!


$ cat hello.go
package main

import "fmt"

func main() {
fmt.Printf("hello world\n")
fmt.Printf("hella.asdf\n")
fmt.Printf("hella.asdf\n")
}


$ go run hello.go
hello world
hella.asdf
hella.asdf

$ go bulid hello.go
$ ./hello
hello world
hella.asdf
hella.asdf

Spree Install

Rails EC Site / Spree Install Memo.

$ gem install spree_cmd
$ rails new ecsite
$ cd ecsite
$ spree install --auto-accept
$ rake db:migrate 
$ rake assets:clean 
$ rake assets:precompile

fd-find

 $ sudo apt install fd-find $ fdfind 石