<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rss [<!ENTITY % HTMLlat1 PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">]>
<rss version="2.0" xml:base="http://sysd.org/stas">
<channel>
 <title>stas&#039;den - perl</title>
 <link>http://sysd.org/stas/taxonomy/term/20/0</link>
 <description></description>
 <language>en</language>
<item>
 <title>The Pirate Bay un-SSL</title>
 <link>http://sysd.org/stas/node/220</link>
 <description>&lt;p&gt;
&lt;script src=&quot;http://slashdot.org/slashdot-it.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;/p&gt;

&lt;h2&gt;Theory&lt;/h2&gt;
&lt;p&gt;
Recently, the world saw &lt;a href=&quot;https://thepiratebay.org/&quot;
 target=&quot;_blank&quot;&gt;The Pirate Bay&lt;/a&gt; offering &lt;a
 href=&quot;http://www.slyck.com/story1691_SSL_Encrpytion_Coming_to_The_Pirate_Bay&quot;
 target=&quot;_blank&quot;&gt;SSL encryption&lt;/a&gt; on their server.
This means that your ISP won&#039;t know anymore which torrent you are
downloading, right? Wrong.&lt;br&gt;
&lt;a
 href=&quot;http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol_over_Secure_Socket_Layer&quot;
 target=&quot;_blank&quot;&gt;HTTPS&lt;/a&gt; is quite useless for
protecting static &lt;span style=&quot;font-weight: bold;&quot;&gt;and&lt;/span&gt;
public content. By &lt;span style=&quot;font-style: italic;&quot;&gt;static&lt;/span&gt;,
I do mean the &lt;code&gt;.torrent&lt;/code&gt; file itself. It is
always the same. By &lt;span style=&quot;font-style: italic;&quot;&gt;public&lt;/span&gt;,
I do mean than one doesn&#039;t need any kind of authentication to pick up
the content. It&#039;s always the same, for everyone. For &lt;a
 href=&quot;http://en.wikipedia.org/wiki/Web_crawler&quot; target=&quot;_blank&quot;&gt;crawlers&lt;/a&gt;,
too.&lt;br&gt;
So, one could easily index (&lt;a href=&quot;https://thepiratebay.org/top&quot;
 target=&quot;_blank&quot;&gt;a portion of&lt;/a&gt;) The Pirate Bay
torrent database by the &lt;a
 href=&quot;http://en.wikipedia.org/wiki/List_of_HTTP_headers&quot;
 target=&quot;_blank&quot;&gt;Content-Length&lt;/a&gt;. Then, one could
intercept some encrypted traffic between some machine(s) within his/her
network and the &lt;code&gt;torrents.thepiratebay.org&lt;/code&gt;
server. Knowing both (encrypted) request and response lengths, it is
possible to get a quite reliable list of matches from the previously
indexed torrent list.&lt;br&gt;
&lt;/p&gt;
&lt;h2&gt;Practice&lt;/h2&gt;
&lt;p&gt;
Don&#039;t try this at work, or you might hurt yourself &lt;img src=&quot;misc/smileys/wink.png&quot; title=&quot;Eye-wink&quot; alt=&quot;Eye-wink&quot; /&gt;&lt;br&gt;
&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Use &lt;a href=&quot;http://www.wireshark.org/&quot;
 target=&quot;_blank&quot;&gt;Wireshark&lt;/a&gt; to capture some torrent
downloads. Torrents are hosted on a separate server, which makes the
task easier yet. Just use the following capture filter: &lt;code&gt;&quot;tcp
and port 443 and host torrents.thepiratebay.org&quot;&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Now, just go with the stream &lt;img src=&quot;misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt; (&lt;span
 style=&quot;font-style: italic;&quot;&gt;&quot;Follow TCP Stream&quot;&lt;/span&gt;
for the packet you suspect belongs to the torrent download. This will
create another filter, just like &lt;code&gt;&quot;(ip.addr eq 192.168.0.10
and ip.addr eq 83.140.176.156) and (tcp.port eq 2157 and tcp.port eq
443)&quot;&lt;/code&gt;)&lt;/li&gt;
  &lt;li&gt;Just save the displayed stream anywhere else (&lt;code&gt;pcap1.pcap&lt;/code&gt;
sounds nice)&lt;/li&gt;
  &lt;li&gt;Now, use my quick&amp;amp;dirty &lt;a
 href=&quot;http://sysd.org/stas/files/active/0/TPB-TLSlen.pl.txt&quot;
 target=&quot;_blank&quot;&gt;TPB-TLSlen.pl&lt;/a&gt; Perl script to get
the request/response lengths:
    &lt;pre&gt;perl TPB-TLSlen.pl pcap1.pcap&lt;/pre&gt;
Yeah, I know, it is nasty. It only supports the &lt;a
 href=&quot;http://en.wikipedia.org/wiki/Transport_Layer_Security&quot;
 target=&quot;_blank&quot;&gt;TLS&lt;/a&gt; cypher. And it simply calls
the &lt;code&gt;tshark&lt;/code&gt; (the command line version of
Wireshark) to parse it&#039;s output.&lt;/li&gt;
  &lt;li&gt;Now, just paste the &lt;span style=&quot;font-weight: bold;&quot;&gt;REQ&lt;/span&gt;
and &lt;span style=&quot;font-weight: bold;&quot;&gt;RES&lt;/span&gt;
values &lt;a href=&quot;http://sysd.org/stas/node/220?req=560&amp;amp;res=91888#TPB&quot;&gt;below&lt;/a&gt;
&lt;img src=&quot;misc/smileys/lol.png&quot; title=&quot;Laughing out loud&quot; alt=&quot;Laughing out loud&quot; /&gt;&lt;br&gt;
(note that the &lt;span style=&quot;font-weight: bold;&quot;&gt;REQ&lt;/span&gt;
value is optional, setting it to 0 simply ignores the request size for
matching)&lt;/li&gt;
&lt;/ol&gt;
Note that you are able to fine-tune the maximum and minimum header
sizes. For the response, the headers are almost the same all the time.
The only thing that varies is the decimal representation of the file
length and age. (Un)fortuately, the request headers do vary for
different browsers and referring pages. However, knowing the request
size still helps a bit, specially if the torrent&#039;s filename was huge &lt;img src=&quot;misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;&lt;br&gt;
&lt;h2&gt;Precision&lt;/h2&gt;
&lt;p&gt;
The following size distribution chart was generated using the database with ~165K torrents:
&lt;p&gt;
&lt;img src=&quot;http://sysd.org/stas/files/active/0/Graph2.png&quot; width=&quot;640&quot; height=&quot;500&quot; alt=&quot;torrent size distribution&quot;&gt;
&lt;/p&gt;
The most common torrent size is ~14 KB, and it&#039;s easy to figure out that such torrents represent the shared 700 MB files &lt;img src=&quot;misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;&lt;br&gt;
There&#039;s also a major peak for the 454 bytes torrents. However, bigger torrents are less common, thus, the size detection technique becomes more precise. Now, the average &quot;distance&quot; between torrent sizes is ~44 bytes (at least for the sample I&#039;ve collected). So, adding a &lt;a href=&quot;http://en.wikipedia.org/wiki/HTTP_cookie&quot;
 target=&quot;_blank&quot;&gt;cookie&lt;/a&gt; with the random size up to 128 bytes will disrupt the size matching detection a lot. The request size disruption is even easier: the largest torrent &lt;a href=&quot;http://en.wikipedia.org/wiki/Uniform_Resource_Identifier&quot; target=&quot;_blank&quot;&gt;URI&lt;/a&gt; I&#039;ve found was 150 bytes-wide. Thus, padding every request URI to match 150 characters is enough to make the requests completely indistinguishable. Joining the pieces (the padding add-on strings are &lt;b&gt;bold&lt;/b&gt;):&lt;br&gt;
&lt;pre&gt;&lt;font color=&quot;#ff0000&quot;&gt;GET /4319199/[a4e]Ghost_in_the_Shell_TV_01-26.4319199.TPB.torrent&lt;b&gt;?nVM2UGfcG533un4ym70eT2&lt;br&gt;9r0WwBLYdmFCNN+UTV/hiJ7EAXdFU5KfdWHpkB5lXaCmITsACKOPVyjmpbaOB+CrI5&lt;/b&gt; HTTP/1.1
Host: torrents.thepiratebay.org
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208&lt;br&gt; Firefox/3.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: https://thepiratebay.org/recent
Cookie: language=pt_BR; country=BR; PHPSESSID=ad6cb7e414c8dc88e0c2444f6215165a
&lt;/font&gt;&lt;font color=&quot;#0000ff&quot;&gt;
HTTP/1.1 200 OK
Content-Type: application/x-bittorrent
Etag: &quot;2198642509&quot;
Last-Modified: Mon, 28 Jul 2008 22:28:59 GMT
Server: lighttpd
Content-Length: 91601
Date: Mon, 28 Jul 2008 22:37:56 GMT
X-Varnish: 108010229 107999438
Age: 253
Via: 1.1 varnish
Connection: keep-alive
&lt;b&gt;Set-Cookie: p=68eOfxOC7JwBYcMe1RJWC4Z5PV/lJzqJORW8KROPMH9zQhszSjFnRp2tsNWEoyabWAloneUaoz&lt;br&gt;MxYtx4hoM9MZUKE/7wGzC3ZKLEZdppG4og3W; expires=Mon, 28-Jul-2008 22:37:56 GMT; path=/;&lt;br&gt; domain=torrents.thepiratebay.org&lt;/b&gt;

&lt;i&gt;(binary torrent data)&lt;/i&gt;&lt;/font&gt;&lt;/pre&gt;

&lt;/p&gt;
&lt;h2&gt;Solution&lt;/h2&gt;
&lt;ol&gt;
  &lt;li&gt;Use a constant padding in the &lt;code&gt;.torrent&lt;/code&gt;
files. This messes things a bit, but stills ineffective. The only
advantage is &lt;span style=&quot;font-weight: bold;&quot;&gt;not&lt;/span&gt;
messing up with the server &lt;img src=&quot;misc/smileys/sad.png&quot; title=&quot;Sad&quot; alt=&quot;Sad&quot; /&gt;&lt;/li&gt;
  &lt;li&gt;Patch the &lt;a href=&quot;http://www.lighttpd.net/&quot;
 target=&quot;_blank&quot;&gt;lighttpd&lt;/a&gt; server so it sends a
non-lasting &lt;a href=&quot;http://en.wikipedia.org/wiki/HTTP_cookie&quot;
 target=&quot;_blank&quot;&gt;cookie&lt;/a&gt; with a random size.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Thanks&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.megahospedagem.com.br/&quot;
 target=&quot;_blank&quot;&gt;MEGA Hospedagem&lt;/a&gt;, for the network
resources provided for this tiny research &lt;img src=&quot;misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.warchalking.com.br/&quot;
 target=&quot;_blank&quot;&gt;http://www.warchalking.com.br/&lt;/a&gt;,
for the inspiration &lt;img src=&quot;misc/smileys/wink.png&quot; title=&quot;Eye-wink&quot; alt=&quot;Eye-wink&quot; /&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;a name=&quot;TPB&quot;&gt;

&lt;h2&gt;Encrypted session data&lt;/h2&gt;

&lt;p&gt;
&lt;form action=&quot;&quot; method=&quot;POST&quot;&gt;

&lt;input type=&quot;hidden&quot; name=&quot;edit[token]&quot; value=&quot;4a83f469aac47fa47d8f51de20729b95&quot; /&gt;

&lt;table summary=&quot;&quot;&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;b&gt;REQUEST&lt;/b&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;b&gt;RESPONSE&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
	&lt;td align=&quot;right&quot;&gt;SSL size:&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;input value=&quot;0&quot; type=&quot;text&quot; size=&quot;4&quot; name=&quot;req&quot;&gt;&lt;/td&gt;
	&lt;td align=&quot;center&quot;&gt;&lt;input value=&quot;0&quot; type=&quot;text&quot; size=&quot;7&quot; name=&quot;res&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
	&lt;td align=&quot;right&quot;&gt;Min header length:&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;input value=&quot;445&quot; type=&quot;text&quot; size=&quot;4&quot; name=&quot;min_req_hdr&quot;&gt;&lt;/td&gt;
	&lt;td align=&quot;center&quot;&gt;&lt;input value=&quot;283&quot; type=&quot;text&quot; size=&quot;4&quot; name=&quot;min_res_hdr&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
	&lt;td align=&quot;right&quot;&gt;Max header length:&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;input value=&quot;584&quot; type=&quot;text&quot; size=&quot;4&quot; name=&quot;max_req_hdr&quot;&gt;&lt;/td&gt;
	&lt;td align=&quot;center&quot;&gt;&lt;input value=&quot;290&quot; type=&quot;text&quot; size=&quot;4&quot; name=&quot;max_res_hdr&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;input type=&quot;submit&quot; value=&quot;check&quot;&gt;
&lt;/form&gt;
&lt;/p&gt;

&lt;h2&gt;Possible matches&lt;/h2&gt;

&lt;p&gt;
&lt;table width=&quot;100%&quot; border=&quot;1&quot; summary=&quot;&quot; style=&quot;font-size: 9px;&quot;&gt;
&lt;tr&gt;
	&lt;td align=&quot;center&quot;&gt;&lt;b&gt;The Pirate Bay URL&lt;/b&gt;&lt;/td&gt;
	&lt;td align=&quot;center&quot;&gt;&lt;b&gt;strlen(URI)&lt;/b&gt;&lt;/td&gt;
	&lt;td align=&quot;center&quot;&gt;&lt;b&gt;torrent size&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;&lt;td colspan=&#039;3&#039; align=&#039;right&#039;&gt;0 matches&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td colspan=&quot;3&quot; align=&quot;right&quot;&gt;
Torrents indexed:
1011548&lt;/td&gt;&lt;/tr&gt;

&lt;/table&gt;
&lt;/p&gt;
 </description>
 <category domain="http://sysd.org/stas/taxonomy/term/23">database</category>
 <category domain="http://sysd.org/stas/taxonomy/term/18">hack</category>
 <category domain="http://sysd.org/stas/taxonomy/term/30">music</category>
 <category domain="http://sysd.org/stas/taxonomy/term/7">network</category>
 <category domain="http://sysd.org/stas/taxonomy/term/20">perl</category>
 <category domain="http://sysd.org/stas/taxonomy/term/24">php</category>
 <category domain="http://sysd.org/stas/taxonomy/term/32">video</category>
 <category domain="http://sysd.org/stas/taxonomy/term/8">web</category>
 <pubDate>Thu, 31 Jul 2008 07:05:20 -0700</pubDate>
</item>
<item>
 <title>&quot;keyboard injection&quot; under Linux</title>
 <link>http://sysd.org/stas/node/151</link>
 <description>&lt;p&gt;
What to do if you want to pass some data into STDIN of some process,
and it doesn&#039;t accepts it?! One of the most (un)famous example is &lt;code&gt;ssh&lt;/code&gt;;
who never tried to do a &lt;code&gt;&quot;echo password | ssh host&quot;&lt;/code&gt;?!
So,&amp;nbsp;you just want to inject characters as there were someone
typing them. Remember: &lt;b&gt;TIOCSTI&lt;/b&gt; ioctl() call is your
friend &lt;img src=&quot;misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;&lt;br&gt;
Just &lt;a href=&quot;http://www.google.com/search?q=ioctl+TIOCSTI&quot;
 target=&quot;_blank&quot;&gt;google it&lt;/a&gt; to see what
it&amp;nbsp;does. And now, some actually working code:&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;pre&gt;#!/usr/bin/perl -w&lt;br&gt;use strict;&lt;br&gt;use Fcntl;&lt;br&gt;use constant TIOCSTI =&amp;gt; 0x5412;&lt;br&gt;&lt;br&gt;unless (@ARGV &amp;gt;= 1) {&lt;br&gt; print &quot;usage: $0 [vt] &amp;lt;input&amp;gt;\n&quot;;&lt;br&gt; exit;&lt;br&gt;}&lt;br&gt;&lt;br&gt;my $vt = shift @ARGV;&lt;br&gt;my $buf = join &#039;&#039;, &amp;lt;&amp;gt;;&lt;br&gt;&amp;amp;writevt ($vt, $buf) || die &quot;can&#039;t write to $vt: $!\n&quot;;&lt;br&gt;exit;&lt;br&gt;&lt;br&gt;&lt;br&gt;sub writevt {&lt;br&gt; my ($vt, $buf) = @_;&lt;br&gt; sysopen (VT, $vt, O_RDONLY) || return 0;&lt;br&gt; for (my $i = 0; $i &amp;lt; length $buf; $i++) {&lt;br&gt; ioctl (VT, TIOCSTI, substr ($buf, $i, 1)) || return 0;&lt;br&gt; }&lt;br&gt; close (VT) || return 0;&lt;br&gt; return 1;&lt;br&gt;} &lt;br&gt;&lt;/pre&gt;
&lt;p&gt;
And this is how it works (Linux-specific!!!):
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;pre&gt;[stas@home stas]$ echo id | ./catvt.pl /dev/pts/0&lt;br&gt;id&lt;br&gt;[stas@home stas]$ id&lt;br&gt;uid=?????(stas) gid=?????(stas) groups=?????(stas)&lt;br&gt;&lt;/pre&gt;
&lt;p&gt;
Kinda awesome &lt;img src=&quot;misc/smileys/lol.png&quot; title=&quot;Laughing out loud&quot; alt=&quot;Laughing out loud&quot; /&gt;
&lt;/p&gt;
</description>
 <category domain="http://sysd.org/stas/taxonomy/term/14">console</category>
 <category domain="http://sysd.org/stas/taxonomy/term/18">hack</category>
 <category domain="http://sysd.org/stas/taxonomy/term/11">linux</category>
 <category domain="http://sysd.org/stas/taxonomy/term/10">opensource</category>
 <category domain="http://sysd.org/stas/taxonomy/term/20">perl</category>
 <pubDate>Wed, 15 Aug 2007 17:20:27 -0700</pubDate>
</item>
<item>
 <title>Formulário CEP/CPF/CNPJ</title>
 <link>http://sysd.org/stas/node/150</link>
 <description>&lt;p align=&quot;center&quot;&gt;
&lt;object classid=&quot;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&quot; codebase=&quot;http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0&quot; width=&quot;423&quot; height=&quot;200&quot; id=&quot;brloc&quot; align=&quot;middle&quot;&gt;
&lt;param name=&quot;allowScriptAccess&quot; value=&quot;sameDomain&quot; /&gt;
&lt;param name=&quot;movie&quot; value=&quot;/brloc/brloc.swf&quot; /&gt;&lt;param name=&quot;quality&quot; value=&quot;high&quot; /&gt;&lt;param name=&quot;bgcolor&quot; value=&quot;#ffffff&quot; /&gt;&lt;embed src=&quot;/brloc/brloc.swf&quot; quality=&quot;high&quot; bgcolor=&quot;#ffffff&quot; width=&quot;423&quot; height=&quot;200&quot; name=&quot;brloc&quot; align=&quot;middle&quot; allowScriptAccess=&quot;sameDomain&quot; type=&quot;application/x-shockwave-flash&quot; pluginspage=&quot;http://www.macromedia.com/go/getflashplayer&quot; /&gt;
&lt;/object&gt;
&lt;br&gt;
&lt;small&gt;&lt;i&gt;(tente preencher os campos acima; a informa&amp;ccedil;&amp;atilde;o &amp;eacute; atualizada instantaneamente)&lt;/i&gt;&lt;/small&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;br&gt;
Este projeto &amp;eacute; o sucessor do&amp;nbsp;&lt;a
 href=&quot;http://sysd.org/stas/node/99&quot;&gt;CEP-2-City&lt;/a&gt;.
&amp;Eacute; um formul&amp;aacute;rio &lt;i&gt;online&lt;/i&gt; que:&lt;br&gt;
&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Verifica a validade do n&amp;uacute;mero &lt;a
 href=&quot;http://pt.wikipedia.org/wiki/Cadastro_de_Pessoas_F%C3%ADsicas&quot;
 target=&quot;_blank&quot;&gt;CPF&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Verifica a validade do n&amp;uacute;mero &lt;a
 href=&quot;http://pt.wikipedia.org/wiki/CNPJ&quot; target=&quot;_blank&quot;&gt;CNPJ&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;A partir do &lt;a
 href=&quot;http://pt.wikipedia.org/wiki/Sistema_endere%C3%A7amento_postal_no_Brasil&quot;
 target=&quot;_blank&quot;&gt;CEP&lt;/a&gt;, deduz o endere&amp;ccedil;o
completo (Cidade/Estado/Bairro/Rua)&lt;/li&gt;
  &lt;li&gt;A partir do CEP, deduz o c&amp;oacute;digo &lt;a
 href=&quot;http://pt.wikipedia.org/wiki/Discagem_direta_a_dist%C3%A2ncia#Lista_de_c.C3.B3digos_DDD_brasileiros_por_estado_e_seus_principais_munic.C3.ADpios&quot;
 target=&quot;_blank&quot;&gt;DDD&lt;/a&gt; da regi&amp;atilde;o &lt;img src=&quot;misc/smileys/wink.png&quot; title=&quot;Eye-wink&quot; alt=&quot;Eye-wink&quot; /&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
O banco de dados utilizado &amp;eacute; compilado a partir de diversas
fontes. Se n&amp;atilde;o constar a informa&amp;ccedil;&amp;atilde;o da
rua, ent&amp;atilde;o somente a cidade &amp;eacute; retornada. A
interface com o banco de dados foi implementada usando &lt;a
 href=&quot;http://en.wikipedia.org/wiki/Perl&quot; target=&quot;_blank&quot;&gt;Perl&lt;/a&gt;
e &lt;a href=&quot;http://en.wikipedia.org/wiki/PHP&quot; target=&quot;_blank&quot;&gt;PHP&lt;/a&gt;,
e pode ser acessada via &lt;a
 href=&quot;http://en.wikipedia.org/wiki/Common_Gateway_Interface&quot;
 target=&quot;_blank&quot;&gt;CGI&lt;/a&gt;, &lt;a target=&quot;_blank&quot;
 href=&quot;http://en.wikipedia.org/wiki/Adobe_Flash&quot;&gt;Flash&lt;/a&gt;
ou &lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29&quot;
 target=&quot;_blank&quot;&gt;AJAX&lt;/a&gt;. O sistema de busca
&amp;eacute; extremamente eficiente, e n&amp;atilde;o necessita de &lt;a
 href=&quot;http://en.wikipedia.org/wiki/MySQL&quot; target=&quot;_blank&quot;&gt;MySQL&lt;/a&gt;.
O tamanho do banco de dados &amp;eacute; cerca de 60 MB, e a
performance chega a milhares de consultas por segundo.
&lt;/p&gt;
&lt;p&gt;Portanto, eis uma solu&amp;ccedil;&amp;atilde;o bastante
s&amp;iacute;mples, flex&amp;iacute;vel e eficaz para o
cadastro&amp;nbsp;de clientes. J&amp;aacute; utilizei este sistema numa
pesquisa que conduzi, e asseguro que me poupou bastante tempo. Para realizar as consultas, basta acessar a seguinte URL (com a devida substituição do CEP): &lt;a href=&quot;http://sysd.org/brloc/brloc.php?cep=05437000&quot; target=&quot;_blank&quot;&gt;http://sysd.org/brloc/brloc.php?cep=05437000&lt;/a&gt;, e processar a &lt;code&gt;string&lt;/code&gt; retornada com a função &lt;a href=&quot;http://br2.php.net/manual/pt_BR/function.parse-str.php&quot; target=&quot;_blank&quot;&gt;parse_str()&lt;/a&gt; (em PHP).
&lt;/p&gt;
&lt;p&gt;
Se tiver interesse no banco de dados em si, &lt;a href=&quot;http://sysd.org/stas/feedback&quot;&gt;entre
em contato&lt;/a&gt;!
&lt;/p&gt;
</description>
 <category domain="http://sysd.org/stas/taxonomy/term/25">actionscript</category>
 <category domain="http://sysd.org/stas/taxonomy/term/22">city</category>
 <category domain="http://sysd.org/stas/taxonomy/term/23">database</category>
 <category domain="http://sysd.org/stas/taxonomy/term/20">perl</category>
 <category domain="http://sysd.org/stas/taxonomy/term/24">php</category>
 <category domain="http://sysd.org/stas/taxonomy/term/8">web</category>
 <pubDate>Wed, 15 Aug 2007 16:31:52 -0700</pubDate>
</item>
<item>
 <title>X11 FrontEnd for the Rio Utility</title>
 <link>http://sysd.org/stas/node/107</link>
 <description>&lt;p&gt;&lt;img
 style=&quot;width: 640px; height: 480px;&quot; alt=&quot;XRio FrontEnd&quot;
 src=&quot;http://sysd.org/stas/files/active/0/xrio.jpg&quot;&gt;&lt;/p&gt;
&lt;p&gt;X11 FrontEnd
for the &lt;a href=&quot;http://www.world.co.uk/sba/rio.html&quot;&gt;Rio
Utility v1.07&lt;/a&gt; made by guys from the
&lt;a href=&quot;http://www.world.co.uk/sba/&quot; target=&quot;_blank&quot;&gt;Snowblind
Alliance&lt;/a&gt;.
Surely not the best nor the most beautiful of all GUIs made to manage
the famous Rio MP3 Player,
but I tried to implement some of the ideas that the &quot;real&quot; managers
doesn&#039;t implement.
List of some &quot;interesting&quot; features:
&lt;/p&gt;&lt;ul&gt;&lt;li&gt;2 windows side-by-side like in &lt;i&gt;Norton
Commander&lt;/i&gt; legacy managers&lt;/li&gt;
&lt;li&gt;treats M3U playlists as directories&lt;/li&gt;
&lt;li&gt;displays the&amp;nbsp;space remaining on the device as you
select files to upload&lt;/li&gt;
&lt;li&gt;current file &amp;amp; overall progress bars&lt;/li&gt;
&lt;li&gt;realtime display of the transfer speed&lt;/li&gt;
&lt;/ul&gt;Note that you need&amp;nbsp;Tk8.0 extension for Perl (and
the &lt;a href=&quot;http://www.perl.com/&quot;&gt;Perl&lt;/a&gt; itself)
to get this frontend running! The GUI works under&amp;nbsp;&lt;a
 href=&quot;http://activestate.com/Products/ActivePerl/&quot;&gt;ActivePerl&lt;/a&gt;
Win32 environment out-of-shelf, but I haven&#039;t tested if the interaction
with
the &lt;code&gt;rio.exe&lt;/code&gt; is OK. You can download it &lt;a
 href=&quot;http://sysd.org/stas/node/41&quot;&gt;here&lt;/a&gt; and test
for yourself! However, I would suggest you to use my &lt;a
 href=&quot;http://sysd.org/stas/node/41&quot;&gt;Diamond Rio PMP300
FS-plugin&lt;/a&gt; for &lt;a href=&quot;http://www.ghisler.com/&quot;&gt;Total
Commander&lt;/a&gt;.&lt;p&gt;
&lt;b&gt;P.S. -&lt;/b&gt; if you get problems downloading files with
long names,
apply the patch I provided below on the Rio Utility source (&lt;b&gt;not
XRio itself!&lt;/b&gt;) and recompile it.&lt;/p&gt;
</description>
 <category domain="http://sysd.org/stas/taxonomy/term/9">addon</category>
 <category domain="http://sysd.org/stas/taxonomy/term/13">GUI</category>
 <category domain="http://sysd.org/stas/taxonomy/term/5">hardware</category>
 <category domain="http://sysd.org/stas/taxonomy/term/11">linux</category>
 <category domain="http://sysd.org/stas/taxonomy/term/10">opensource</category>
 <category domain="http://sysd.org/stas/taxonomy/term/20">perl</category>
 <category domain="http://sysd.org/stas/taxonomy/term/4">software</category>
 <category domain="http://sysd.org/stas/taxonomy/term/12">windows</category>
 <pubDate>Mon, 08 Jan 2007 04:37:08 -0800</pubDate>
</item>
<item>
 <title>CEP-2-City</title>
 <link>http://sysd.org/stas/node/99</link>
 <description>&lt;p&gt;
Módulo &lt;a href=&quot;http://www.perl.com/&quot; target=&quot;_blank&quot;&gt;Perl&lt;/a&gt; que obtém o nome do
município (do Brasil) a partir de um CEP dado. Exemplo:
&lt;/p&gt;
&lt;pre&gt;#!/usr/bin/perl
use CEP;

# inicializa
my $cep = new CEP;

# $city será referência para array com estado/cidade
my $city = $cep-&amp;gt;city (&#039;12.437-660&#039;); # processa somente os dígitos numéricos (0-9)

if ($city) {
    # $str será uma string no formato Cidade/ESTADO
    my $str = CEP::city_string ($city);
    # filtra os acentos e imprime em caixa alta
    printf &quot;esse CEP pertence a [%s]\n&quot;, uc CEP::normalize ($str);
} else {
    print &quot;CEP não encontrado\n&quot;;
}

exit;
&lt;/pre&gt;

&lt;p&gt;
Conforme pode ser observado no exemplo dado acima, este é um módulo
orientado a objeto. A instância do objeto CEP é criada com &lt;code&gt;new
CEP&lt;/code&gt;. Durante&lt;span lang=&quot;pt&quot;&gt;&lt;/span&gt; a inicialização, é construído um
array com a lista ordenada das faixas de CEPs (isso pode demorar, portanto é
uma boa idéia criar uma única instância e reaproveitá-la indefinidamente). O
método que realiza a busca binária pelo CEP e retorna o nome do município é
&lt;code&gt;city()&lt;/code&gt;. O seu único parâmetro é o número CEP propriamente dito.
Somente os dígitos numéricos serão considerados. &lt;code&gt;city()&lt;/code&gt; retorna
uma referência para array que contém o nome do estado e o nome da cidade,
nessa ordem. Inclui também uma subrotina &lt;code&gt;city_string()&lt;/code&gt; que
recebe como parâmetro o array retornado pelo &lt;code&gt;city()&lt;/code&gt; e retorna
uma string no formato &lt;em&gt;&quot;Nome da cidade/ESTADO&quot;&lt;/em&gt;. E, finalmente, quando
os acentos são desnecessários, pode-se filtrá-los com a função
&lt;code&gt;normalize()&lt;/code&gt;, que recebe uma string com acentos e a retorna sem
acentos &lt;code&gt;&lt;img src=&quot;misc/smileys/tongue.png&quot; title=&quot;Sticking out tongue&quot; alt=&quot;Sticking out tongue&quot; /&gt;&lt;/code&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;P.S. -&lt;/b&gt; cuidado com os &lt;em&gt;line-endings&lt;/em&gt; do arquivo
CEP.pm! Se o segmento &lt;code&gt;__DATA__&lt;/code&gt; for salvo com CRLF, o módulo
apresentará comportamento estranho em sistemas UN*X!&lt;br&gt;
&lt;b&gt;P.P.S. -&lt;/b&gt; Este projeto tem agora um &lt;a href=&quot;http://sysd.org/stas/node/150&quot;&gt;sucessor&lt;/a&gt; (que consegue obter informação sobre Rua/Bairro e até mesmo DDD regional)! Confira!
&lt;/p&gt;
</description>
 <category domain="http://sysd.org/stas/taxonomy/term/22">city</category>
 <category domain="http://sysd.org/stas/taxonomy/term/23">database</category>
 <category domain="http://sysd.org/stas/taxonomy/term/10">opensource</category>
 <category domain="http://sysd.org/stas/taxonomy/term/20">perl</category>
 <category domain="http://sysd.org/stas/taxonomy/term/4">software</category>
 <pubDate>Wed, 03 Jan 2007 12:55:33 -0800</pubDate>
</item>
<item>
 <title>ACFTools (for X-Plane)</title>
 <link>http://sysd.org/stas/node/46</link>
 <description>&lt;br&gt;


&lt;div align=&quot;center&quot;&gt;&lt;a href=&quot;http://sysd.org/stas/files/active/0/shot.png&quot;&gt;&lt;img alt=&quot;ACFTools screenshot&quot; src=&quot;http://sysd.org/stas/files/active/0/shot_t.jpg&quot; border=&quot;0&quot; height=&quot;480&quot; width=&quot;640&quot;&gt;&lt;/a&gt;&lt;br&gt;
&lt;/div&gt;


&lt;br&gt;


The &lt;b&gt;Plane-Maker&lt;/b&gt; from &lt;a href=&quot;http://x-plane.com/&quot;&gt;X-Plane&lt;/a&gt;
v7.x is fun and easy to use... Although I found it a bit limited to
edit my planes&#039; fuselage. 20 cross-sections aren&#039;t enough, sometimes.
It would be nice to export the fuselage shape into any 3D-editor and
fine-tune it there... This is exactly what my ACFTools are supposed to
do. Please note that X-Plane v8.x is unsupported, unless you create &amp;amp; edit a v7
model and then import it to Plane-Maker v8. But I believe this isn&#039;t a
problem: X-Plane v8 is able to use OBJ format files (which can be
imported/exported by &lt;a href=&quot;http://scenery.x-plane.com/tools.php&quot;&gt;AC3D&lt;/a&gt; and &lt;a href=&quot;http://marginal.org.uk/x-planescenery/tools.html&quot;&gt;Blender&lt;/a&gt; plugins) as parts of an aircraft, thus, extremely weird shapes are perfectly possible without even touching the ACF file.&lt;br&gt;


Now, what exactly ACFTools does? It is able to process the file that
stores all the aircraft data (except the textures), in the binary ACF
format, and dump all the data in the human-readable TXT format. It is the
same format as for Tony Gondola&#039;s ACF2Text utility, which inspirited my
ACFTools. Then, ACFTools can extract the 3D model of the aircraft from
this data, and export it in the &lt;a href=&quot;http://www.ac3d.org&quot;&gt;AC3D&lt;/a&gt; format. After that you can edit the aircraft&#039;s shape as you want using AC3D and make the inverse process: from &lt;code&gt;.ac&lt;/code&gt; to &lt;code&gt;.txt&lt;/code&gt;, and then from &lt;code&gt;.txt&lt;/code&gt; to &lt;code&gt;.acf&lt;/code&gt;. Here comes the brief set of ACFTools features:&lt;br&gt;


&lt;ul&gt;


  &lt;li&gt;Convert from ACF (aircraft) &amp;amp; WPN (weapon) formats to TXT format and vice-versa.&lt;br&gt;
  &lt;/li&gt;
  &lt;li&gt;Extract AC3D model from TXT file, along with wings and propellers (using the real airfoils!).&lt;/li&gt;
  &lt;li&gt;Import AC3D model into TXT file (fuselage, nacelles, wheel fairings &amp;amp; external fuel tanks only)&lt;br&gt;
  &lt;/li&gt;
&lt;/ul&gt;


3D model extractor is also useful if you want to use X-Plane generated
aircrafts somewhere else; as in your own Computer Graphics compositions.&lt;br&gt;


ACFTools was written in &lt;a href=&quot;http://www.perl.org/get.html&quot;&gt;Perl&lt;/a&gt;,
thus it is able to work under Linux, MacOS &amp;amp; Windows. And it is
Open-Source &amp;amp; highly modular, so you can modify it as you want, or
use my functions for your own needs. When you start ACFTools, this is
what you get at your console:&lt;br&gt;


&lt;pre&gt;##############################################################################&lt;br&gt;[ACFTools v0.62a] Set of tools to play with ACF files outside of Plane-Maker&lt;br&gt;Perl script and modules coded by Stanislaw Pusep &lt;stas @sysd.org=&quot;&quot;&gt;&lt;br&gt;Site of this and another X-Plane projects of mine: http://xplane.sysd.org/&lt;br&gt;&lt;br&gt;Allows you to:&lt;br&gt; * export X-Plane (www.x-plane.com) aircraft data files to human-editable&lt;br&gt;   plaintext format and 3D mesh editable in AC3D modeler (www.ac3d.org).&lt;br&gt; * import plaintext/3D mesh back to ACF file.&lt;br&gt;##############################################################################&lt;br&gt;&lt;br&gt;Usage: acftools.exe &lt;commands&gt; [parameters]&lt;br&gt; o Commands:&lt;br&gt;	-extract [DEF]	: extract TXT from ACF (opt: using DEF definition)&lt;br&gt;        -generate       : generate ACF from TXT&lt;br&gt;        -merge          : merge body from AC3D file to TXT&lt;br&gt; o Parameters:&lt;br&gt;        -acffile FILE   : name of ACF file to process&lt;br&gt;        -txtfile FILE   : name of TXT file to process&lt;br&gt;        -ac3dfile FILE  : name of AC3D file to process&lt;br&gt;        -noorder        : DO NOT sort vertices while merging bodies&lt;br&gt;        -noac3d         : DO NOT generate AC3D&lt;br&gt;        -(min|max)body N: write all bodies in specified range to AC3D&lt;br&gt;        -force LIST     : force extraction of bodies LIST (comma-separated N)&lt;br&gt;        -normalize N    : normalize wings to N vert/surface (N&amp;gt;=2 or no wings!)&lt;br&gt; o Notes:&lt;br&gt;        * You can use abbreviations of commands/parameters (-gen or even -g&lt;br&gt;          instead of -generate).&lt;br&gt;        * The only required parameter for &quot;extract&quot; command is -acffile.&lt;br&gt;          Both -txtfile and -ac3dfile are derivated from it.&lt;br&gt;        * &quot;generate&quot; command and -txtfile has the same relation.&lt;br&gt;        * By default &quot;extract&quot; uses the latest DEF file.&lt;br&gt;        * &quot;generate&quot; doesn&#039;t need DEF at all (it is implicit in TXT)&lt;br&gt;        * If file to be created already exists backup is made automatically.&lt;br&gt; o Examples:&lt;br&gt;        acftools.exe --extract=ACF700 --acffile=&quot;F-22 Raptor.acf&quot;&lt;br&gt;        (extract &#039;F-22 Raptor.txt&#039; from &#039;F-22 Raptor.acf&#039;)&lt;br&gt;&lt;br&gt;        acftools.exe -e -acf &quot;F-22 Raptor.acf&quot;&lt;br&gt;        (same as above)&lt;br&gt;&lt;br&gt;        acftools.exe -me -ac3d ladar.ac -txt &quot;F-22 Raptor.txt&quot;&lt;br&gt;        (merge *single* 3D body from &#039;ladar.ac&#039; to &#039;F-22 Raptor.txt&#039;)&lt;br&gt;&lt;br&gt;        acftools.exe -g -txt &quot;F-22 Raptor.txt&quot;&lt;br&gt;        (reverse operation; generate &#039;F-22 Raptor.acf&#039; from &#039;F-22 Raptor.txt&#039;)&lt;br&gt;&lt;/commands&gt;&lt;/stas&gt;&lt;/pre&gt;


The most important thing you should know is that to convert from the
binary ACF format to TXT, ACFTools uses one of the files stored in the &lt;code&gt;defs&lt;/code&gt; directory. By default, it is a &lt;code&gt;ACF740.def&lt;/code&gt;,
which works for X-Plane v7.40 and later. You can specify any definition
file you want, as shown on the screen above. You can also write your
own definition files, if you have the structure specification. Note
that to convert TXT back to ACF, no definition is necessary, as the TXT
format itself holds all the data necessary to build the binary file.
The second thing is to specify the file that ACFTools should convert.
The name of the converted file and every of the intermediary files will
be generated from this name. When converting from ACF to AC3D formats,
TXT file is generated automatically. Please note that when you want to
put the edited aircraft part back into the &lt;code&gt;.acf&lt;/code&gt; file, you must save this part as a &lt;code&gt;.ac&lt;/code&gt;
separate file, then merge it into the TXT file, and after that convert
it into ACF! Yes, it would be nice to have a GUI to automate the entire
process, but I&#039;m too lazy to do that! Anyway, may the source be with you
&lt;img src=&quot;misc/smileys/wink.png&quot; title=&quot;Eye-wink&quot; alt=&quot;Eye-wink&quot; /&gt;&lt;br&gt;


I strongly recommend you to read the &lt;code&gt;docs\README.txt&lt;/code&gt; file contained in the ACFTools package before you start using it!&lt;br&gt;</description>
 <category domain="http://sysd.org/stas/taxonomy/term/9">addon</category>
 <category domain="http://sysd.org/stas/taxonomy/term/14">console</category>
 <category domain="http://sysd.org/stas/taxonomy/term/29">game</category>
 <category domain="http://sysd.org/stas/taxonomy/term/18">hack</category>
 <category domain="http://sysd.org/stas/taxonomy/term/11">linux</category>
 <category domain="http://sysd.org/stas/taxonomy/term/10">opensource</category>
 <category domain="http://sysd.org/stas/taxonomy/term/20">perl</category>
 <category domain="http://sysd.org/stas/taxonomy/term/28">simulation</category>
 <category domain="http://sysd.org/stas/taxonomy/term/4">software</category>
 <category domain="http://sysd.org/stas/taxonomy/term/12">windows</category>
 <pubDate>Tue, 09 May 2006 21:09:12 -0700</pubDate>
</item>
<item>
 <title>I.E. &#039;hidden image&#039; maker</title>
 <link>http://sysd.org/stas/node/38</link>
 <description>&lt;p&gt;
&lt;center&gt;&lt;img alt=&quot;sample masked image&quot;
 src=&quot;http://sysd.org/stas/files/active/0/masked.jpg&quot;
 height=&quot;228&quot; width=&quot;320&quot;&gt;&lt;br&gt;
&lt;/center&gt;
&lt;/p&gt;
If you are using Internet Explorer (any version able to load this page
&lt;img src=&quot;misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;, just select the above image (or go to &lt;i&gt;&quot;Edit =&amp;gt;
Select All&quot;&lt;/i&gt;, or press &lt;code&gt;Ctrl-A&lt;/code&gt;). You
may see a watermark with white letters forming a word &quot;TEST&quot;. This &lt;b&gt;only&lt;/b&gt;
happens in IE, due to the specific way it masks the selected images to
show their selected state. &lt;a
 href=&quot;http://www.mozilla.org/products/firefox/&quot;&gt;Firefox&lt;/a&gt;,
for example, simply tints the image with bluish color. There are lots
of jokes one can make using this simple principle. For example, all
images on your homepage may have some &quot;subliminal&quot; messages. Adobe
PhotoShop is perfectly suitable to make such &#039;Hidden Images&#039; by hand;
in fact, my inspiration was a tutorial made by Matt Kment to do this.
But if you
are too lazy and/or do not have PhotoShop installed (UN*X users, for
example), you can use this small program I wrote in Perl to automate
the
&quot;steganographic&quot; process. I wrote it using &lt;a
 href=&quot;http://www.imagemagick.net/&quot;&gt;ImageMagick&lt;/a&gt;&lt;small&gt;&lt;sup&gt;TM&lt;/sup&gt;&lt;/small&gt;
library (so it&#039;s required to successfully run the program). It is a
command line program, but it is simple enough to use,
and it has an advantage to be integrable into your own scripts/programs
(you can even setup your server to embed your company logo into all
graphics of your site, but this will overload the server&#039;s CPU and RAM
too quickly). I called my program &quot;Internet Explorer Mask&#039;O&#039;Matic&quot;.
Take a look at it&#039;s startup screen:&lt;br&gt;
&lt;pre&gt;Internet Explorer Mask&#039;O&#039;Matic v1.0 by Stas &lt;stanis
 @linuxmail.org=&quot;&quot;&gt;&lt;br&gt;Grab yours at http://sysdlabs.hypermart.net/ &lt;img src=&quot;misc/smileys/wink.png&quot; title=&quot;Eye-wink&quot; alt=&quot;Eye-wink&quot; /&gt;&lt;br&gt;&lt;br&gt;Inspirated by some mad stuff by Lem0nHead&lt;br&gt;Based on Photoshop &#039;Hidden Image&#039; Guide (http://www.atomicwienerdog.com/ot/)&lt;br&gt;made by Matt Kment &amp;amp; suggested to me by xfalmp&lt;br&gt;&lt;br&gt;&lt;br&gt;ERROR: please give us --visible&lt;br&gt;&lt;br&gt;&lt;br&gt; * Usage: MaskOMatic.pl &lt;options&gt;&lt;br&gt; * Options (note that you can use syntaxes like --vis= --hid -out -p):&lt;br&gt; --visible filename of image normally seen (required)&lt;br&gt; --hidden filename of image seen when selected in IE (required)&lt;br&gt; --output filename to write out, format is selected automatically&lt;br&gt; using suffix provided (required)&lt;br&gt; --percentage float value between 0 &amp;amp; 100; how much of hidden appears&lt;br&gt; (optional, defaults to 50%)&lt;br&gt; --quality JPEG/MIFF/PNG compression level (optional, DON&#039;T USE!)&lt;br&gt; --contrast flag, internal contrast reduction (optional)&lt;br&gt; --test filename to dump preview of selected image (optional)&lt;br&gt;&lt;br&gt; * Notes:&lt;br&gt; # Visible &amp;amp; hidden images doesn&#039;t need to have same size, when size&lt;br&gt; doesn&#039;t matches then hidden image is rescaled using Lanczos filter&lt;br&gt; # A huge set of image formats is supported (JPG, GIF, PNG for example)&lt;br&gt; but I strongly advice you to write output in loseless format *only*&lt;br&gt; (BMP, PNG, TGA) and *then* fine-tune contrast/brightness &amp;amp; save&lt;br&gt; compressed in your favourite image editor (like GIMP)&lt;br&gt;&lt;br&gt; * Example:&lt;br&gt; MaskOMatic.pl --vis bush.jpg --hid death.jpg --out sublim.bmp&lt;br&gt;&lt;/options&gt;&lt;/stanis&gt;&lt;/pre&gt;
Only 3 options are obligatory: &lt;code&gt;--visible&lt;/code&gt;, &lt;code&gt;--hidden&lt;/code&gt;
&amp;amp; &lt;code&gt;--output&lt;/code&gt;. You can abbreviate them
as &lt;code&gt;-v&lt;/code&gt;, &lt;code&gt;-h&lt;/code&gt; &amp;amp;
&lt;code&gt;-o&lt;/code&gt;,
respectively. &quot;Visible&quot; is an image that user sees by default.
&quot;Hidden&quot; is what user sees when he/she selects the image. And &quot;output&quot;
is the resulting image you can embed into your pages. It is also
possible to use the &lt;code&gt;&quot;--test&quot;&lt;/code&gt;
option to preview the selected state of the output image without
starting Internet Explorer. If it looks bad, you may play around with &lt;code&gt;&quot;--percentage&quot;&lt;/code&gt;
option, which specifies the &#039;weight&#039; of the hidden image. The higher
is this value, the greater is the hidden image visibility. If that&#039;s
not
enough to hide your image well (some things are pretty difficult to
hide!), you can try to tune the output image with &lt;code&gt;&quot;--contrast&quot;&lt;/code&gt;
option, but I suggest you to use some GUI program to do that as you get
the visual feedback instantly. I also suggest you to always save your
output in the non-compressed lossless format (like BMP, TGA, TIFF), and
then
fine-tune the compression in some program specialized in it (&lt;a
 href=&quot;http://www.gimp.org/&quot;&gt;GIMP&lt;/a&gt; has a nice
compressor with visual feedback).
&lt;p&gt;
&lt;h3&gt;Alternatives:&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a
 href=&quot;http://www.n-sane.net/effects/hidden-image/index.php&quot; target=&quot;_blank&quot;&gt;Hidden
Image&lt;/a&gt; Photoshop tutorial&lt;/li&gt;
  &lt;li&gt;&lt;a
 href=&quot;http://www.codeproject.com/cs/media/magicimage.asp&quot; target=&quot;_blank&quot;&gt;Magic
Image Generator&lt;/a&gt; C#/VS.NET2003 program (with source) &lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
</description>
 <category domain="http://sysd.org/stas/taxonomy/term/14">console</category>
 <category domain="http://sysd.org/stas/taxonomy/term/6">graphics</category>
 <category domain="http://sysd.org/stas/taxonomy/term/18">hack</category>
 <category domain="http://sysd.org/stas/taxonomy/term/10">opensource</category>
 <category domain="http://sysd.org/stas/taxonomy/term/20">perl</category>
 <category domain="http://sysd.org/stas/taxonomy/term/4">software</category>
 <category domain="http://sysd.org/stas/taxonomy/term/8">web</category>
 <pubDate>Fri, 05 May 2006 13:47:18 -0700</pubDate>
</item>
<item>
 <title>GibCounter QW stats</title>
 <link>http://sysd.org/stas/node/21</link>
 <description>GibCounter is a tiny yet quite useful game statistics generator for QuakeWorld games.
It operates parsing &lt;code&gt;frag*.log&lt;/code&gt; files generated by the QuakeWorld game server. If your server doesn&#039;t generate such a log files by default, you may enable this feature executing the server as follows:&lt;br&gt;
&lt;pre&gt;qw-server +set fraglogfile 1&lt;/pre&gt;
Of course you can also edit your server&#039;s &lt;code&gt;.cfg&lt;/code&gt; files to enable frag logging. You may run GibCounter on the same machine (and, on UN*X systems, as the same user) that runs the game server. If it&#039;s a &lt;a href=&quot;http://www.quakeforge.net/&quot;&gt;QuakeForge&lt;/a&gt; server, then GibCounter will locate log files automatically at the path &lt;code&gt;$HOME/.quakeforge/qw&lt;/code&gt;. For the different ports of the QuakeWorld server, or a QuakeForge server operating as a different user, you may specify the location of the &lt;code&gt;qw&lt;/code&gt; directory manually. To do that, simply pass the new directory as an argument to GibCounter (using your favorite command line shell):&lt;br&gt;
&lt;pre&gt;perl gibcounter.pl /home/qserver/.quake/qw&lt;/pre&gt;
GibCounter outputs the generated HTML code directly to &lt;code&gt;STDOUT&lt;/code&gt;. So, if you&#039;re going to add it into your server&#039;s &lt;i&gt;crontab&lt;/i&gt;, don&#039;t forget to pipe the output to some file! For example, the following &lt;span style=&quot;font-style: italic;&quot;&gt;crontab&lt;/span&gt; line will regenerate GibCounter game stats every 30 min and make it available through the URL &lt;u&gt;http://yourserver.com/~youruser/gibcounter.html&lt;/u&gt; (file paths &amp;amp; &lt;i&gt;crontab&lt;/i&gt; format may be different on your system; so ask your system administrator if unsure):&lt;br&gt;
&lt;pre&gt;0,30 * * * * perl $HOME/gibcounter.pl &amp;gt; $HOME/www/gibcounter.html&lt;/pre&gt;
GibCounter is also highly theme-able: CSS style of almost every element may be changed within &lt;code&gt;gibcounter.css&lt;/code&gt; file. Of course, you can also edit the HTML template which is contained inside the Perl source itself &lt;img src=&quot;misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;&lt;br&gt;
The game statistics page generated by GibCounter is self-explanatory. On the top, it will show players ranking, sorted by (guess what?!) the frags they scored. Frags are computed as: kills &lt;i&gt;minus&lt;/i&gt; suicides. GibCounter also computes how many times each player was killed by others. And, on the bottom of the generated page, some computed totals are shown. This includes the period of time for which the stats were made, the &lt;i&gt;top fragger&lt;/i&gt; (the best) &amp;amp; the &lt;i&gt;top fragged&lt;/i&gt; (the worst) players. Please note that players with default nicknames, such as &quot;unnamed&quot; or &quot;user-#&quot;, are automatically excluded from being processed, simply to avoid useless information bloat (as many different players would be rated as one, with very high kill/death number)!&lt;br&gt;
By the way, GibCounter preserves the colorization of the graphical font in players&#039; nicknames (Quake console is able to print some ASCII characters in white, orange, gold &amp;amp; brown colors), and translates all symbols into readable ASCII.&lt;br&gt;
So, after all, how does GibCounter-generated page looks like?! Look for yourself, here are some &lt;a href=&quot;http://sysd.org/docs/gibcounter.html&quot;&gt;example stats&lt;/a&gt;. Also, feel free to modify the program itself to fit your own needs!&lt;br&gt;
</description>
 <category domain="http://sysd.org/stas/taxonomy/term/23">database</category>
 <category domain="http://sysd.org/stas/taxonomy/term/29">game</category>
 <category domain="http://sysd.org/stas/taxonomy/term/7">network</category>
 <category domain="http://sysd.org/stas/taxonomy/term/10">opensource</category>
 <category domain="http://sysd.org/stas/taxonomy/term/20">perl</category>
 <category domain="http://sysd.org/stas/taxonomy/term/4">software</category>
 <category domain="http://sysd.org/stas/taxonomy/term/8">web</category>
 <pubDate>Wed, 19 Apr 2006 21:48:22 -0700</pubDate>
</item>
<item>
 <title>ptBR nums2words()</title>
 <link>http://sysd.org/stas/node/20</link>
 <description>Uma função que programei para retornar &lt;i&gt;strings&lt;/i&gt; com números escritos por extenso. Por exemplo: &lt;code&gt;nums2words(2006)&lt;/code&gt; retorna &quot;dois mil e seis&quot;.&lt;br&gt;
Não que não exista mais nenhum algoritmo para isso; acontece que quis criar o meu próprio de tal forma que ele seja de fácil implementação em &lt;b&gt;C&lt;/b&gt;, e que seja portável para outras linguagens, no sentido mais extenso (tanto linguagens computacionais, como Perl, Java, PHP; como linguagens humanas, como inglês, espanhol, russo).&lt;br&gt;
Funciona da seguinte maneira: os números são &quot;decompostos&quot; em sub-unidades  maiores possíveis às quais nós, humanos, damos nomes. No exemplo do 2006, há 2 unidades: &quot;dois mil&quot; e &quot;seis&quot;. Essa operação é feita através do velho e bom resto da divisão, sem ter que converter o número em &lt;i&gt;string&lt;/i&gt; e processá-la dígito por dígito.&lt;br&gt;
Na realidade, comecei programando-o em Perl, depois traduzi para &lt;b&gt;C&lt;/b&gt;, refinei, otimizei, aí traduzi de volta para o Perl &lt;img src=&quot;misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;&lt;br&gt;
Não sei se está gramaticalmente correto; porém está perfeitamente compreensível. Acredito que o mesmo algoritmo poderá ser reaproveitado para inglês e russo. Porém isso fica a cargo do leitor!&lt;br&gt;
</description>
 <category domain="http://sysd.org/stas/taxonomy/term/14">console</category>
 <category domain="http://sysd.org/stas/taxonomy/term/10">opensource</category>
 <category domain="http://sysd.org/stas/taxonomy/term/20">perl</category>
 <category domain="http://sysd.org/stas/taxonomy/term/4">software</category>
 <pubDate>Wed, 19 Apr 2006 21:37:14 -0700</pubDate>
</item>
</channel>
</rss>
