<?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>dan.thoughts &#187; problem</title>
	<atom:link href="http://blog.sosedoff.com/tag/problem/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sosedoff.com</link>
	<description>Web-development, PHP, Ruby, Sinatra, Merb, Rails, MySQL, SQLite, Web Services.</description>
	<lastBuildDate>Wed, 25 Jan 2012 18:54:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Connecting to wifi with specified wep key index</title>
		<link>http://blog.sosedoff.com/2009/03/09/connecting-to-wifi-with-specified-wep-key-index/</link>
		<comments>http://blog.sosedoff.com/2009/03/09/connecting-to-wifi-with-specified-wep-key-index/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 03:41:12 +0000</pubDate>
		<dc:creator>Dan Sosedoff</dc:creator>
				<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[WiFi]]></category>
		<category><![CDATA[key index]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[wep]]></category>

		<guid isPermaLink="false">http://blog.sosedoff.com/?p=75</guid>
		<description><![CDATA[Since i got trouble while connecting to wireless network with given parameters in linux, i tried a lot of ways to get my internet working. 
So, the problem is: Windows Network manager have special option &#8211; Key index. The index is transmitted with the encrypted message. The receiver then looks-up the key corresponding to the [...]]]></description>
			<content:encoded><![CDATA[<p>Since i got trouble while connecting to wireless network with given parameters in linux, i tried a lot of ways to get my internet working. </p>
<p>So, the problem is: Windows Network manager have special option &#8211; Key index. The index is transmitted with the encrypted message. The receiver then looks-up the key corresponding to the transmitted index and uses it to decrypt the message. But linux (ubuntu) network managers i`ve tried have no key index field, so there is no way to set it up properly with gui. Connection won`t work if index value set to incorrect value. </p>
<p>After giving up to find any useful gui program i wrote small shell script only for one network (because i have no access to router and no chance to improve some security settings):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># settings</span>
<span style="color: #007800;">interface</span>=<span style="color: #ff0000;">&quot;ath0&quot;</span> <span style="color: #666666; font-style: italic;"># wireless interface, default to wlan0</span>
<span style="color: #007800;">essid</span>=<span style="color: #ff0000;">&quot;NETWORK_NAME_HERE&quot;</span>
<span style="color: #007800;">key</span>=<span style="color: #ff0000;">&quot;YOUR_KEY_HERE&quot;</span>
<span style="color: #007800;">index</span>=<span style="color: #ff0000;">&quot;4&quot;</span> <span style="color: #666666; font-style: italic;"># can be [1..4]</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># check permission</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$(id -u)</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
   <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Run this script under root&quot;</span> <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">2</span>
   <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># show information</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Settings:&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;-&gt; Interface: <span style="color: #007800;">$interface</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;-&gt; Wifi ESSID: <span style="color: #007800;">$essid</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;-&gt; Key: <span style="color: #007800;">$key</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;-&gt; Key Index: <span style="color: #007800;">$index</span>&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># perform association</span>
<span style="color: #c20cb9; font-weight: bold;">ifconfig</span> <span style="color: #007800;">$interface</span> down
iwconfig <span style="color: #007800;">$interface</span> essid <span style="color: #007800;">$essid</span>
iwconfig <span style="color: #007800;">$interface</span> key <span style="color: #007800;">$key</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">$index</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
iwconfig <span style="color: #007800;">$interface</span> key <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">$index</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #c20cb9; font-weight: bold;">ifconfig</span> <span style="color: #007800;">$interface</span> up
dhclient <span style="color: #007800;">$interface</span></pre></div></div>

<p>Download shell script &#8211; <a href="http://files.sosedoff.com/9591756c/">http://files.sosedoff.com/9591756c/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sosedoff.com/2009/03/09/connecting-to-wifi-with-specified-wep-key-index/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HDD click problem in Ubuntu</title>
		<link>http://blog.sosedoff.com/2009/01/30/hdd-click-problem-in-ubuntu/</link>
		<comments>http://blog.sosedoff.com/2009/01/30/hdd-click-problem-in-ubuntu/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 14:02:45 +0000</pubDate>
		<dc:creator>Dan Sosedoff</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[click]]></category>
		<category><![CDATA[hdd]]></category>
		<category><![CDATA[power management]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[wtf]]></category>

		<guid isPermaLink="false">http://blog.sosedoff.com/?p=47</guid>
		<description><![CDATA[Since i completely switched to ubuntu 8.04 on my laptop i got very weird &#8220;click&#8221; sounds from hard drive. I thought it was just a simple &#8220;sleep&#8221; mode, parking heads or something pretty simple. But that sound began to appear so often (sometimes 2 clicks in 1 secons)  that i cant even get sleep with [...]]]></description>
			<content:encoded><![CDATA[<p>Since i completely switched to ubuntu 8.04 on my laptop i got very weird &#8220;click&#8221; sounds from hard drive. I thought it was just a simple &#8220;sleep&#8221; mode, parking heads or something pretty simple. But that sound began to appear so often (sometimes 2 clicks in 1 secons)  that i cant even get sleep with that disturbing sound.. But that sound appeared only in ubuntu and never heard it in other os. Wtf  is going on? After googling for a short time i figured out what was the problem &#8211; Advanced Power Management in Ubuntu.</p>
<p>Solution was very simple. Just turn off this power management:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> hdparm <span style="color: #660033;">-B255</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda</pre></div></div>

<p>If you have more than one drive &#8211; the same operation but with different device. That`s it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sosedoff.com/2009/01/30/hdd-click-problem-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring WebDAV Server</title>
		<link>http://blog.sosedoff.com/2009/01/15/configuring-webdav-server/</link>
		<comments>http://blog.sosedoff.com/2009/01/15/configuring-webdav-server/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 10:24:32 +0000</pubDate>
		<dc:creator>Dan Sosedoff</dc:creator>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[webdav]]></category>

		<guid isPermaLink="false">http://blog.sosedoff.com/?p=6</guid>
		<description><![CDATA[Some time ago i had reason to make couple servers being accessible by WebDAV protocol.
But all our special storage servers were running nginx 0.6.x, that also supports this protocol.
By the way, it doesn`t support meta commands such as PROPFIND, OPTIONS, so if you try to connect to server with some command-line or GUI client it [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago i had reason to make couple servers being accessible by WebDAV protocol.<br />
But all our special storage servers were running nginx 0.6.x, that also supports this protocol.<br />
By the way, it doesn`t support meta commands such as PROPFIND, OPTIONS, so if you try to connect to server with some command-line or GUI client it will close connection due to accepting &#8220;unknown&#8221; commands, but will work only with PUT, DELETE, COPY, MOVE, MKCOL requests.<br />
It was a huge problem, because for a long time i couldn`t figure out what the reason of reject. Server allways respond with &#8216;405 Not allowed&#8217;. But when i tried put file &#8211; it worked.<br />
Also, alternate fast server <a href="http://lighttpd.net" target="_blank">Lighttpd</a> supports all meta commands.</p>
<p><strong>Simple nginx configuration:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">server {
    listen 80;
    server_name localhost;
    access_log log/access.log;
    error_log log/error.log;
    charset utf-8;
    client_body_temp_path client_body_temp;
    autoindex on;
&nbsp;
     location / {
          root /home/dav/public;
          dav_methods PUT DELETE MKCOL COPY MOVE;
          dav_access user:rw group:rw all:r;
          create_full_put_path on;
&nbsp;
          # auth access
          auth_basic &quot;Restricted&quot;;
          auth_basic_user_file ;
     }
}</pre></div></div>

<p>After configuring server, you`ll need to create htpassword file, that will keep user credentials.<br />
Simple example:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">htpasswd <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">/</span>where<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>save<span style="color: #000000; font-weight: bold;">/</span>the<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">file</span> username</pre></div></div>

<p>More information about how to configure nginx can be found at <a title="Nginx Modules information" href="http://wiki.codemongers.com/NginxModules" target="_blank">http://wiki.codemongers.com/NginxModules</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sosedoff.com/2009/01/15/configuring-webdav-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Streaming FLV videos problem in nginx 0.6.32</title>
		<link>http://blog.sosedoff.com/2009/01/15/streaming-flv-videos-problem-in-nginx/</link>
		<comments>http://blog.sosedoff.com/2009/01/15/streaming-flv-videos-problem-in-nginx/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 10:16:22 +0000</pubDate>
		<dc:creator>Dan Sosedoff</dc:creator>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[flv streaming]]></category>
		<category><![CDATA[jwplayer]]></category>
		<category><![CDATA[problem]]></category>

		<guid isPermaLink="false">http://blog.sosedoff.com/?p=4</guid>
		<description><![CDATA[nginx, fast small webserver, supports flash flv files streaming.
I am currently using JW Player 4.0 on projects, its free, lightweight and have a lot useful features.
But, i got some problems with its latest versions. It always adding some special information, like player container resolution like this:
myvideo.flv?start=2659763&#038;width=280&#038;version=4.0&#038;...
Result: cannot seek on the video.
Found a solution on ruby [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://sysoev.ru/nginx">nginx</a>, fast small webserver, supports flash flv files streaming.<br />
I am currently using JW Player 4.0 on projects, its free, lightweight and have a lot useful features.<br />
But, i got some problems with its latest versions. It always adding some special information, like player container resolution like this:</p>
<pre>myvideo.flv?start=2659763&#038;width=280&#038;version=4.0&#038;...</pre>
<p>Result: cannot seek on the video.<br />
Found a solution on ruby forum. <a href="http://www.ruby-forum.com/attachment/2307/patch.flv">http://www.ruby-forum.com/attachment/2307/patch.flv</a><br />
You need only apply this patch to sources and rebuild nginx. That`s it.</p>
<p>P.S. Don`t know about older versions of nginx, but 0.6.32 from sources doesnt work with JW Player 4.0.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sosedoff.com/2009/01/15/streaming-flv-videos-problem-in-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

