Hai sa fim practici!
RSS icon Email icon Home icon
  • Coldplay – Life in technicolor | Viva La Vida Prospekt’s March Edition 2008

    Posted on March 31st, 2009 admin No comments

    Desi pare destul de veche melodia aceasta, eu am descoperit-o destul de recent si mi se pare extraordinar de frumoasa.

    Un still progressiv care te umple de energie si care nu lasa loc de comentarii.

    Lipsind versurile, in versiunea de 2 minute, te determina sa o asculti la infinit.

    Versiunea II este are aceasi linie melodica in plus fiind versurile care sunt splendide.

    Videoclip Life in technicolor II – youtube: Life in technicolor

    Life in technicolor

    [audio:http://hwk.robits.org/wp-content/uploads/2009/03/101-coldplay-life-in-technicolor.mp3]

    Life in technicolor II

    [audio:http://hwk.robits.org/wp-content/uploads/2009/03/201-coldplay-life-in-technicolor-ii.mp3]

    Sper sa va placa melodiile. Auditie placuta ;)

  • Public IP Info v 0.4 – script TCL pentru eggdrop

    Posted on March 31st, 2009 admin 10 comments

    Acest script il puteti folosi pentru eggdrop pentru a va afisa, pe canalul IRC unde a fost declansata comanda, informatii despre un anumit IP.

    Foloseste ca sursa de informatii www.ip2location.com, iar informatiile solicitate le stocheaza intro “baza de date” proprie pentru a reduce solicitarea serverului unde este gazduit botul.

    De mentionat este faptul ca informatiile stocate sunt retinute pentru a o anumita perioada de timp (se poate seta in configuratia scriptului). In acest fel datale nu se vor invechi.

    Scriptul in actiune:

    [13:27] <hwk> !ipinfo 92.81.168.244
    [13:27] <Myth`> hwk IP information for 92.81.168.244: Country: ROMANIA, City: BACAU, ISP: ROMTELECOM DATA NETWORK, Domain: PLATINUM-IFN.RO

    Versiunea 0.1 a acestui script se poate descarca de pe www.egghelp.org, sectiunea TCL Archive, sub numele: Public IP information checker.

    Download latest version

    Version 0.4 (21.11.2011):

    ##########################################################################
    #         Public IP Info v0.4 by Hawkee - lowraider1@gmail.com
    #-----------------------------------------------------------------------
    # This script uses www.ip2location.com to check info for an ip adresses
    # It works with and without an ip2location.com account
    #
    # See the ip2location setting bellow
    #
    # Changes from version 0.3:
    #		-rewriten the code using namespaces
    #             -added future support for maxmind.com (will be released in new version)
    #		-added suport for trigger command customization (ipinfo_config(command))
    #		-added suport for customizing the output message
    #
    #
    # Works on all channels, and it can be used by all users. Requires TCL
    # HTTP PACK
    #
    # USAGE: !ipinfo <ip address>
    #
    # Email me with suggestions and bug reports at lowraider1@gmail.com
    #
    #					grtz HWK @ undernet
    #########################################################################
    
    set ipinfo_config(provider) 		"ip2location"; 		;# LEAVE AS IT IS!!! Which ip info provider to use. Values: ip2location, maxmind
    set ipinfo_config(ip2location_email) 	"your@mail.com"	;# ip2location account email address - leave empty for no account
    set ipinfo_config(ip2location_password) 	"yourpass"			;# ip2location account password
    
    set ipinfo_config(command)			"!ipinfo"			;# the command for calling the lookup
    set ipinfo_config(cachefile) 		"ipinfo.cache"		;# the cache file
    set ipinfo_config(cacherefresh) 		"7"				;# the time (in days) to refresh the info for an IP
    
    set ipinfo_config(message) 			"IP information for \00302%ip%\003: \002Country:\002 \00304%country%\003, \002City:\002 \00304%city%\003, \002ISP\002: \00302%isp%\003, \002Domain:\002 \00302%domain%\003"
    
    # You can use the following strings to build your output message
    ####
    # %ip% - the looked up ip
    # %country% - country name
    # %city% - city name
    # %isp% - the isp name
    # %domain% - domain holder
    
    ### dont bother editing
    ### will work in a future version
    set ipinfo_config(maxmind_email) "my@mail.com"		;# maxmind account email address - leave empty for no account
    set ipinfo_config(maxmind_password) "mypassword"		;# maxmind account password
    
    package require http
    namespace eval ipinfo {
    
    	variable config
    	array set config [array get ::ipinfo_config]
    
    	variable ip 0
    	variable results [list]
    	variable cache
    	variable uselogin 1 ;#variable to stop hammered invalid logins
    
    	variable version "0.4"
    
    	::http::config -useragent "Mozilla/5.0 ; Gecko"
    
    	namespace eval maxmind {
            ## to be continued ;)
            proc lookup {} {}
     	 proc fetch_info {ip} { }
    	 proc login {} {}
    	}
    
    	namespace eval ip2location {
    	 variable parent [namespace parent]
    	 variable cookies [list]
    
            proc lookup {} {
    		variable parent
    		set data [fetch_info [set ${parent}::ip]]
    
    		set rows [regexp -all -line -inline -- {<td>(.*)</td>} $data]
    		lappend ${parent}::results [unixtime]
    
    		if {[llength $rows] > 2}  {
    			set f 0
    			foreach {match content} $rows {
    				if {[expr { $f%2 }]} { lappend ${parent}::results [${parent}::strip-html $content]; }
    				incr f
        			}
    
    			set ${parent}::cache([set ${parent}::config(provider)],[set ${parent}::ip]) [set ${parent}::results];
    		} else {
    			${parent}::scream "FAILED - Invalid page response (maybe you ran out of credits)"
    
    		}
    	 }
    
    	 proc fetch_info {ip} {
    
    		variable parent
    		variable cookies
    
    		set headers [${parent}::make_headers $cookies]
       		set request [::http::geturl "http://www.ip2location.com/$ip" -timeout 3000 -headers $headers]
    		set data [::http::data $request]
    		::http::cleanup $request
    
    		return $data
    	 }
    
    	 proc login {} {
    
    		variable parent
    		variable cookies
    
    		set query [::http::formatQuery emailAddress [set ${parent}::config(ip2location_email)] password [set ${parent}::config(ip2location_password)] rememberMe on]
    		set submit [::http::geturl "http://ip2location.com/login" -timeout 3000 -query $query]
    
    		if {[regexp {<div class="error">(Invalid(.*))</div>} [::http::data $submit]]} {
    
    			${parent}::scream "LOGIN FAILED - Invalid account credentials (email or password)"
    			return 0;
    		}
    
    		upvar \#0 $submit state
    
    		set cookies [${parent}::get_cookies $state(meta)]
    
    		::http::cleanup $submit
    		${parent}::scream "LOGGED IN"
    
    		return 1;
    
    	 }
    	}
    
    	proc cache_lookup {ip} {
    		variable cache
    		variable config
    		variable results
    
    		if {[info exists cache($config(provider),$ip)]} {
    			if {[expr {(60*60*24)*$config(cacherefresh)}] < [expr {[unixtime] - [lindex $cache($config(provider),$ip) 0]}]} {
    				scream "refreshing cache data for $ip"
    				return 0;
    			} else { set results $cache($config(provider),$ip); scream "info for $ip found in cache"}
    		} else {return 0;}
    
    		return 1;
    	}
    
    	proc cache_load {} {
    		variable cache
    		variable config
    
    		if {[file exists $config(cachefile)]} {
    			if {![catch {source $config(cachefile)} cacheerror]} {
    				scream "cache file successfully loaded"
    			} else {
    				scream "cache file failed to load -: $cacheerror"
    				scream "trying to fix cache file: reset" ;
    				cache_save
    			}
    		} else {
    
    			cache_save
    			scream "cache file written - first time use"
    		}
    
    	}
    
    	proc cache_save {} {
    		variable config
    		variable cache
    
    		set write [open $config(cachefile) w]
    		puts $write	[list array set cache [array get cache]]
    		close $write
    
    	}
    
    	# creates a list of cookies from metadata
    	proc get_cookies {headers} {
    
    		set c [list]
     		foreach {name value} $headers {
    			if {$name eq "Set-Cookie"} {lappend c [lindex [split $value {;}] 0];}
     		}
    
    		return $c
    	}
    
    	# creates the cookie headers for http requests
    	#
    	proc make_headers {clist} {
    
    		return [list Cookie [join $clist {; }]]
    	}
    
    	proc make_msg {} {
    		variable ip
    		variable results
    		variable config
    
    		set location [split [lindex $results 1] ,]
    		set country [string trim [lindex $location 0]]
    		set city [string trim [join [lrange $location 1 end] ","]]
    
    		set output [string map [list %ip% $ip %country% $country %city% $city %isp% [lindex $results 3] %domain% [lindex $results 5]] $config(message)]
    
    		return $output;
    
    	}
    
    	proc init {} {
    
    		variable ip
    		variable config
    		variable uselogin
    		variable results
    
    		set results [list]
    
    		if {![login_status] && ([string length $config($config(provider)_email)] > 1) && $uselogin} {
    			set uselogin [${config(provider)}::login]
    		}
    		if {![cache_lookup $ip]} {
    			${config(provider)}::lookup;
    			cache_save;
    		}
    
    	}
    
    	proc get_results {} {
    
    		variable results
    		return [array get results]
    
    	}
    
    	# return the login status of the current provider
    	# returns: 	0 - not logged in
    	#		1 - logged in
    	proc login_status {} {
    		variable config
    
    		if {[llength [set ${config(provider)}::cookies]] < 2}  { return 0; }
    		return 1;
    	}
    
    	proc public_call {nick uhost hand chan args} {
    		variable ip
    		variable config
    		variable results
    
    		set input [string trimright [lindex $args 0] "."]
    
    		if {![regexp {^(?:(?:[01]?\d?\d|2[0-4]\d|25[0-5])(\.|$)){4}$} $input]} {
    			puthelp "privmsg $chan :$nick NO/Invalid IP pattern. USAGE: $config(command) 193.193.193.193"
    			scream "$chan $nick - INVALID IP"
    			return 1;
    		}
    
    		set ip $input
    		init
    
    		if {![llength $results]} {
    			puthelp "privmsg $chan :$nick No information found for IP: \00302$ip\003 please redefine your IP"
    			scream "$chan $nick - No results - SOMETHING MAY WENT WRONG"
    			return 1
    		}
    
    		puthelp "privmsg $chan :$nick [make_msg]"
    		scream "request: $nick on $chan"
    	}
    
    	# http://wiki.tcl.tk/6779
    	proc strip-html-ignore {text {ignore {}}} {
              set c 0
              foreach i $ignore {if {[regexp $i $text]} {return $text}}
              return ""
    	}
    
    	proc strip-html {html {ignore {}}} {
              regsub -all -- {<[^>]*>} $html "\[strip-html-ignore \[list &\] [list $ignore]\]" html
              set html [subst $html]
              return $html
    	}
    
    	proc scream {msg} {putlog "IP INFO: $msg"}
    
    	# init loads and binds
    	cache_load
    	bind pub -|- $config(command) ::ipinfo::public_call
    }
    
    putlog "Public IP Info $::ipinfo::version by HAWKEE Successfuly loaded"

    Version 0.3:

    ##########################################################################
    #         Public IP Info v0.3 by Hawkee - lowraider1@gmail.com           #
    #----------------------------------------------------------------------- #
    # This script uses www.ip2location.com to check info for an ip adresses  #
    #  It with both with and without ip2location account	                 #
    #
    # Using it without a ip2location.com account limits the script
    # functionality to 50 lookup's per day.
    #
    # If don't have a ip2location.com account your can register one for free #
    # and get 200 look-up per day.
    # 								 	 	   #
    # See the ip2location setting bellow 	                               #
    #									          #
    # Changes from version 0.2:					                 #
    #		-fixed some bugs                                           #
    #             -code optimizations 					          #
    #		-updated the recognition format
    #		-more error information
    #		-implemented ip2location.com account                       #
    #									          #
    #								                 #
    # Works on all channels, and it can be used by all users. Requires TCL   #
    # HTTP PACK								          #
    #								                 #
    # USAGE: !ipinfo 							   #
    # 					HAVE PHUN			          #
    # Email me with suggestions and bug reports at lowraider1@gmail.com 	   #
    #									          #
    #					grtz HWK @ undernet	                 #
    #########################################################################
    
    set ipinfo(useaccount) 		1			;#set this to 1 if you have a ip2location.com account and you want to use it
    set ipinfo(i2lmail)		"my@email.com"	;#set the login e-mail address from ip2location.com
    set ipinfo(i2lpass)		"mypassword"		;#set the account password from ip2location.com
    
    set ipinfo(cachefile) 		"ipinfo.cache"		;#the cache file
    set ipinfo(cacherefresh) 	"7"			;#the time (in days) to refresh the info for an IP
    
    set ver "0.3"
    
    #### END OF SETTINGs
    #### edit with caution from here on
    
    catch {array unset ipinfocache}
    unset -nocomplain COOKIES
    unset -nocomplain ::ipinfo(loginfailure)
    
    package require http
    
    set ipinfo(islogged) 0
    
    proc ipinfo:parser {nick uhost hand chan args} {
    
    	set ip [string trimright [lindex $args 0] "."]
    
    	if {![regexp {^(?:(?:[01]?\d?\d|2[0-4]\d|25[0-5])(\.|$)){4}$} $ip]} {
    		puthelp "privmsg $chan :$nick NO/Invalid IP pattern. USAGE: !ipinfo 193.193.193.193"
    		putlog "IP INFO $chan $nick - INVALID IP PATTERN"
    		return
    
    	}
    
    	set infoip [ipinfo:output $ip]
    
    	if {[string equal [lindex $infoip 0] -]} {
    
    		puthelp "privmsg $chan :$nick No information found for IP: \00302$ip\003 please redefine your IP"
    		putlog "IP INFO $chan $nick - No results - SOMETHING MAY WENT WRONG"
    		return
    	}
    
    	set country [lindex $infoip 0]
    	set city [lindex $infoip 1]
    	set isp [lindex $infoip 2]
    	set domain [lindex $infoip 3]
    
    	puthelp "privmsg $chan :$nick IP information for \00302$ip\003: \002Country:\002 \00304$country\003, \002City:\002 \00304$city\003, \002ISP\002: \00302$isp\003, \002Domain:\002 \00302$domain\003"
    	putlog "IPinfo request:  $nick on $chan"
    
    }
    
    proc ipinfo:dologin {} {
    
    	## getting login token
    	set login [::http::geturl "http://www.ip2location.com/login.aspx" -timeout 3000]
    	set logindata [::http::data $login]
    
    	::http::cleanup $login
    
    	## making sure we got the login method right
    	if {[regexp {
    } $logindata -> logtok]} {
    
    		set logque [::http::formatQuery __VIEWSTATE $logtok btnLogin.x 35 btnLogin.y 17 txtEmailAddress $::ipinfo(i2lmail) txtPassword $::ipinfo(i2lpass) chkRememberMe on]
    		set dologin [::http::geturl "http://www.ip2location.com/login.aspx" -timeout 3000 -query $logque]
    
    		if {[regexp {(Invalid(.*))} [::http::data $dologin]]} {
                            ::http::cleanup $dologin
    			putlog "IP INFO: FAILED - INVALID ACCOUNT DETAILS (mail or password)"
    			return 0;
    		}
    
    		upvar \#0 $dologin state
    		set cookies [list]
    
     		foreach {name value} $state(meta) {
        			if {$name eq "Set-Cookie"} {lappend cookies [lindex [split $value {;}] 0];}
     		}
    
    		::http::cleanup $dologin
    		putlog "IP INFO: LOGGED IN"
    		return $cookies
    	} 
    
    	putlog "IP INFO: FAILED - THE AUTH MECHANISM NOT compatible -- please e-mail: lowraider1@gmail.com with this issue"
    	return 0;
    }
    
    proc ipinfo:cookies {cookielist} {
    
    	return [list Cookie [join $cookielist {; }]]
    
    }
    
    proc ipinfo:getinfo {host} {
    global ipinfo ipinfocache
    
    	::http::config -useragent "Mozilla/5.0 ; Gecko"
    
    	set headers {}
    
    if {$::ipinfo(useaccount)} {
    
    	if {!$::ipinfo(islogged)} {
    
    		putlog "IP INFO: NOT LOGGED TRYING TO LOG IN";
    
    		set logstats [ipinfo:dologin]
    
    		if {$logstats != 0} {
    
    			set headers [ipinfo:cookies $logstats]
    			set ::COOKIES $headers
    			set ::ipinfo(islogged) 1
    		} else {
    			set ::ipinfo(loginfailure) 1
    			putlog "IP INFO: ERROR: LOGIN FAIL -- please check message";
    		}
    
    	} elseif {![info exists ::ipinfo(loginfailure)]} {
    		set headers $::COOKIES
    	}
    
    }
    
       	set http_req [::http::geturl "http://www.ip2location.com/$host" -timeout 3000 -headers $headers]
    
    	set data [::http::data $http_req]
    
    	::http::cleanup $http_req
    
    	if {[regexp {([^<]+)
    
    } $data -> country]} {
    		regexp {([^<]+)
    
    } $data -> city
    		regexp {([^<]+)
    
    } $data -> isp
    		regexp {([^<]+)
    
    } $data -> domain
    
    		set info [list $country $city $isp $domain [unixtime]]
    		set ipinfocache($host) $info
    
    	} else {
    		putlog "IP INFO: Lookup FAILURE";
    
    		set info {-}
    	}
    
    	return $info
    }
    
    proc ipinfo:output {host} {
    global ipinfo ipinfocache
    
    if {[info exists ipinfocache($host)]} {
    	if {[expr {(60*60*24)*$ipinfo(cacherefresh)}] < [expr {[unixtime] - [lindex $ipinfocache($host) 4]}]} {
    		putlog "IPinfo: refreshing cache data for $host"
    		set info [ipinfo:getinfo $host]
    		ipinfo:save
    		return $info
    	} else {
    	return $ipinfocache($host)
    	}
    } else {
    	set info [ipinfo:getinfo $host]
    	ipinfo:save
    	return $info
    }
    
    }
    
    proc ipinfo:save {} {
    global ipinfo ipinfocache
    
    set write [open $ipinfo(cachefile) w]
    puts $write	[list array set ipinfocache [array get ipinfocache]]
    close $write
    
    }
    
    proc ipinfo:read {} {
    global ipinfo ipinfocache
    
    if {[file exists $ipinfo(cachefile)]} {
    	if {![catch {source $ipinfo(cachefile)} cacheerror]} {
    		putlog "IPinfo: cache file successfully loaded"
    	} else {
    		putlog "IPinfo: cache file failed to load -: $cacheerror"
    		putlog "IPinfo: trying to fix cache file: reset" ; ipinfo:save
    
    	}
    } else {
    
    ipinfo:save
    putlog "IPinfo: cache file written - first time use"
    }
    
    }
    
    ipinfo:read
    
    bind pub -|- !ipinfo ipinfo:parser
    
    putlog "Public IP Info $ver by HAWKEE Successfuly loaded"

    Version 0.2:

    Diferentele intre cele doua versiuni fiind sistemul de stocare temporara a datelor.

    catch {array unset ipinfocache}
    #########################################################################
    #         Public IP Info v0.2 by Hawkee - lowraider1@gmail.com          #
    #-----------------------------------------------------------------------#
    # This script uses www.ip2location.com to check info for an ip adresses #
    #	You can use it in 2 modes: THE FREE ONE or THE Account one	  #
    #										  #
    # The free one works for 20 IP lookups per day, because this is the 	  #
    # maximum number of lookups, ip2location.com offers for unregistered 	  #
    # users - per ip -. Set ip2loc(account) (default) to use this.		  #
    #									         #
    # Changes from version 0.1:							  #
    #		-implemented a cache system to store the info to reduce	  #
    #		resource usage                                            #
    #             -the cache system refreshes the info at a given period of #
    #		time                                                      #
    #										  #
    #										  #
    # Works on all channels, and it can be used by all users. Requires TCL  #
    # HTTP PACK									  #
    #										  #
    # USAGE: !ipinfo <IP>							  #
    # 					HAVE PHUN				  #
    # Email me with suggestions and bug reports at lowraider1@gmail.com 	  #
    #										  #
    #							 grtz HWK @ undernet	  #
    #########################################################################
    
    set ipinfo(cachefile) 	"ipinfo.cache"		;#the cache file
    set ipinfo(cacherefresh) 	"7"					;#the time (in days) to refresh the info for an IP
    
    set ver "0.2 - mod"
    
    package require http
    
    #DO NOT EDIT BELOW FUCKER!#
    
    proc ipinfo:parser {nick uhost hand chan args} {
    
    set ip [string trimright [lindex $args 0] "."]
    
    if {![regexp {^(?:(?:[01]?\d?\d|2[0-4]\d|25[0-5])(\.|$)){4}$} $ip]} {
    puthelp "privmsg $chan :$nick NO/Invalid IP pattern. USAGE: !ipinfo 193.193.193.193"
    putlog "IP INFO $chan $nick - INVALID IP PATTERN"
    return
    
    }
    
    set infoip [ipinfo:output $ip]
    set country [lindex $infoip 0]
    set city [lindex $infoip 1]
    set isp [lindex $infoip 2]
    set domain [lindex $infoip 3]
    
    if {![info exists country] || [string equal $country -]} {
    puthelp "privmsg $chan :$nick No information found for IP: \00302$ip\003 please redefine your IP"
    putlog "IP INFO $chan $nick - No results"
    return
    }
    
    puthelp "privmsg $chan :$nick IP information for \00302$ip\003: \002Country:\002 \00304$country\003, \002City:\002 \00304$city\003, \002ISP\002: \00302$isp\003, \002Domain:\002 \00302$domain\003"
    putlog "IPinfo request:  $nick on $chan"
    
    }
    
    proc ipinfo:getinfo {host} {
    global ipinfo ipinfocache
    
    	::http::config -useragent "Mozilla/5.0 ; Gecko"
    
    	set que [::http::formatQuery ipaddresses $host]
       	set http_req [::http::geturl "http://www.ip2location.com/demo.aspx" -timeout 2000 -query $que]
    
    	set data [::http::data $http_req]
    	::http::cleanup $http_req
    
    	regexp {<span id="dgLookup__ctl2_lblICountry">([^<]+)</span></TD>} $data -> country
    	regexp {<span id="dgLookup__ctl2_lblICity">([^<]+)</span></TD>} $data -> city
    	regexp {<span id="dgLookup__ctl2_lblIISP">([^<]+)</span></TD>} $data -> isp
    	regexp {<span id="dgLookup__ctl2_lblIDomain">([^<]+)</span></TD>} $data -> domain
    
    	set info[list $country $city $isp $domain [unixtime]]
    
    	set ipinfocache($host) $info
    
    	return $info
    
    }
    
    proc ipinfo:output {host} {
    global ipinfo ipinfocache
    
    if {[info exists ipinfocache($host)]} {
    	if {[expr {(60*60*24)*$ipinfo(cacherefresh)}] < [expr {[unixtime] - [lindex $ipinfocache($host) 4]}]} {
    		putlog "IPinfo: refreshing cache data for $host"
    		set info [ipinfo:getinfo $host]
    		ipinfo:save
    		return $info
    	} else {
    	return $ipinfocache($host)
    	}
    } else {
    	set info [ipinfo:getinfo $host]
    	ipinfo:save
    	return $info
    }
    
    }
    
    proc ipinfo:save {} {
    global ipinfo ipinfocache
    
    set write [open $ipinfo(cachefile) w]
    puts $write	[list array set ipinfocache [array get ipinfocache]]
    close $write
    
    }
    
    proc ipinfo:read {} {
    global ipinfo ipinfocache
    
    if {[file exists $ipinfo(cachefile)]} {
    	if {![catch {source $ipinfo(cachefile)} cacheerror]} {
    		putlog "IPinfo: cache file successfully loaded"
    	} else {
    		putlog "IPinfo: cache file failed to load -: $cacheerror"
    		putlog "IPinfo: trying to fix cache file: reset" ; ipinfo:save
    
    	}
    } else {
    
    ipinfo:save
    putlog "IPinfo: cache file written - first time use"
    }
    
    }
    
    ipinfo:read
    
    bind pub -|- !ipinfo ipinfo:parser
    
    putlog "Public IP Info $ver by HAWKEE Successfuly loaded"