<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>RawDev.net &#187; Scripting</title>
	<atom:link href="http://rawdev.net/category/hacking/scripting/feed/" rel="self" type="application/rss+xml" />
	<link>http://rawdev.net</link>
	<description>Just another Zabreznik.si Sites site</description>
	<lastBuildDate>Tue, 27 Jul 2010 17:48:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>FxGrounded 1.3.4</title>
		<link>http://rawdev.net/2009/03/01/fxgrounded-1v3/</link>
		<comments>http://rawdev.net/2009/03/01/fxgrounded-1v3/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 09:48:47 +0000</pubDate>
		<dc:creator>Marko Zabreznik</dc:creator>
				<category><![CDATA[Comic]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://www.rawdev.net/?p=167</guid>
		<description><![CDATA[Image via CrunchBase The Iframe implementation of a navigation failed to work out as planned so a complete rethink of this plugin was in order. What it does now is let you go wherever you want, BUT if you go away from the homepage you will get a 5 min limit for inactivity as opposed [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img">
<div>
<dl>
<dt><a href="http://www.crunchbase.com/product/firefox"><img src="http://www.crunchbase.com/assets/images/resized/0001/3109/13109v1-max-450x450.png" alt="Image representing Firefox as depicted in Crun..." /></a></dt>
<dd>Image via <a href="http://www.crunchbase.com">CrunchBase</a></dd>
</dl>
</div>
</div>
<div class="textarea">
<div><span>The </span><span class="googie_link">Iframe</span><span> implementation of a navigation failed to work out as planned so a complete rethink of this </span><span class="googie_link">plugin</span><span> was in order.</p>
<p>What it does now is let you go</p>
<p><span class="googie_link">wherever</span><span> you want, BUT if you go away from the homepage you will get a 5 min limit for inactivity as </span><span class="googie_link">opposed</span><span> to 30 min on the homepage. Going completely outside the scope of the homepage will get you only 3 min.</span></p>
<p>So this turned out to be a remake of the Auto Restart</p>
<p><span class="googie_link"><a class="zem_slink" title="Mozilla Firefox" rel="geolocation" href="http://maps.google.com/maps?ll=45.1238,-123.1138&amp;spn=1.0,1.0&amp;q=45.1238,-123.1138 (Mozilla%20Firefox)&amp;t=h">Firefox</a></span> <span class="googie_link">plugin</span><span> I saw long ago but was totally outdated.</span></p>
<p>But you get a nifty, <a class="zem_slink" title="Touchscreen" rel="wikipedia" href="http://en.wikipedia.org/wiki/Touchscreen">touchscreen</a></p>
<p><span class="googie_link">friendly</span><span> navigation. Works best with <a class="zem_slink" title="R-Kioski" rel="homepage" href="http://www.r-kioski.fi/">R-Kiosk</a> and FxKeyboard <img src='http://rawdev.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </span></p>
<p></span></div>
<div><span>Also, a note:</span></div>
<div>firefox in standards mode:  body is document.documentElement</div>
<div>firefox in quircks mode : body is document.body</div>
<div>&#8230; doh</div>
<div></div>
<div><span>Edit 2009/6/7 :   This project is currently not public. If you would like a copy please email me (find email in footer). </span></div>
</div>
<h6 class="zemanta-related-title">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://www.rawdev.net/2009/02/24/fxkeyboard-a-firefox-keyboard/">FxKeyboard: A Firefox keyboard for touchscreens</a> (rawdev.net)</li>
</ul>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=7bbab76c-592e-4759-ba02-e1d5dc2ee32f" alt="" /><span class="zem-script more-related pretty-attribution"></span></div>
]]></content:encoded>
			<wfw:commentRss>http://rawdev.net/2009/03/01/fxgrounded-1v3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Touchscreen Kiosk with Firefox vkeyboard Addon</title>
		<link>http://rawdev.net/2009/01/18/touchscreen-kiosk/</link>
		<comments>http://rawdev.net/2009/01/18/touchscreen-kiosk/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 09:15:30 +0000</pubDate>
		<dc:creator>Marko Zabreznik</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Win32]]></category>
		<category><![CDATA[Plug-in]]></category>

		<guid isPermaLink="false">http://www.rawdev.net/?p=145</guid>
		<description><![CDATA[Image via CrunchBase Creating a kiosk environment. The tools: Touchscreen Monitor The requierments: Firefox 3 Linux Non-exit-able Onscreen Keyboard As you might expect, I tried everything. R-Kiosk. Perfect. A inline javascript Keyboard. While it did what was needed, it fails on forms that are on the bottom of the screen and in Iframes. Good side: [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img">
<div>
<dl>
<dt><a href="http://www.crunchbase.com/product/firefox"><img src="http://www.crunchbase.com/assets/images/resized/0001/3109/13109v1-max-450x450.png" alt="Image representing Firefox as depicted in Crun..." /></a></dt>
<dd>Image via <a href="http://www.crunchbase.com">CrunchBase</a></dd>
</dl>
</div>
</div>
<p>Creating a kiosk environment.<br />
The tools:</p>
<ul>
<li>Touchscreen Monitor</li>
</ul>
<p>The requierments:</p>
<ul>
<li>Firefox 3</li>
<li>Linux</li>
<li>Non-exit-able</li>
<li>Onscreen Keyboard</li>
</ul>
<p>As you might expect, I tried everything.</p>
<p><a href="https://addons.mozilla.org/firefox/addon/1659">R-Kiosk</a>. Perfect.</p>
<p>A <a href="http://www.rawdev.net/2008/12/04/joomla-joomkey-virtual-keyboard/">inline javascript Keyboard</a>. While it did what was needed, it fails on forms that are on the bottom of the screen and in Iframes. Good side: Language was dependant on the page&#8217;s language. But Fail.</p>
<p><a href="http://homepage3.nifty.com/tsato/xvkbd/">xvkbd</a>. While I did manage to place it on top of Firefox and lock it so people cant close or edit it, and change their language.. it was annoying to do so. Moving it around the screen more so. Porting it to win32 impossible. Fail.</p>
<p>Ok, lets try a different aproach.<br />
http://stlouis-shopper.com/~jtjsoftware/software/vkeyboard.xpi is a firefox Addon I found. A simple tweak made it work on Fx3. <a href="http://www.rawdev.net/wp-content/uploads/2009/01/vkeyboard.xpi">Here</a> is what I made. The first step in porting the app, is thus in bad shape. ~Win.</p>
<p>If there is enough interest in such a plugin for Fx3, I myself and the original author will continue to work on it. A lot of things are already on my mind that I want to do with this project. Suggestions ?</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=12058531-35af-4fe3-b4c4-c676e0f90d9c" alt="" /></div>
]]></content:encoded>
			<wfw:commentRss>http://rawdev.net/2009/01/18/touchscreen-kiosk/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Joomla! JoomKey Virtual Keyboard</title>
		<link>http://rawdev.net/2008/12/04/joomla-joomkey-virtual-keyboard/</link>
		<comments>http://rawdev.net/2008/12/04/joomla-joomkey-virtual-keyboard/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 21:12:15 +0000</pubDate>
		<dc:creator>Marko Zabreznik</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[JoomKey]]></category>
		<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://www.rawdev.net/?p=109</guid>
		<description><![CDATA[JoomKey is a joomla native mootools js virtual keyboard. It can be used on html inputs and textareas. The language is based on the language of the currently viewed site/article. It comes with English, German and Slovenian keyboard but can be easily be fitted with any additional language. If you do create a language please [...]]]></description>
			<content:encoded><![CDATA[<p>JoomKey is a joomla native mootools js virtual keyboard. It can be used on html inputs and textareas.</p>
<p>The language is based on the language of the currently viewed site/article. It comes with English, German and Slovenian keyboard but can be easily be fitted with any additional language. If you do create a language please send it to me so i can add it.</p>
<p>Download <a href="http://www.rawdev.net/wp-content/uploads/2008/12/mod_joomkey.zip">Module JoomKey 0.1.0</a></p>
<p>Tested on Firefox 3. Made in scope of the Institut-Oko Kiosk project.</p>
<p><a href="http://www.gnu.org/licenses/gpl-3.0.txt"><img class="alignnone" src="http://gplv3.fsf.org/gplv3-88x31.png" alt="GPLv3" width="88" height="31" /></a><br />
(C) Marko Zabreznik</p>
]]></content:encoded>
			<wfw:commentRss>http://rawdev.net/2008/12/04/joomla-joomkey-virtual-keyboard/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Away3D 2.0</title>
		<link>http://rawdev.net/2008/04/19/away3d-20/</link>
		<comments>http://rawdev.net/2008/04/19/away3d-20/#comments</comments>
		<pubDate>Sat, 19 Apr 2008 16:37:27 +0000</pubDate>
		<dc:creator>Marko Zabreznik</dc:creator>
				<category><![CDATA[Art]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.rawdev.net/?p=28</guid>
		<description><![CDATA[Image via Wikipedia The Away3d team are pleased to announce the release of the 2.0.0 update to the Away3d engine! You can download the update from the trunk in the svn repository: http://away3d.googlecode.com/svn/trunk or go to the downloads section of away3d.com where a new zip file is available: http://www.away3d.com/downloads Highlights of the update (posted on [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em;float: right"><a href="http://en.wikipedia.org/wiki/Image:Adobe_Flash_cs3.png" target="_blank"><img style="border: medium none" src="http://upload.wikimedia.org/wikipedia/en/3/3a/Adobe_Flash_cs3.png" alt="Adobe Flash" /></a>Image via <a href="http://en.wikipedia.org/wiki/Image:Adobe_Flash_cs3.png" target="_blank">Wikipedia</a></p>
</div>
<p>The Away3d team are pleased to announce the release of the 2.0.0 update to the Away3d engine!</p>
<p>You can download the update from the trunk in the svn repository:<br />
<a href="http://http//away3d.googlecode.com/svn/trunk">http://away3d.googlecode.com/svn/trunk</a></p>
<p>or go to the downloads section of away3d.com where a new zip file is available:<br />
<a href="mctmp(0);">http://www.away3d.com/downloads</a></p>
<p>Highlights of the update (posted on the site together with a new demo):</p>
<ul>
<li> Simulated phong shading (with blinn-phong specular highlights)</li>
<li> Environment-mapped materials</li>
<li> Normal-mapped materials (an open source first for <a class="zem_slink" title="Adobe Flash" rel="homepage" href="http://www.adobe.com/products/flash/flashpro/" target="_blank">Flash</a>)</li>
<li> Z-depth filter for large outdoor scenes</li>
<li> Fog filter</li>
<li> Straight-to-bitmap rendering for fast scaled views</li>
<li> Surface caching for fast rendered lights</li>
<li> Package refactor for easier learning of basic classes</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://rawdev.net/2008/04/19/away3d-20/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mjpg stream + potrace</title>
		<link>http://rawdev.net/2008/04/11/mjpg-stream-potrace/</link>
		<comments>http://rawdev.net/2008/04/11/mjpg-stream-potrace/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 15:34:34 +0000</pubDate>
		<dc:creator>Marko Zabreznik</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[uvc]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://www.rawdev.net/?p=24</guid>
		<description><![CDATA[Working on the same principle as the last mjpg_stream implemenation, here it is: a portace plugin ! /****************************************************************************** Description.: Send a complete HTTP response and a svg file Input Value.: fildescriptor fd to send the answer to Return Value: - ******************************************************************************/ void send_svg(int fd) { unsigned char *frame=NULL; int frame_size=0; char buffer[BUFFER_SIZE] = {0}; if [...]]]></description>
			<content:encoded><![CDATA[<p>Working on the same principle as the last mjpg_stream implemenation, here it is: a portace plugin !</p>
<p><a href="http://rawdev.nullstate.com/wp-content/uploads/2008/04/jpg.jpg"><img class="alignnone size-thumbnail wp-image-25" src="http://rawdev.nullstate.com/wp-content/uploads/2008/04/jpg.jpg" alt="" width="222" height="166" /></a><a href="http://rawdev.nullstate.com/wp-content/uploads/2008/04/svg.jpg"><img class="alignnone size-thumbnail wp-image-26" src="http://rawdev.nullstate.com/wp-content/uploads/2008/04/svg.jpg" alt="" width="222" height="166" /></a></p>
<p><span id="more-22"></span></p>
<pre>/******************************************************************************
Description.: Send a complete HTTP response and a svg file
Input Value.: fildescriptor fd to send the answer to
Return Value: -
******************************************************************************/
void send_svg(int fd) {
unsigned char *frame=NULL;
int frame_size=0;
char buffer[BUFFER_SIZE] = {0};

if ( (frame = (unsigned char *)malloc(MAX_FRAME_SIZE)) == NULL ) {
fprintf(stderr, "not enough memory\n");
exit(EXIT_FAILURE);
}

/* wait for a fresh frame */
pthread_cond_wait(&amp;pglobal-&gt;db_update, &amp;pglobal-&gt;db);

/* read buffer */
frame_size = pglobal-&gt;size;
memcpy(frame, pglobal-&gt;buf, frame_size);
DBG("got frame (size: %d kB)\n", frame_size/1024);

pthread_mutex_unlock( &amp;pglobal-&gt;db );

/* make file */
FILE *filesvg;
filesvg = fopen("/dev/shm/svgpipe", "w");
fwrite(frame, 1, frame_size, filesvg);

fclose(filesvg);
free(frame);

system("/usr/bin/convert /dev/shm/svgpipe /dev/shm/svgpipe.ppm");
system("/usr/bin/potrace -s /dev/shm/svgpipe.ppm");

/* response */
sprintf(buffer, "HTTP/1.0 200 OK\r\n" \
STD_HEADER \
"Content-type: image/svg+xml\r\n" \
"\r\n");
if( write(fd, buffer, strlen(buffer)) &lt; 0 ) return;
/* read -&gt; send file */

FILE *filesvg2;
filesvg2 = fopen("/dev/shm/svgpipe.svg", "r");
while (fgets(buffer,BUFFER_SIZE,filesvg2))
write(fd, buffer, strlen(buffer));
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://rawdev.net/2008/04/11/mjpg-stream-potrace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Biorhythm Calculator</title>
		<link>http://rawdev.net/2008/04/06/biorhythm-calculator/</link>
		<comments>http://rawdev.net/2008/04/06/biorhythm-calculator/#comments</comments>
		<pubDate>Sun, 06 Apr 2008 12:54:48 +0000</pubDate>
		<dc:creator>Marko Zabreznik</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[biorhythm]]></category>
		<category><![CDATA[calculator]]></category>

		<guid isPermaLink="false">http://www.rawdev.net/?p=23</guid>
		<description><![CDATA[A advanced Biorhythm calculator i made for a school project some time ago. Works perfectly. But its really how you interpret it ( All a bunch of crap if you ask me XD ) Link here.]]></description>
			<content:encoded><![CDATA[<p>A advanced Biorhythm calculator i made for a school project some time ago. Works perfectly. But its really how you interpret it <img src='http://rawdev.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  ( All a bunch of crap if you ask me XD )</p>
<p><a href="http://misc.rawdev.net/scripts/biorithmcalc.php"><img src="http://misc.rawdev.net/scripts/biorithmcalc.php?g=img" alt="" /></a></p>
<p>Link <a href="http://misc.rawdev.net/scripts/biorithmcalc.php">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://rawdev.net/2008/04/06/biorhythm-calculator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RawGallery, a compact gallery script</title>
		<link>http://rawdev.net/2008/04/04/rawgallery/</link>
		<comments>http://rawdev.net/2008/04/04/rawgallery/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 19:17:43 +0000</pubDate>
		<dc:creator>Marko Zabreznik</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.rawdev.net/?p=22</guid>
		<description><![CDATA[Recently i decided to opensource one of my scripts i have been using in the past. Features: No Mysql needed, Admin page included but limited to one user/password;Adding, deleting files; adding folders, Lightbox, Automagic thumbnailing, You can also turn off administration and use FTP to upload images, once pages with new images are accessed, thumbnails [...]]]></description>
			<content:encoded><![CDATA[<p>Recently i decided to opensource one of my scripts i have been using in the past.</p>
<p>Features:</p>
<ul>
<li>No Mysql needed,</li>
<li>Admin page included but limited to one user/password;Adding, deleting files; adding folders,</li>
<li>Lightbox,</li>
<li>Automagic thumbnailing,</li>
<li>You can also turn off administration and use FTP to upload images, once pages with new images are accessed, thumbnails will be created.</li>
</ul>
<p><span id="more-18"></span></p>
<p>Requirements:</p>
<ul>
<li>safemode off</li>
<li>apache server with php &gt; 4*</li>
<li> a little knowledge editing scripts</li>
</ul>
<p>Setup:</p>
<ol>
<li>edit to suit needs</li>
<li>upload</li>
<li>make folder with images</li>
</ol>
<pre>/*    RawGallery 1.0 GNU/GPL - RawDev.net
//        Derived from phAlbum (c) phphq.Net
//===========================================================
Customised 09 Aug 07 Marko Zabreznik hekos (a) rawdev.net
- Added PHP Sessions
- Thumbnails in subfolder
- Implemented relative resizeing for thumbnails
- Login now linked instead of login box on every page
- Logout implemented
- Embeded images, favicon and css into script
- Made image display name a link
- Rebuilt navigation
- XHTML validated
- Rearanged Settings
- Fixed bugs
- Made PHP 5.2.2 strict compatible
//===========================================================

This script is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License
for more details. http://www.gnu.org/licenses/gpl.txt

Folder Images were taken from KDE

//=========================================================*/</pre>
<p>Download: <a href="http://misc.rawdev.net/scripts/gallery.php.tar.gz">link</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://rawdev.net/2008/04/04/rawgallery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mjpg-Stream + libcaca</title>
		<link>http://rawdev.net/2008/03/22/mjpg-stream-libcaca/</link>
		<comments>http://rawdev.net/2008/03/22/mjpg-stream-libcaca/#comments</comments>
		<pubDate>Sat, 22 Mar 2008 16:18:39 +0000</pubDate>
		<dc:creator>Marko Zabreznik</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[uvc]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://www.rawdev.net/2008/03/22/mjpg-stream-libcaca/</guid>
		<description><![CDATA[After couple of hours, here is it: A libcaca extension to Mjpg-Stream[singlepic=141,300,200,,][singlepic=140,300,200,,] You need img2txt from the libcaca-utilities and /dev/shm to be mounted and writable (or change to another location) /dev/shm is present on most systems and is a mounted filesystem located on the main ram. The source is in past the page brake. First, [...]]]></description>
			<content:encoded><![CDATA[<p>After couple of hours, here is it: A libcaca extension to Mjpg-Stream[singlepic=141,300,200,,][singlepic=140,300,200,,]</p>
<p>You need img2txt from the libcaca-utilities and /dev/shm to be mounted and writable (or change to another location)</p>
<p>/dev/shm is present on most systems and is a mounted filesystem located on the main ram.</p>
<p>The source is in past the page brake.</p>
<p><span id="more-15"></span><br />
First, a header to change: /src/httpd.h: 114</p>
<pre>typedef enum { A_UNKNOWN, A_SNAPSHOT, A_ASCII, A_STREAM, A_COMMAND, A_FILE } answer_t;</pre>
<p>Next, a hook: /src/httpd.c:  720</p>
<pre>case A_ASCII:
DBG("Request for ascii\n");
send_ascii(lcfd.fd);
break;</pre>
<p>And now, the main function:</p>
<pre>/******************************************************************************
Description.: Send a complete HTTP response and a ascii html
Input Value.: fildescriptor fd to send the answer to
Return Value: -
******************************************************************************/
void send_ascii(int fd) {
unsigned char *frame=NULL;
int frame_size=0,i;
char buffer[BUFFER_SIZE] = {0};  if ( (frame = (unsigned char *)malloc(MAX_FRAME_SIZE)) == NULL ) {
fprintf(stderr, "not enough memory\n");
exit(EXIT_FAILURE);
}

/* wait for a fresh frame */

pthread_cond_wait(&amp;pglobal-&gt;db_update, &amp;pglobal-&gt;db);

/* read buffer */  frame_size = pglobal-&gt;size;
memcpy(frame, pglobal-&gt;buf, frame_size);
DBG("got frame (size: %d kB)\n", frame_size/1024);

pthread_mutex_unlock( &amp;pglobal-&gt;db );  /* make file */  FILE *fileascii;
fileascii = fopen("/dev/shm/asciipipe", "w");
fwrite(frame, 1, frame_size, fileascii);

fclose(fileascii);
free(frame);

system("/usr/bin/img2txt -W 100 -f html /dev/shm/asciipipe &gt; /dev/shm/asciipipe2");

/* response */
sprintf(buffer, "HTTP/1.0 200 OK\r\n" \
STD_HEADER \
"Content-type: text/html\r\n" \
"\r\n");
if( write(fd, buffer, strlen(buffer)) &lt; 0 ) return;
/* read -&gt; send file */

FILE *fileascii2;
fileascii2 = fopen("/dev/shm/asciipipe2", "r");
while (fgets(buffer,BUFFER_SIZE,fileascii2))
write(fd, buffer, strlen(buffer));
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://rawdev.net/2008/03/22/mjpg-stream-libcaca/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Size of XKCD</title>
		<link>http://rawdev.net/2008/03/15/size-of-xkcd/</link>
		<comments>http://rawdev.net/2008/03/15/size-of-xkcd/#comments</comments>
		<pubDate>Sat, 15 Mar 2008 21:04:40 +0000</pubDate>
		<dc:creator>Marko Zabreznik</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[xkcd]]></category>

		<guid isPermaLink="false">http://www.rawdev.net/2008/03/15/size-of-xkcd/</guid>
		<description><![CDATA[As the last post was about the size of bash.org, this one is about xkcd, the famous comic site, a simple set of scripts and you get the whole set and a few stats: Use script wisely, it&#8217;s a strain on servers. #!/bin/bash echo "Downloading 395 pages." for i in `seq 1 395`; do if [...]]]></description>
			<content:encoded><![CDATA[<p>As the last post was about the size of bash.org, this one is about xkcd, the famous comic site, a simple set of scripts and you get the whole set and a few stats:<br />
Use script wisely, it&#8217;s a strain on servers.</p>
<pre>#!/bin/bash
echo "Downloading 395 pages."
for i in `seq 1 395`;
do
	if [ -s "xkcd/$i" ]; then
		continue
	else
		echo -n "`date +%H:%M:%S`: Trying $i ..."
		lynx --source "http://xkcd.com/$i" &gt; "xkcd/$i"
		echo -n " Done. Image:.. "
		wget -q -p "comics" -nH "http://imgs.xkcd.com/comics/"`awk 'BEGIN{FS="&lt;img src=\"http://imgs.xkcd.com/comics/";RS="\" title="}/&lt;img/{print $2}' "xkcd/$i"`
		echo " Done."
		sleep 2s
	fi
done
echo "All done."</pre>
<p>This piece of code does sometihng special, it takes the name of the image and uses wget to download it.</p>
<pre>$n=1;
$vse=0;
while ($n &lt; 410) {
	unset ($fajl);
	$fajl=file_get_contents("original/".$n);

	preg_match_all("|
&lt;p class=\"quote\"&gt;(.*)&lt;b&gt;#(.*)&lt;/b&gt;(.*)
&lt;p class=\"qt\"&gt;(.*)

|Us", $fajl, $out);
	$i=0;
	while (isset($out[0][$i])) {
		echo '('.$out[2][$i].")\n".$out[4][$i]."\n";
		echo $out[2][$i]."\n".$out[4][$i]."\n";
		$i++;
		$vse++;
	}
	$n++;
}
echo "\n(".$vse.")";</pre>
<p>And a parser that makes the final big file of everything, coincidentally also making the comments easy to read.<br />
Comics make the most part of the download, with ~22 MB.</p>
<p>And as usual, the download link: <a href="http://upload2.net/page/download/uQpZwshE4OlMJ2W/xkcd.tar.gz.html" title="xkcd comics archive" target="_blank">LINK</a> (22mb), or email me for the data.</p>
]]></content:encoded>
			<wfw:commentRss>http://rawdev.net/2008/03/15/size-of-xkcd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Size of Bash.org</title>
		<link>http://rawdev.net/2008/03/15/size-of-bash-or/</link>
		<comments>http://rawdev.net/2008/03/15/size-of-bash-or/#comments</comments>
		<pubDate>Sat, 15 Mar 2008 06:20:26 +0000</pubDate>
		<dc:creator>Marko Zabreznik</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[bash.org]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[quote]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.rawdev.net/?p=1</guid>
		<description><![CDATA[I spent the last few hours on a simple question, how large is the worlds largest irc quote database (bash.org) ? Thinking specifically of the quotes themselves. So first i had to get them all, a simple bash script was sufficient. #!/bin/bash echo "Downloading 409 pages." for i in `seq 1 409`; do if [ [...]]]></description>
			<content:encoded><![CDATA[<p>I spent the last few hours on a simple question, how large is the worlds largest irc quote database (bash.org) ?<br />
Thinking specifically of the quotes themselves.</p>
<p>So first i had to get them all, a simple bash script was sufficient.</p>
<pre>#!/bin/bash
echo "Downloading 409 pages."
for i in `seq 1 409`;
do
if [ -s "original/$i" ]; then
continue
else
echo -n "`date +%H:%M:%S`: Trying $i ..."
lynx --source "http://www.bash.org/?browse=$i" &gt; "original/$i"
echo "Done."
sleep 10s
fi
done
echo "All done."</pre>
<p><em>Please, do not use that script, it is a strain on the bash servers, instead you can grab the original files at the end of the article.</em><br />
After a couple of hours that was done, and i had my next script ready as well;</p>
<pre>$n=1;
$vse=0;
while ($n &lt; 410) {
unset ($fajl);
$fajl=file_get_contents("original/".$n);

preg_match_all("|
<p class="">(.*)<strong>#(.*)</strong>(.*)
<p class="">(.*)|Us", $fajl, $out);
$i=0;
while (isset($out[0][$i])) {
echo '('.$out[2][$i].")\n".$out[4][$i]."\n";
echo $out[2][$i]."\n".$out[4][$i]."\n";
$i++;
$vse++;
}
$n++;
}
echo "\n(".$vse.")";
</pre>
<p>The last line is to make sure i got all of them, 20440 at the time.<br />
Ran it with shell, and piped to &#8220;final&#8221;: php parser.php &gt; final</p>
<p>So, the conclusion was, the size of bash.org is ~<strong>5 MB</strong><br />
This are the files if you want them: <a href="http://upload2.net/page/download/ZXuG8SjBioIIL5F/bash.tar.gz.html">link</a>. (or email me)</p>
]]></content:encoded>
			<wfw:commentRss>http://rawdev.net/2008/03/15/size-of-bash-or/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
