<?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>posheika.net</title>
	<atom:link href="http://posheika.net/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://posheika.net</link>
	<description>sort of a notepad</description>
	<lastBuildDate>Tue, 24 Aug 2010 12:18:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Internet Explorer 8 on Windows 7 more restrictive</title>
		<link>http://posheika.net/?p=110</link>
		<comments>http://posheika.net/?p=110#comments</comments>
		<pubDate>Mon, 23 Aug 2010 22:37:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://posheika.net/?p=110</guid>
		<description><![CDATA[Dealing with handling sessions on 3rd party content (I mean content pulled in using iFrames or Ajax from a different domain than the main page), I recently encountered an issue particularly with Internet Explorer 8 on Windows 7, but not on Windows XP or Windows Vista &#8211; our (3rd party) cookies handling sessions were suddenly [...]]]></description>
			<content:encoded><![CDATA[<p>Dealing with handling sessions on 3rd party content (I mean content pulled in using iFrames or Ajax from a different domain than the main page), I recently encountered an issue particularly with Internet Explorer 8 on Windows 7, but not on Windows XP or Windows Vista &#8211; our (3rd party) cookies handling sessions were suddenly being blocked. Soon after I found out that the same issue exists for Internet Explorer 6 on Windows XP. I tried to find any issues or topics online in particular what had changed in IE8 on Windows 7, but &#8211; nothing. The solution, however, I had to seek for more than a day as I found it using trial&amp;error as it was not described anywhere, but it proved to be pretty simple.<br /><span id="more-110"></span>Firstly, after finding out that IE6 had the same symptoms as IE8 on Windows 7, I must conclude that IE7 and IE8 on Windows XP and Windows Vista are for some reason more &#8220;lenient&#8221; as the root of this problem with IE6 on Windows XP and IE8 on Windows 7 was lack of appropriate privacy preference and policy specification, known as <a href="http://www.w3.org/P3P/" target="_blank">P3P</a>, even though the same policy settings and requirements are for IE7 and IE8 on Windows XP and Windows Vista.</p>
<p>A similar issue and appropriate solutions is discussed at <a href="http://stackoverflow.com/questions/389456/cookie-blocked-not-saved-in-iframe-in-internet-explorer" target="_blank">StackOverflow</a> in a great detail, however, the solution described there didn&#8217;t work for me completely &#8211; besides creating an appropriate P3P policy file (which can be pretty easily done using this <a href="http://www.alphaworks.ibm.com/tech/p3peditor/download" target="_blank">P3P file editor</a> and validated <a href="http://www.w3.org/P3P/validator.html" target="_blank">here</a>), I had to add the following P3P line to the Apache server configuration to add to header of <span style="text-decoration: underline;"><strong>every</strong></span> file sent out from the 3rd party server, even images and Javascript &#8211; files that are not setting or using session or cookies:</p>
<div class="codesnip-container" >
<p>&lt;IfModule mod_headers.c&gt;<br /> Header set P3P &#8220;policyref=\&#8221;/w3c/p3p.xml\&#8221;, CP=\&#8221;ALL DSP COR CURa OUR IND COM NAV CNT\&#8221;"<br />&lt;/IfModule&gt;</p>
</div>
<p>This solved it. Hopefully this will avoid or at least minimize headaches for someone having the same problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://posheika.net/?feed=rss2&amp;p=110</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Importing/exporting data with MySQL</title>
		<link>http://posheika.net/?p=95</link>
		<comments>http://posheika.net/?p=95#comments</comments>
		<pubDate>Sun, 19 Apr 2009 15:39:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://posheika.net/?p=95</guid>
		<description><![CDATA[This is more of a note-to-myself entry to dig it up later easily, but the syntax to import dump file to MySQL is: mysql -p -h database_server -u mysql_user mysql_dbname &#60; file_dbname.sql The same way mysql dump can be created: mysqldump -p -h database_server -u mysql_user mysql_dbname &#62; dump_file.sql Good resource with more on this [...]]]></description>
			<content:encoded><![CDATA[<p>This is more of a note-to-myself entry to dig it up later easily, but the syntax to import dump file to MySQL is:</p>
<div class="codesnip-container" ><strong>mysql </strong>-p -h <em>database_server</em> -u <em>mysql_user</em> <em>mysql_dbname</em> &lt; <em>file_dbname</em>.sql</div>
<p>The same way mysql dump can be created:</p>
<div class="codesnip-container" ><strong>mysqldump</strong> -p -h <em>database_server</em> -u <em>mysql_user</em> <em>mysql_dbname</em> &gt; <em>dump_file.sql</em></div>
<p>Good resource with more on this is <a href="http://www.modwest.com/help/kb6-241.html" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://posheika.net/?feed=rss2&amp;p=95</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get query string variables of Javascript files</title>
		<link>http://posheika.net/?p=42</link>
		<comments>http://posheika.net/?p=42#comments</comments>
		<pubDate>Tue, 03 Feb 2009 23:37:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://posheika.net/?p=42</guid>
		<description><![CDATA[Looking at different scripts linking to Javascript and AJAX frameworks such as Scriptaculous, I noticed that it allows loading of particular parts of it by adding them in the following query string such as this: &#60;script type=&#34;text/javascript&#34; src=&#34;scriptaculous.js?load=effects,builder&#34;&#62;&#60;/script&#62; Looking at scriptaculous.js itself, it relied on some built-in functionality for that. I was unsuccessful in finding [...]]]></description>
			<content:encoded><![CDATA[<p>Looking at different scripts linking to Javascript and AJAX frameworks such as <a title="Scriptaculous" href="http://script.aculo.us/" target="_blank">Scriptaculous</a>, I noticed that it allows loading of particular parts of it by adding them in the following query string such as this:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="sc2"><a href="http://december.com/html/4/element/script.html"><span class="kw2">&lt;script</span></a> <span class="kw3">type</span>=<span class="st0">&quot;text/javascript&quot;</span> <span class="kw3">src</span>=<span class="st0">&quot;scriptaculous.js?load=effects,builder&quot;</span><span class="kw2">&gt;</span></span><span class="sc2"><span class="kw2">&lt;/script&gt;</span></span></div>
</div>
<p>Looking at <em>scriptaculous.js</em> itself, it relied on some built-in functionality for that. I was unsuccessful in finding online a ready function to do exactly that, so inspired by <a href="http://www.bloggingdeveloper.com/post/JavaScript-QueryString-ParseGet-QueryString-with-Client-Side-JavaScript.aspx" target="_blank">this piece of code</a> and borrowing the <em>regex</em> part of it, I wrote a function which grabs the additional parameters and allows using them in the Javascript:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">function</span> getJSvars<span class="br0">&#40;</span>script_name, var_name, if_empty<span class="br0">&#41;</span> <span class="br0">&#123;</span></p>
<p><span class="kw2">var</span> script_elements = document.<span class="me1">getElementsByTagName</span><span class="br0">&#40;</span><span class="st0">&#8216;script&#8217;</span><span class="br0">&#41;</span>;</p>
<p><span class="kw1">if</span><span class="br0">&#40;</span>if_empty == <span class="kw2">null</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="kw2">var</span> if_empty = <span class="st0">&#8221;</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="kw1">for</span> <span class="br0">&#40;</span>a = <span class="nu0">0</span>; a &lt; script_elements.<span class="me1">length</span>; a++<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp;<span class="kw2">var</span> source_string = script_elements<span class="br0">&#91;</span>a<span class="br0">&#93;</span>.<span class="me1">src</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">if</span><span class="br0">&#40;</span>source_string.<span class="me1">indexOf</span><span class="br0">&#40;</span>script_name<span class="br0">&#41;</span>&gt;=<span class="nu0">0</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp;var_name = var_name.<span class="me1">replace</span><span class="br0">&#40;</span><span class="re0">/<span class="br0">&#91;</span>\<span class="br0">&#91;</span><span class="br0">&#93;</span>/</span>,<span class="st0">&quot;<span class="es0">\\</span><span class="es0">\[</span>&quot;</span><span class="br0">&#41;</span>.<span class="me1">replace</span><span class="br0">&#40;</span><span class="re0">/<span class="br0">&#91;</span>\<span class="br0">&#93;</span><span class="br0">&#93;</span>/</span>,<span class="st0">&quot;<span class="es0">\\</span><span class="es0">\]</span>&quot;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span class="kw2">var</span> regex_string = <span class="kw2">new</span> RegExp<span class="br0">&#40;</span><span class="st0">&quot;[<span class="es0">\\</span>?&amp;]&quot;</span>+var_name+<span class="st0">&quot;=([^&amp;#]*)&quot;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span class="kw2">var</span> parsed_vars = regex_string.<span class="me1">exec</span><span class="br0">&#40;</span>source_string<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">if</span><span class="br0">&#40;</span>parsed_vars == <span class="kw2">null</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="kw1">return</span> if_empty; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">else</span> <span class="br0">&#123;</span> <span class="kw1">return</span> parsed_vars<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span>; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp;<span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
<p>Usage of it is simple: if you have a Javascript which should parse some dynamic variables (such as user or account ID), you can include it right after the included Javascript like this:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="sc2"><a href="http://december.com/html/4/element/script.html"><span class="kw2">&lt;script</span></a> <span class="kw3">type</span>=<span class="st0">&quot;text/javascript&quot;</span> <span class="kw3">src</span>=<span class="st0">&quot;script.js?var1=value1&amp;var2=value2&quot;</span><span class="kw2">&gt;</span></span><span class="sc2"><span class="kw2">&lt;/script&gt;</span></span></div>
</div>
<p>instead of creating a server-side generated dynamic Javascript using PHP or other language. The values of variables like <em>var1 </em> can be retrieved like this:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">var</span> var1 = getJSvars<span class="br0">&#40;</span><span class="st0">&#8216;script.js&#8217;</span>, <span class="st0">&#8216;var1&#8242;</span><span class="br0">&#41;</span>;</div>
</div>
<p>You can also add a value as third parameter to output in case <em>var1</em> is empty, but it is optional.</p>
]]></content:encoded>
			<wfw:commentRss>http://posheika.net/?feed=rss2&amp;p=42</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Now this is scary</title>
		<link>http://posheika.net/?p=36</link>
		<comments>http://posheika.net/?p=36#comments</comments>
		<pubDate>Thu, 23 Oct 2008 21:33:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[gadgets]]></category>

		<guid isPermaLink="false">http://posheika.net/?p=36</guid>
		<description><![CDATA[Could you possibly imagine it is this easy to capture what is typed on your keyboard? Wirelessly.. even through a wall! Videos below from the Engadget article mentioned above: Video 1: Compromising Electromagnetic Emanations of Keyboards Experiment 1/2 from Martin Vuagnoux on Vimeo. Video 2: Compromising Electromagnetic Emanations of Keyboards Experiment 2/2 from Martin Vuagnoux [...]]]></description>
			<content:encoded><![CDATA[<p>Could you possibly imagine it is <a href="http://www.engadget.com/2008/10/20/keyboard-eavesdropping-just-got-way-easier-thanks-to-electrom/" target="_blank">this easy</a> to capture what is typed on your keyboard? Wirelessly.. even through a wall!</p>
<p><span id="more-36"></span></p>
<p>Videos below from the <a href="http://www.engadget.com/2008/10/20/keyboard-eavesdropping-just-got-way-easier-thanks-to-electrom/" target="_blank">Engadget article mentioned above</a>:</p>
<p><strong>Video 1:</strong></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="225" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=2007855&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="225" src="http://vimeo.com/moogaloop.swf?clip_id=2007855&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object><br />
<a href="http://vimeo.com/2007855?pg=embed&amp;sec=2007855">Compromising Electromagnetic Emanations of Keyboards Experiment 1/2</a> from <a href="http://vimeo.com/user836876?pg=embed&amp;sec=2007855">Martin Vuagnoux</a> on <a href="http://vimeo.com?pg=embed&amp;sec=2007855">Vimeo</a>.</p>
<p><strong>Video 2:</strong><br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="225" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=2008343&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="225" src="http://vimeo.com/moogaloop.swf?clip_id=2008343&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object><br />
<a href="http://vimeo.com/2008343?pg=embed&amp;sec=2008343">Compromising Electromagnetic Emanations of Keyboards Experiment 2/2</a> from <a href="http://vimeo.com/user836876?pg=embed&amp;sec=2008343">Martin Vuagnoux</a> on <a href="http://vimeo.com?pg=embed&amp;sec=2008343">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://posheika.net/?feed=rss2&amp;p=36</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Welcome!</title>
		<link>http://posheika.net/?p=1</link>
		<comments>http://posheika.net/?p=1#comments</comments>
		<pubDate>Thu, 18 Sep 2008 08:39:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://posheika.net/?p=1</guid>
		<description><![CDATA[In this web site you will find different useful on-line tools, code snippets, maybe even different ideas and thoughts on different topics. The purpose of this web site is to serve more like a personal notepad, but it is aimed also to be useful for others.]]></description>
			<content:encoded><![CDATA[<p>In this web site you will find different useful on-line tools, code snippets, maybe even different ideas and thoughts on different topics. <strong>The purpose of this web site is to serve more like a personal notepad, but it is aimed also to be useful for others.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://posheika.net/?feed=rss2&amp;p=1</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
