<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9055909554789113715</id><updated>2011-10-09T15:24:33.454-07:00</updated><category term='libfm'/><category term='Linux'/><category term='LXDE'/><category term='Gnome'/><category term='GIO'/><title type='text'>Penguin Copter</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://penguincopter.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9055909554789113715/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://penguincopter.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>wodny</name><uri>http://www.blogger.com/profile/07353475234651120146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9055909554789113715.post-5257951014722098874</id><published>2011-10-09T15:24:00.000-07:00</published><updated>2011-10-09T15:24:33.486-07:00</updated><title type='text'>Web of Trust</title><content type='html'>&lt;p&gt; This document is based on tests and some source code analysis of GnuPG.  Ithas been written because &lt;ahref="http://www.gnupg.org/gph/en/manual.html"&gt;available&lt;/a&gt; &lt;ahref="http://www.wim.uni-koeln.de/uploads/media/The_PGP_Trust_Model.pdf"&gt;sources&lt;/a&gt;weren't enough for me to understand &lt;b&gt;how the &lt;i&gt;"web of trust"&lt;/i&gt; works&lt;/b&gt;.&lt;/p&gt;&lt;h1&gt;Properties&lt;/h1&gt;&lt;h2&gt;Validity&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;indicates if a signature made by an individual is going to be approved   or if a warning about uncertainty of one's identity pops up,&lt;/li&gt;&lt;li&gt;&lt;b&gt;&lt;i&gt;"validity"&lt;/i&gt; is calculated&lt;/b&gt; by the &lt;i&gt;"web of trust"&lt;/i&gt; algorithm,&lt;/li&gt;&lt;li&gt;&lt;i&gt;"validity"&lt;/i&gt;&amp;nbsp;==&amp;nbsp;&lt;i&gt;"full"&lt;/i&gt; or &lt;i&gt;"ultimate"&lt;/i&gt; means that the identity is   considered true.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Trust&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;indicates how much I trust an individual when it comes to him/her  verifying identity of others,&lt;/li&gt;&lt;li&gt;in others words - how much his/her signature on keys of other   individuals influences &lt;i&gt;"validity"&lt;/i&gt; of these keys,&lt;/li&gt;&lt;li&gt;&lt;b&gt;&lt;i&gt;"trust"&lt;/i&gt; is set manually&lt;/b&gt; by the user.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Current &lt;i&gt;"validity"&lt;/i&gt; of keys can be printed using the following command:&lt;br&gt;&lt;code&gt;$ gpg --list-keys --list-options show-uid-validity&lt;/code&gt;&lt;/p&gt;&lt;h1&gt;&lt;i&gt;"Web of trust"&lt;/i&gt; algorithms&lt;/h1&gt;&lt;p&gt;In the GnuPG manual following methods are listed:&lt;ul&gt;&lt;li&gt;pgp,&lt;/li&gt;&lt;li&gt;classic,&lt;/li&gt;&lt;li&gt;direct,&lt;/li&gt;&lt;li&gt;always.&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&lt;p&gt;Currently &lt;i&gt;"pgp"&lt;/i&gt; is the one used by default and described in this document.&lt;/p&gt;&lt;h1&gt;Chaotic keywords&lt;/h1&gt;&lt;p&gt;Terminology is chaotic. According to some &lt;a href="http://www.wim.uni-koeln.de/uploads/media/The_PGP_Trust_Model.pdf"&gt;sources&lt;/a&gt; the property called &lt;i&gt;"validity"&lt;/i&gt; takes one of these values:&lt;ul&gt;&lt;li&gt;undefined,&lt;/li&gt;&lt;li&gt;marginal,&lt;/li&gt;&lt;li&gt;complete.&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&lt;p&gt;According to the same &lt;a href="http://www.wim.uni-koeln.de/uploads/media/The_PGP_Trust_Model.pdf"&gt;source&lt;/a&gt; the property called &lt;i&gt;"trust"&lt;/i&gt; takes one of these values:&lt;ul&gt;&lt;li&gt;don't know,&lt;/li&gt;&lt;li&gt;untrustworthy,&lt;/li&gt;&lt;li&gt;marginal,&lt;/li&gt;&lt;li&gt;full.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;As far as GnuPG is concerned the same set of values is &lt;b&gt;used for both properties&lt;/b&gt;. Whenever there is not enough data to determine the &lt;i&gt;"trust"&lt;/i&gt; the &lt;i&gt;"unknown"&lt;/i&gt; label is used.&lt;/p&gt;&lt;p&gt;If the user does not know if some individual's signatures can be trusted one can indicate it setting &lt;i&gt;"trust"&lt;/i&gt; to &lt;i&gt;"undefined"&lt;/i&gt;.&lt;/p&gt;&lt;p&gt;&lt;i&gt;"Untrustworthy"&lt;/i&gt; becomes &lt;i&gt;"never"&lt;/i&gt;. &lt;i&gt;"Marginal"&lt;/i&gt; stays &lt;i&gt;"marginal"&lt;/i&gt;. The &lt;i&gt;"complete"&lt;/i&gt; label is divided into more specific &lt;i&gt;"full"&lt;/i&gt; and &lt;i&gt;"ultimate"&lt;/i&gt;.&lt;/p&gt;&lt;p&gt;&lt;i&gt;"Ultimate"&lt;/i&gt; is a special label used only for user's own keys.&lt;/p&gt;&lt;p&gt;There are two other labels used in the source code: &lt;i&gt;"expired"&lt;/i&gt; and &lt;i&gt;"revoked"&lt;/i&gt;. They are not described in this document.&lt;/p&gt;&lt;h1&gt;Deceiving keywords&lt;/h1&gt;&lt;p&gt;I think labels &lt;i&gt;"marginal"&lt;/i&gt; and &lt;i&gt;"full"&lt;/i&gt; are deceiving. In reality in case of &lt;i&gt;"trust"&lt;/i&gt; they indicate if an individual is believed to be able to &lt;b&gt;verify identity&lt;/b&gt; of others by himself or only as a member of a group. By default GnuPG finds a key valid (&lt;i&gt;"validity"&lt;/i&gt;&amp;nbsp;==&amp;nbsp;&lt;i&gt;"full"&lt;/i&gt;) if a key has:&lt;ul&gt;&lt;li&gt;1 signature  of a person with&lt;br&gt;  &lt;i&gt;"trust"&lt;/i&gt;&amp;nbsp;==&amp;nbsp;&lt;i&gt;"full"&lt;/i&gt;     and &lt;i&gt;"validity"&lt;/i&gt;&amp;nbsp;==&amp;nbsp;&lt;i&gt;"full"&lt;/i&gt;&lt;br&gt;    or&lt;/li&gt;&lt;li&gt;3 signatures of people with&lt;br&gt;  &lt;i&gt;"trust"&lt;/i&gt;&amp;nbsp;==&amp;nbsp;&lt;i&gt;"marginal"&lt;/i&gt; and &lt;i&gt;"validity"&lt;/i&gt;&amp;nbsp;==&amp;nbsp;&lt;i&gt;"full"&lt;/i&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&lt;p&gt;These thresholds are &lt;b&gt;not&lt;/b&gt; saved in the &lt;i&gt;"web of trust"&lt;/i&gt; file (trustdb.gpg).  They can be set on the command line using parameters:&lt;ul&gt;&lt;li&gt;--marginals-needed,&lt;/li&gt;&lt;li&gt;--completes-needed&lt;/li&gt;&lt;/ul&gt;or similarly in the configuration file (gpg.conf).&lt;/p&gt;&lt;h1&gt;&lt;i&gt;"Validity"&lt;/i&gt;&amp;nbsp;==&amp;nbsp;&lt;i&gt;"full"&lt;/i&gt;&lt;/h1&gt;&lt;p&gt;When the user signs a key GnuPG considers that key to have &lt;i&gt;"validity"&lt;/i&gt;&amp;nbsp;==&amp;nbsp;&lt;i&gt;"full"&lt;/i&gt; (from that user's point of view).&lt;/p&gt;&lt;h1&gt;Calculating &lt;i&gt;"validity"&lt;/i&gt; through iterations&lt;/h1&gt;&lt;p&gt;The &lt;i&gt;"validity"&lt;/i&gt; calculation starts from an &lt;i&gt;"ultimate"&lt;/i&gt; key and goes towards more remote keys.&lt;/p&gt;&lt;p&gt;The calculation process does not skip missing graph edges. So for a key to be considered valid &lt;b&gt;there has to be a path from an &lt;i&gt;"ultimate"&lt;/i&gt; key&lt;/b&gt; to that key. That path cannot be longer than the threshold set by the max-cert-depth setting (5 by default).&lt;/p&gt;&lt;p&gt;It means that a key will not become valid if it is signed by an individual with the &lt;i&gt;"trust"&lt;/i&gt; property set but there is no path leading to that user (from an &lt;i&gt;"ultimate"&lt;/i&gt; key).&lt;/p&gt;&lt;p&gt;The user can force the &lt;i&gt;"web of trust"&lt;/i&gt; &lt;b&gt;rebuilding&lt;/b&gt; executing the following command:&lt;br&gt;&lt;code&gt;$ gpg --update-trustdb&lt;/code&gt;&lt;/p&gt;&lt;p&gt;The algorithm uses only those keys which get &lt;i&gt;"validity"&lt;/i&gt;&amp;nbsp;==&amp;nbsp;&lt;i&gt;"full"&lt;/i&gt; during the calculation. The &lt;i&gt;"marginals-needed"&lt;/i&gt; and &lt;i&gt;"completes-needed"&lt;/i&gt; are associated with the manually set &lt;i&gt;"trust"&lt;/i&gt; property, not with the &lt;i&gt;"validity"&lt;/i&gt; property.&lt;/p&gt;&lt;p&gt;The algorithm continues to go deeper while at least one of the &lt;i&gt;"marginals-needed"&lt;/i&gt; or &lt;i&gt;"completes-needed"&lt;/i&gt; conditions is true. It means to continue while there were enough keys with &lt;i&gt;"validity"&lt;/i&gt;&amp;nbsp;==&amp;nbsp;&lt;i&gt;"full"&lt;/i&gt; and &lt;i&gt;"trust"&lt;/i&gt;&amp;nbsp;==&amp;nbsp;&lt;i&gt;"ultimate"&lt;/i&gt;/&lt;i&gt;"full"&lt;/i&gt;/&lt;i&gt;"marginal"&lt;/i&gt; in the previous iteration to create another key with &lt;i&gt;"validity"&lt;/i&gt;&amp;nbsp;==&amp;nbsp;&lt;i&gt;"full"&lt;/i&gt;.&lt;/p&gt;&lt;p&gt;During the last iteration keys being reachable but without enough signatures (but still with at least one signature made with a key with &lt;i&gt;"validity"&lt;/i&gt;&amp;nbsp;==&amp;nbsp;&lt;i&gt;"full"&lt;/i&gt;) are labeled with &lt;b&gt;&lt;i&gt;"validity"&lt;/i&gt;&amp;nbsp;==&amp;nbsp;&lt;i&gt;"marginal"&lt;/i&gt;&lt;/b&gt;.&lt;/p&gt;&lt;h1&gt;An example of a &lt;i&gt;"web of trust"&lt;/i&gt;&lt;/h1&gt;&lt;pre style="font-size: 0.8em"&gt;&lt;br /&gt;$ gpg --homedir me --update-trustdb --marginals-needed 2&lt;br /&gt;gpg: 2 marginal(s) needed, 1 complete(s) needed, PGP trust model&lt;br /&gt;gpg: depth: 0  valid:   1  signed:   2  trust: 0-, 0q, 0n, 0m, 0f, &lt;b&gt;1u&lt;/b&gt;&lt;br /&gt;gpg: depth: 1  valid:   2  signed:   4  trust: 0-, 0q, 0n, &lt;b&gt;2m&lt;/b&gt;, 0f, 0u&lt;br /&gt;gpg: depth: 2  valid:   3  signed:   1  trust: 0-, &lt;b&gt;3q&lt;/b&gt;, 0n, 0m, 0f, 0u&lt;br /&gt;gpg: next trustdb check due at 2012-09-30&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;There were 3 iterations.&lt;/p&gt;&lt;p&gt;At level (depth) 0 my key gets &lt;i&gt;"validity"&lt;/i&gt;&amp;nbsp;==&amp;nbsp;&lt;i&gt;"ultimate"&lt;/i&gt; because it has my signature and &lt;i&gt;"trust"&lt;/i&gt;&amp;nbsp;==&amp;nbsp;&lt;i&gt;"ultimate"&lt;/i&gt; (1u).&lt;/p&gt;&lt;p&gt;At level 1 the GnuPG stumbles upon 4 keys signed by 2 individuals with &lt;i&gt;"trust"&lt;/i&gt;&amp;nbsp;==&amp;nbsp;&lt;i&gt;"marginal"&lt;/i&gt; (2m).&lt;/p&gt;&lt;p&gt;At level 2 the GnuPG stumbles upon 1 key signed by 3 individuals with &lt;i&gt;"trust"&lt;/i&gt;&amp;nbsp;==&amp;nbsp;&lt;i&gt;"undefined"&lt;/i&gt; (3q).&lt;/p&gt;&lt;p&gt;The printed description of the process becomes more complicated when there are multiple paths with different lengths leading to a key. This can be seen in this example as well. A key at level 3 is signed by:&lt;ul&gt;&lt;li&gt;1 individual from level 1 and&lt;/li&gt;&lt;li&gt;3 individuals from level 2.&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&lt;p&gt;As we can see we did not get to to level 3 iteration. But a key at this level is reachable -- it has signatures but not enough of them. This is why it gets &lt;b&gt;&lt;i&gt;"validity"&lt;/i&gt;&amp;nbsp;==&amp;nbsp;&lt;i&gt;"marginal"&lt;/i&gt;&lt;/b&gt;.&lt;/p&gt;&lt;p&gt;This is the signatures structure:&lt;br&gt;me → friends → guys → alien,&lt;br&gt;additionally Friend Two has signed the Alien's key.&lt;/p&gt;&lt;p&gt;&lt;pre style="font-size: 0.8em"&gt;&lt;br /&gt;$ gpg --homedir me --list-keys --list-options show-uid-validity&lt;br /&gt;--------------&lt;br /&gt;pub   2048R/AFA302BF 2011-10-01&lt;br /&gt;uid       [ultimate] The Me &lt;me@domain.com&gt;&lt;br /&gt;sub   2048R/E4FF8420 2011-10-01&lt;br /&gt;&lt;br /&gt;pub   1024R/6921DF3D 2011-10-01 [expires: 2012-09-30]&lt;br /&gt;uid       [  full  ] The Friend &lt;friend@domain.com&gt;&lt;br /&gt;uid       [ unknown] The Friend (alternate) &lt;friend_alt@domain.com&gt;&lt;br /&gt;sub   1024R/DD37730B 2011-10-01 [expires: 2012-09-30]&lt;br /&gt;&lt;br /&gt;pub   1024D/1E71B2C3 2011-10-01&lt;br /&gt;uid       [  full  ] Friend Two &lt;friend2@domain.com&gt;&lt;br /&gt;sub   1024g/B2F94583 2011-10-01&lt;br /&gt;&lt;br /&gt;pub   1024D/0DE1BC29 2011-10-01&lt;br /&gt;uid       [  full  ] Guy 1 &lt;guy1@domain.com&gt;&lt;br /&gt;sub   1024g/ACA329E3 2011-10-01&lt;br /&gt;&lt;br /&gt;pub   1024D/0FC4A4A7 2011-10-01&lt;br /&gt;uid       [  full  ] Guy Two &lt;guytwo@domain.com&gt;&lt;br /&gt;sub   1024g/38445EB3 2011-10-01&lt;br /&gt;&lt;br /&gt;pub   1024D/9674B894 2011-10-01&lt;br /&gt;uid       [  full  ] Guy Drei &lt;guydrei@domain.com&gt;&lt;br /&gt;sub   1024g/95A9CB7E 2011-10-01&lt;br /&gt;&lt;br /&gt;pub   1024D/AC4EC9F7 2011-10-01&lt;br /&gt;uid       [marginal] Alien &lt;alien@domain.com&gt;&lt;br /&gt;sub   1024g/4A46043E 2011-10-01&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9055909554789113715-5257951014722098874?l=penguincopter.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://penguincopter.blogspot.com/feeds/5257951014722098874/comments/default' title='Komentarze do posta'/><link rel='replies' type='text/html' href='http://penguincopter.blogspot.com/2011/10/web-of-trust.html#comment-form' title='Komentarze (0)'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9055909554789113715/posts/default/5257951014722098874'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9055909554789113715/posts/default/5257951014722098874'/><link rel='alternate' type='text/html' href='http://penguincopter.blogspot.com/2011/10/web-of-trust.html' title='Web of Trust'/><author><name>wodny</name><uri>http://www.blogger.com/profile/07353475234651120146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9055909554789113715.post-334166586775537037</id><published>2010-12-11T14:16:00.000-08:00</published><updated>2010-12-11T15:01:21.483-08:00</updated><title type='text'>Zabawna (?) alternatywa dla DNS</title><content type='html'>&lt;p&gt;Gdzieś tam w RSSach pojawił się link do &lt;a href="http://www.itworld.com/legal/129947/net-censorship-dns-alternative"&gt;artykułu&lt;/a&gt; o tym, jak sobie radzić w momencie, gdy państwo wycina z DNSów niewygodne adresy. Ponieważ, inaczej niż to się zwykło pisać na gazeta.pl, niedziałający/wadliwy DNS nie powoduje, że &lt;a href="http://www.youtube.com/watch?v=iDbyYGrswtg"&gt;pudełko z Internetem&lt;/a&gt; nie działa - są rozwiązania na czas kryzysu.&lt;/p&gt;&lt;p&gt;We wspomnianym artykule mowa jest m.in. o projekcie &lt;a href="http://blog.rabidgremlin.com/2010/11/28/4-little-words/"&gt;4 little words&lt;/a&gt; &lt;a href="http://blog.rabidgremlin.com/2010/11/28/4-little-words/"&gt;(4LW)&lt;/a&gt;. W &lt;a href="https://github.com/armooo/4-little-words-DNS-server"&gt;aktualnej wersji&lt;/a&gt; zamienia każdy z czterech oktetów IPv4 na układ 4 słów w kolejności: przymiotnik, rzeczownik, czasownik, rzeczownik. Przydatność narzędzia jest dyskusyjna, bo chyba łatwiej wpisać sobie brakujące adresy do &lt;code&gt;/etc/hosts&lt;/code&gt; i nosić plik ze sobą na pendrive'ie. Przy okazji jednak można obejrzeć, skąd wzięła się &lt;a href="http://www.reddit.com/r/technology/comments/ecllk/the_4_little_word_protocol_4lw_for_remembering/"&gt;lista&lt;/a&gt; &lt;a href="http://www.robwaring.org/vocab/wordlists/vocfreq.html"&gt;słów&lt;/a&gt; i przeczytać o pewnym &lt;a href="http://tools.ietf.org/html/rfc2289"&gt;RFC&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;A tak w ogóle narzędzie ma tę zaletę, że co jakiś czas wypluwa coś śmiesznego.&lt;/p&gt;&lt;h3&gt;Politechnika żądna krwi&lt;/h3&gt;&lt;pre&gt;&lt;table&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;www.pw.edu.pl&lt;/td&gt;&lt;td&gt;194.29.151.5&lt;/td&gt;&lt;td&gt;relevant.blood.matches.aid&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;/pre&gt;&lt;h3&gt;Społeczności&lt;/h3&gt;&lt;pre&gt;&lt;table&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;nasza-klasa.pl&lt;/td&gt;&lt;td&gt;195.93.178.6&lt;/td&gt;&lt;td&gt;religious.gas.puts.aim&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;www.gadu-gadu.pl&lt;/td&gt;&lt;td&gt;91.197.14.140&lt;/td&gt;&lt;td&gt;full.sign.applies.love&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;/pre&gt;&lt;h3&gt;Co wybierze Mikołaj&lt;/h3&gt;&lt;pre&gt;&lt;table&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;allegro.pl&lt;/td&gt;&lt;td&gt;193.23.48.134&lt;/td&gt;&lt;td&gt;relative.bed.chooses.list&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;/pre&gt;&lt;h3&gt;Nomen omen&lt;/h3&gt;&lt;pre&gt;&lt;table&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;failblog.org&lt;/td&gt;&lt;td&gt;74.200.247.59&lt;/td&gt;&lt;td&gt;extra.site.warns.day&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;failblog.org&lt;/td&gt;&lt;td&gt;76.74.254.120&lt;/td&gt;&lt;td&gt;familiar.fact.worries.king&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;/pre&gt;&lt;h3&gt;Bitwy dystrybucji&lt;/h3&gt;&lt;pre&gt;&lt;table&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;gentoo.org&lt;/td&gt;&lt;td&gt;204.74.99.100&lt;/td&gt;&lt;td&gt;serious.fact.fits.gun&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;www.redhat.com&lt;/td&gt;&lt;td&gt;95.100.144.112&lt;/td&gt;&lt;td&gt;good.gun.lives.hope&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;/pre&gt;&lt;h3&gt;Eksperymentatorzy&lt;/h3&gt;&lt;pre&gt;&lt;table&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;lwn.net&lt;/td&gt;&lt;td&gt;72.51.34.34&lt;/td&gt;&lt;td&gt;expensive.coal.blows.book&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;www.gnu.org&lt;/td&gt;&lt;td&gt;140.186.70.148&lt;/td&gt;&lt;td&gt;medical.run.derives.milk&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;/pre&gt;&lt;h3&gt;Transfery pieniędzy&lt;/h3&gt;&lt;pre&gt;&lt;table&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;www.python.org&lt;/td&gt;&lt;td&gt;82.94.164.162&lt;/td&gt;&lt;td&gt;financial.gate.orders.park&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;mozilla.com&lt;/td&gt;&lt;td&gt;63.245.209.106&lt;/td&gt;&lt;td&gt;economic.wife.sits.heat&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;microsoft.com&lt;/td&gt;&lt;td&gt;207.46.197.32&lt;/td&gt;&lt;td&gt;similar.cause.sells.body&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;/pre&gt;&lt;h3&gt;Taki jest duży&lt;/h3&gt;&lt;pre&gt;&lt;table&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;ing.pl&lt;/td&gt;&lt;td&gt;193.201.34.35&lt;/td&gt;&lt;td&gt;relative.size.blows.box&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;/pre&gt;&lt;h3&gt;Sprawa patrona Polski wydaje się jaśniejsza&lt;/h3&gt;&lt;pre&gt;&lt;table&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;sejm.gov.pl&lt;/td&gt;&lt;td&gt;195.187.136.11&lt;/td&gt;&lt;td&gt;religious.sale.learns.art&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;/pre&gt;&lt;h3&gt;Służby&lt;/h3&gt;&lt;pre&gt;&lt;table&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;policja.pl&lt;/td&gt;&lt;td&gt;195.164.254.6&lt;/td&gt;&lt;td&gt;religious.past.worries.aim&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;www.fbi.gov&lt;/td&gt;&lt;td&gt;204.160.120.86&lt;/td&gt;&lt;td&gt;serious.pain.holds.flow&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;/pre&gt;&lt;h3&gt;Telewizja&lt;/h3&gt;&lt;pre&gt;&lt;table&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;www.tvp.pl&lt;/td&gt;&lt;td&gt;195.245.213.150&lt;/td&gt;&lt;td&gt;religious.wife.sorts.mine&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;www.tvn24.pl&lt;/td&gt;&lt;td&gt;213.180.146.124&lt;/td&gt;&lt;td&gt;social.road.loses.lady&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;www.polsat.pl&lt;/td&gt;&lt;td&gt;217.17.36.172&lt;/td&gt;&lt;td&gt;special.ball.brings.rabbit&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;/pre&gt;&lt;h3&gt;No tak, wiadomo było&lt;/h3&gt;&lt;pre&gt;&lt;table&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;wodny.org&lt;/td&gt;&lt;td&gt;91.189.252.37&lt;/td&gt;&lt;td&gt;full.seal.wishes.brain&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9055909554789113715-334166586775537037?l=penguincopter.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://penguincopter.blogspot.com/feeds/334166586775537037/comments/default' title='Komentarze do posta'/><link rel='replies' type='text/html' href='http://penguincopter.blogspot.com/2010/12/gdzies-tam-w-rssach-pojawi-sie-link-do.html#comment-form' title='Komentarze (0)'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9055909554789113715/posts/default/334166586775537037'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9055909554789113715/posts/default/334166586775537037'/><link rel='alternate' type='text/html' href='http://penguincopter.blogspot.com/2010/12/gdzies-tam-w-rssach-pojawi-sie-link-do.html' title='Zabawna (?) alternatywa dla DNS'/><author><name>wodny</name><uri>http://www.blogger.com/profile/07353475234651120146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9055909554789113715.post-7703918144140535902</id><published>2010-06-17T16:41:00.000-07:00</published><updated>2010-08-01T20:39:06.452-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='libfm'/><category scheme='http://www.blogger.com/atom/ns#' term='Gnome'/><category scheme='http://www.blogger.com/atom/ns#' term='LXDE'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='GIO'/><title type='text'>libfm, GIO, absence of Gnome, priority of the extension module</title><content type='html'>&lt;p&gt;Yesterday I've upgraded some packages on my Debian system. Surprisingly applications using Gnome libraries stopped to open URIs using applications defined in GConf &lt;em&gt;/desktop/gnome/url-handlers&lt;/em&gt;. So I've checked if &lt;em&gt;gnome-open&lt;/em&gt; is able to open a URI:&lt;pre&gt;&lt;br /&gt;$ gnome-open http://wodny.org&lt;br /&gt;Error showing url: No application is registered as handling this file&lt;br /&gt;&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;The short (picture) version of the text below is &lt;a href="http://wodny.org/img/linux-map/gvfs-handleuri.svg"&gt;available&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;This was interesting. I realized that gnome-open first downloaded headers from the specified URI and then searched for a helper application according to the found Content-Type.&lt;/p&gt;&lt;p&gt;At first I was surprised that some Gnome libs do secret work behind my back.&lt;/p&gt;&lt;p&gt;The ability to download something in the background comes from backends installed. The HTTP one came from the &lt;em&gt;gvfs-backends&lt;/em&gt; package.&lt;/p&gt;&lt;p&gt;So I was dealing with the &lt;a href="http://library.gnome.org/misc/release-notes/2.22/#sect:gvfs-gio"&gt;GVfs&lt;/a&gt; "a userspace virtual file system with backends for protocols like SFTP, FTP, DAV, SMB, ObexFTP. GVFS is the replacement for GNOME-VFS". Specifically I was also dealing with its part - &lt;em&gt;GIO&lt;/em&gt; "a new shared library that is part of GLib and provides the API for GVFS".&lt;/p&gt;&lt;p&gt;So I read some API documentation. This was quite fun. GIO can take a URI from me and provide a magic File interface to it. I looked through some source code. I like the magical special function called g_app_info_launch_default_for_uri. It first searches for a handler for the scheme used (for example http) and if it doesn't find one - it determines the content type using a backend. For the HTTP backend a HEAD request is sent and the Content-Type header is used. Then it searches for a handler for that content type.&lt;/p&gt;&lt;p&gt;I've also used Python to do some debug.&lt;pre&gt;&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; import gio&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; gio.app_info_get_default_for_uri_scheme("http")&lt;br /&gt;&lt;/pre&gt;The call returned nothing, while it should have returned something like this:&lt;pre&gt;&lt;br /&gt;&amp;lt;gio.unix.DesktopAppInfo at 0xb76972d4: iceweasel&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;So for some reason GConf /desktop/gnome/url-handlers settings were not taken into account and instead of ending the search on the scheme handler it continued through the content type phase (as I didn't define a handler for text/html - it has failed).&lt;/p&gt;&lt;p&gt;During the upgrade there was a lot of packages being installed. One of them was libfm. It comes with a module called libgiofm.so, which resides in /usr/lib/gio/modules. This module provides a GIO extension and registers an implementation of the &lt;em&gt;G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME (gio-desktop-app-info-lookup)&lt;/em&gt; &lt;a href="http://library.gnome.org/devel/gio/stable/extending-gio.html"&gt;extension point&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Looking through &lt;em&gt;/usr/lib/gio/modules/giomodule.cache&lt;/em&gt; I noticed that &lt;em&gt;libgiofm.so&lt;/em&gt; isn't the only one providing this extension. There was also the libgiogconf.so module (from the gvfs package). And libgiogconf.so was here earlier as it's the Gnome's module for reading GConf settings.&lt;/p&gt;&lt;p&gt;When an extension registers itself it also sets its &lt;em&gt;priority&lt;/em&gt;. The Gnome module registers itself with priority value of 10. The libfm one registers itself with priority value of 9 if it detects a Gnome session via the &lt;em&gt;GNOME_DESKTOP_SESSION_ID&lt;/em&gt; environmental variable or 90 if it doesn't.&lt;/p&gt;&lt;p&gt;As I'm using &lt;em&gt;Openbox&lt;/em&gt;, the module doesn't detect the variable. With priority 90 it takes precedence over the Gnome module. I didn't define scheme handlers for the libfm (for example using libfm-pref-apps) so GIO didn't know what to do with URIs.&lt;/p&gt;&lt;p&gt;For now I'm going to use a workaround. I will set the GNOME_DESKTOP_SESSION_ID environmental variable. But There are two problems with that:&lt;ol&gt;&lt;li&gt;I don't have Gnome, but neither do I have LXDE - I just use some applications from both under Openbox&lt;/li&gt;&lt;li&gt;I could set this variable for example in .bashrc, but:&lt;ol&gt;&lt;li&gt;I can't really find any documentation on this variable&lt;/li&gt;&lt;li&gt;I've found a comment, where someone suggests it's &lt;a href="http://blog.torh.net/2009/07/30/adobe-air-open-urls-in-default-browser/"&gt;deprecated&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;&lt;p&gt;I could define applications through libfm-pref-apps, but it has less options than GConf, I have a problem with launching mutt with mailto: URIs and I don't want to duplicate settings.&lt;/p&gt;&lt;p&gt;I've sent the libfm developers a request to change that behaviour and allow to change the priority for example via XDG system/user's settings.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9055909554789113715-7703918144140535902?l=penguincopter.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://penguincopter.blogspot.com/feeds/7703918144140535902/comments/default' title='Komentarze do posta'/><link rel='replies' type='text/html' href='http://penguincopter.blogspot.com/2010/06/libfm-gio-absence-of-gnome-priority-of.html#comment-form' title='Komentarze (0)'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9055909554789113715/posts/default/7703918144140535902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9055909554789113715/posts/default/7703918144140535902'/><link rel='alternate' type='text/html' href='http://penguincopter.blogspot.com/2010/06/libfm-gio-absence-of-gnome-priority-of.html' title='libfm, GIO, absence of Gnome, priority of the extension module'/><author><name>wodny</name><uri>http://www.blogger.com/profile/07353475234651120146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9055909554789113715.post-5316921978209741338</id><published>2009-07-27T10:24:00.001-07:00</published><updated>2009-07-27T13:24:15.142-07:00</updated><title type='text'>Linux, Bluetooth, mobile, Internet</title><content type='html'>&lt;h2&gt;There is something about Bluetooth&lt;/h2&gt; &lt;p&gt; Last week I've decided to go wireless and connect to the Internet with &lt;a href="http://eeepc.asus.com/global/product1000-spec.html"&gt;my netbook&lt;/a&gt; via a cellphone without using a USB cable. &lt;/p&gt;  &lt;p&gt; Connecting to the Internet with a USB cable is quite simple - a glimpse at /var/log/syslog is enough. Usually &lt;code&gt;/dev/ttyACM0&lt;/code&gt; appears. What you have to do then is to just use &lt;a href="http://packages.debian.org/lenny/ppp"&gt;pppd&lt;/a&gt;.   It's similar when using Bluetooth, but getting to the moment when a device analogous to  &lt;code&gt;ttyACM0&lt;/code&gt; appears (usually &lt;code&gt;/dev/rfcomm0&lt;/code&gt;) may be difficult.&lt;br /&gt;&lt;/p&gt;  &lt;p&gt; This article presents how to achieve the goal using command line tools. It's quite probable that it's possible to get a similar effect using &lt;a href="http://blueman-project.org/"&gt;blueman&lt;/a&gt; or &lt;a href="http://live.gnome.org/GnomeBluetooth"&gt;gnome-bluetooth&lt;/a&gt;. It's a pity these tools have so many bugs. What's also important I would like to know what really happens. I hope I won't have to use them, as I don't use &lt;a href="http://projects.gnome.org/NetworkManager/"&gt;NetworkManager&lt;/a&gt; (popular in distributions like &lt;a href="http://www.ubuntu.com/"&gt;Ubuntu&lt;/a&gt;). Being in charge in exchange for convenience. &lt;/p&gt;  &lt;h2&gt;Ingredients (nontechnical version)&lt;/h2&gt; &lt;ul&gt;&lt;li&gt;A computer with a Bluetooth interface (Asus Eee PC 1000 has one built-in)&lt;/li&gt;&lt;li&gt;A cell phone with Bluetooth (in my case Nokia E66)&lt;/li&gt;&lt;li&gt;Enabled Internet service to use with your SIM card (I suppose it's a standard nowadays)&lt;/li&gt;&lt;/ul&gt;   &lt;h2&gt;My experimental platform&lt;/h2&gt; &lt;p&gt; Bluetooth module in my EeePC: &lt;/p&gt;&lt;pre&gt;$ lsusb&lt;br /&gt;ASUSTek Computer, Inc. Broadcom Bluetooth 2.1&lt;br /&gt; idVendor           0x0b05 ASUSTek Computer, Inc.&lt;br /&gt; idProduct          0xb700 Broadcom Bluetooth 2.1&lt;br /&gt;&lt;/pre&gt;   &lt;p&gt; My cell phone Bluetooth module features: &lt;/p&gt;&lt;pre&gt;# hcitool info &amp;lt;bd_addr&amp;gt;&lt;br /&gt;Requesting information ...&lt;br /&gt; BD Address:  &amp;lt;bd_addr&amp;gt;&lt;br /&gt; Device Name: Topik&lt;br /&gt; LMP Version: 2.0 (0x3) LMP Subversion: 0x2222&lt;br /&gt; Manufacturer: Broadcom Corporation (15)&lt;br /&gt; Features: 0xbf 0xee 0x0f 0x4e 0x98 0x19 0x00 0x00&lt;br /&gt;   &amp;lt;3-slot&amp;gt; &amp;lt;5-slot&amp;gt; &amp;lt;encryption&amp;gt; &amp;lt;slot&amp;gt;&lt;br /&gt;   &amp;lt;timing&amp;gt; &amp;lt;role&amp;gt; &amp;lt;sniff&amp;gt; &amp;lt;rssi&amp;gt;&lt;br /&gt;   &amp;lt;channel&amp;gt; &amp;lt;sco&amp;gt; &amp;lt;hv3&amp;gt; &amp;lt;u-law&amp;gt;&lt;br /&gt;   &amp;lt;a-law&amp;gt; &amp;lt;cvsd&amp;gt; &amp;lt;paging&amp;gt; &amp;lt;power&amp;gt;&lt;br /&gt;   &amp;lt;transparent&amp;gt; &amp;lt;edr&amp;gt; &amp;lt;edr&amp;gt;&lt;br /&gt;   &amp;lt;enhanced&amp;gt; &amp;lt;inquiry&amp;gt; &amp;lt;afh&amp;gt;&lt;br /&gt;   &amp;lt;afh&amp;gt; &amp;lt;3-slot&amp;gt; &amp;lt;5-slot&amp;gt;&lt;br /&gt;   &amp;lt;afh&amp;gt; &amp;lt;afh&amp;gt;&lt;br /&gt;&lt;/pre&gt;   &lt;p&gt; Debian and its packages: &lt;/p&gt;&lt;pre&gt;ii  bluez  4.42-2         Bluetooth tools and daemons&lt;br /&gt;ii  ppp    2.4.4rel-10.1  Point-to-Point Protocol (PPP) - daemon&lt;br /&gt;&lt;/pre&gt; Optional: &lt;pre&gt;ii  bluez-hcidump  1.42-1+b1     Analyses Bluetooth HCI packets&lt;br /&gt;&lt;/pre&gt;    &lt;h2&gt;Environment check&lt;/h2&gt; &lt;p&gt; Check if the kernel loaded any Bluetooth modules: &lt;/p&gt;&lt;pre&gt;$ lsmod | grep bt&lt;br /&gt;btusb                  10276  2&lt;br /&gt;bluetooth              47060  9 bnep,sco,rfcomm,l2cap,btusb&lt;br /&gt;usbcore               125888  9 btusb,usbhid,snd_usb_audio,snd_usb_lib,uvcvideo,usb_storage,uhci_hcd,ehci_hcd&lt;br /&gt;&lt;/pre&gt;   &lt;p&gt; During this experiment it's useful to keep &lt;a href="http://packages.debian.org/lenny/bluez-hcidump"&gt;hcidump&lt;/a&gt; running. It may help in debugging process or at least provide handful of information on sent packets. &lt;/p&gt;  &lt;p&gt; For the beginning &lt;code&gt;hciconfig&lt;/code&gt;: &lt;/p&gt;&lt;pre&gt;$ /usr/sbin/hciconfig&lt;br /&gt;hci0:   Type: USB&lt;br /&gt; BD Address: 00:15:AF:F8:EA:75 ACL MTU: 1021:8 SCO MTU: 64:1&lt;br /&gt; UP RUNNING PSCAN&lt;br /&gt; RX bytes:56525 acl:734 sco:0 events:1053 errors:0&lt;br /&gt; TX bytes:21903 acl:752 sco:0 commands:335 errors:0&lt;br /&gt;&lt;/pre&gt; We can see our local PC Bluetooth interface.&lt;/p&gt;&lt;br /&gt;&lt;p&gt; Now, let's search for mobile devices in proximity (it's a good moment to turn Bluetooth on in the cell phone): &lt;/p&gt;&lt;pre&gt;$ hcitool scan&lt;br /&gt;Scanning ...&lt;br /&gt; &amp;lt;bd_addr&amp;gt;     Topik&lt;br /&gt;&lt;/pre&gt; We can see our mobile. We get the information about its &lt;a href="http://www.bluetooth.com/Bluetooth/Technology/Glossary/"&gt;BD_ADDR (Bluetooth Device Address)&lt;/a&gt; which is &lt;a href="http://standards.ieee.org/faqs/OUI.html#q16"&gt;a cousin &lt;/a&gt; of the Ethernet &lt;a href="http://curreedy.com/stu/nic/"&gt;MAC addresses&lt;/a&gt;.   &lt;p&gt; Now using the SDP protocol (special protocol for service discovery) we will know what we can do with our cell. &lt;/p&gt;&lt;pre&gt;$ sdptool browse &amp;lt;the BD_ADDR from the previous section&amp;gt;&lt;br /&gt;[...]&lt;br /&gt;Service Name: Dial-Up Networking&lt;br /&gt;Service RecHandle: 0x1004c&lt;br /&gt;Service Class ID List:&lt;br /&gt; "Dialup Networking" (0x1103)&lt;br /&gt;Protocol Descriptor List:&lt;br /&gt; "L2CAP" (0x0100)&lt;br /&gt; "RFCOMM" (0x0003)&lt;br /&gt;   Channel: 4&lt;br /&gt;Language Base Attr List:&lt;br /&gt; code_ISO639: 0x454e&lt;br /&gt; encoding:    0x6a&lt;br /&gt; base_offset: 0x100&lt;br /&gt;Profile Descriptor List:&lt;br /&gt; "Dialup Networking" (0x1103)&lt;br /&gt;   Version: 0x0100&lt;br /&gt;[...]&lt;br /&gt;&lt;/pre&gt; You can see we can establish an Internet connection via the mobile. By the way, please notice which channel &lt;a href="http://en.wikipedia.org/wiki/Bluetooth_profile#Dial-up_Networking_Profile_.28DUN.29"&gt;Dial-Up Networking (DUN)&lt;/a&gt; service and profile uses (Channel: 4).   &lt;p&gt; It's convenient to create a script which is going to detect the right channel before every connection. Services' channels may change after turning the phone off and on again. The  &lt;code&gt;getDUNchannel.sh&lt;/code&gt; script: &lt;/p&gt;&lt;pre style="border: 1px solid black; padding: 5px;"&gt;#!/bin/sh&lt;br /&gt;&lt;br /&gt;MAC=$1&lt;br /&gt;&lt;br /&gt;if [ "$1" ]; then&lt;br /&gt; MAC="--bdaddr $MAC"&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;sdptool search $MAC DUN | grep Channel: | grep -o '[0-9]*'&lt;br /&gt;&lt;/pre&gt;    &lt;h2&gt;Preparing for the connection&lt;/h2&gt; &lt;p&gt; Firstly, we are going to configure an element which we are going to use last - pppd. This is a configuration for the PlusGSM network, for other networks it's similar or even the same - you can always ask your operator for assistance.&lt;br /&gt;&lt;/p&gt;&lt;h3&gt;pppd&lt;/h3&gt; &lt;p&gt; &lt;code&gt;/etc/ppp/peers/plus:&lt;/code&gt; &lt;/p&gt;&lt;pre style="border: 1px solid black; padding: 5px;"&gt;connect "/usr/sbin/chat -v -f /etc/chatscripts/plus"&lt;br /&gt;debug&lt;br /&gt;/dev/rfcomm0&lt;br /&gt;115200&lt;br /&gt;defaultroute&lt;br /&gt;noipdefault&lt;br /&gt;usepeerdns&lt;br /&gt;noauth&lt;br /&gt;&lt;/pre&gt;   &lt;p&gt; &lt;code&gt;/etc/chatscripts/plus:&lt;/code&gt; &lt;/p&gt;&lt;pre style="border: 1px solid black; padding: 5px;"&gt;ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE' ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED&lt;br /&gt;'' ATZ&lt;br /&gt;OK-AT-OK AT+CGDCONT=1,"IP","internet"&lt;br /&gt;OK-AT-OK "ATDT*99#"&lt;br /&gt;CONNECT ''&lt;br /&gt;&lt;/pre&gt;   &lt;h3&gt;bluetooth-agent&lt;/h3&gt; &lt;p&gt; During devices pairing a PIN code (chosen by the user) is needed. It's going to be entered on both devices. Tools from the &lt;code&gt;bluez&lt;/code&gt; package have their agent called &lt;code&gt;bluetooth-agent&lt;/code&gt;. They request a PIN code from it if they need one. &lt;/p&gt;  &lt;h3&gt;rfcomm&lt;/h3&gt; &lt;p&gt; Application is called rfcomm, same as the &lt;a href="http://bluetooth.com/Bluetooth/Technology/Works/DUN.htm"&gt;protocol stack&lt;/a&gt; &lt;a href="http://en.wikipedia.org/wiki/Bluetooth_protocols#RFCOMM_.28Radio_Frequency_Communication.29"&gt;layer&lt;/a&gt;  which it provides. This is a layer that emulates a RS-232 port in Bluetooth devices. Thanks to that feature we can communicate with the mobile as we would with a modem.&lt;/p&gt;  &lt;p&gt; Rfcomm can read configuration from &lt;code&gt;/etc/bluetooth/rfcomm.conf&lt;/code&gt;, but I can't find any advantages of this solution. Channel for the DUN service is going to change, so we want it to be easy to provide during execution. That is why we're going to pass all the arguments via the command line. &lt;/p&gt;  &lt;h2&gt;Starting sequence&lt;/h2&gt; In a couple of terminals execute in sequence:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;     During the first connection (pairing process) &lt;code&gt;rfcomm&lt;/code&gt; will need a PIN agent.&lt;br /&gt;&lt;pre style="border: 1px solid black; padding: 5px;"&gt;bluetooth-agent &amp;lt;wybrany PIN&amp;gt;&lt;br /&gt;&lt;/pre&gt;     It will print PIN requests on the screen. This tool won't be needed during subsequent connections, because a key is going to be generated (based on BD_ADDR, PIN and a random part), which both devices will remember.   &lt;/li&gt;&lt;li&gt; &lt;pre style="border: 1px solid black; padding: 5px;"&gt;$ rfcomm connect 0 &amp;lt;bd_addr&amp;gt; `./getDUNchannel.sh &amp;lt;bd_addr&amp;gt;`&lt;br /&gt;&lt;/pre&gt;     We should get an emulated RS-232 port &lt;code&gt;/dev/rfcomm0&lt;/code&gt;.&lt;/li&gt; Upon success we should see: &lt;pre style="border: 1px solid black; padding: 5px;"&gt;Connected /dev/rfcomm0 to &amp;lt;bd_addr&amp;gt; on channel 4&lt;br /&gt;Press CTRL-C for hangup&lt;br /&gt;&lt;/pre&gt;&lt;li&gt; &lt;pre style="border: 1px solid black; padding: 5px;"&gt;pppd file /etc/ppp/peers/plus&lt;br /&gt;&lt;/pre&gt;     Via &lt;code&gt;tail -f /var/log/syslog&lt;/code&gt; we can watch what's happening.   &lt;/li&gt;&lt;/ol&gt;  And that's it.   &lt;h2&gt;Literature&lt;/h2&gt; Literature is a big word but I've used these sites: &lt;ul&gt;&lt;li&gt;&lt;a href="http://bluetooth.com/"&gt;bluetooth.com&lt;/a&gt;&lt;/li&gt;&lt;li&gt;   Similar &lt;a href="http://rvshiro.wordpress.com/2009/01/26/n10jc-bluetooth-i-net-connection-using-nokia-e66-under-ubuntu-810/"&gt;article&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Another similar &lt;a href="http://jeremythompson.uklinux.net/RH9-0/Bluez.html"&gt;article&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Bluetooth &lt;a href="http://www.gentoo.org/doc/en/bluetooth-guide.xml"&gt;guide&lt;/a&gt; by Gentoo&lt;/li&gt;&lt;li&gt;A good information source - &lt;a href="http://en.wikipedia.org/wiki/Bluetooth_protocols"&gt;Wikipedii&lt;/a&gt; &lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9055909554789113715-5316921978209741338?l=penguincopter.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://penguincopter.blogspot.com/feeds/5316921978209741338/comments/default' title='Komentarze do posta'/><link rel='replies' type='text/html' href='http://penguincopter.blogspot.com/2009/07/linux-bluetooth-komorka-internet.html#comment-form' title='Komentarze (0)'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9055909554789113715/posts/default/5316921978209741338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9055909554789113715/posts/default/5316921978209741338'/><link rel='alternate' type='text/html' href='http://penguincopter.blogspot.com/2009/07/linux-bluetooth-komorka-internet.html' title='Linux, Bluetooth, mobile, Internet'/><author><name>wodny</name><uri>http://www.blogger.com/profile/07353475234651120146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9055909554789113715.post-6178399084833359300</id><published>2009-07-26T16:00:00.000-07:00</published><updated>2009-07-26T16:57:42.336-07:00</updated><title type='text'>PulseAudio, the beginning</title><content type='html'>&lt;h2&gt;Sound on my Linux&lt;/h2&gt;&lt;br /&gt;I thought it would be useful to gather all the information that let me configure my system in quite a neat way at one place. This includes Firefox Flash plugin using &lt;a href="http://pulseaudio.org/"&gt;PulseAudio&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;What PulseAudio is&lt;/h2&gt;&lt;br /&gt;&lt;a href="http://pulseaudio.org/"&gt;PulseAudio&lt;/a&gt; is a sound server. It's not the first such a project. But this the first one I really use and it doesn't grind my gears (too much).&lt;br /&gt;It's an entity consisting of libraries (and optionally a daemon), which allows you to manage sound streams on a higher abstraction level than the physical device level. It enables software mixing, sound card switching during playback, additional software amplification of the volume.&lt;br /&gt;Additionally PulseAudio is network transparent.&lt;br /&gt;It is a standard package in the Ubuntu distribution.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Why I need PulseAudio&lt;/h2&gt;&lt;br /&gt;In the nearest future I'm going to examine network features of this system, but the real reason of the installation was different. For a couple of years now I've been using two sound cards connected to my notebook. Usually sound comes into my head through headphones connected to the external SB Live!. The first problem with this sound card is that streams mixing has never worked - so I couldn't listen to YouTube and mplayer at the same time. The second problem - I want to hear Stepmania through the integrated sound card, YouTube on both, mplayer on the external one. ALSA by itself isn't so flexible. And we have Flash which is impossible to configure in a sensible way - it uses the default card.&lt;br /&gt;And last but not least: the buggy &lt;span style="font-style:italic;"&gt;asoundconf&lt;/span&gt; tool, which by the way is going to &lt;a href="http://packages.debian.org/changelogs/pool/main/a/alsa-utils/alsa-utils_1.0.19-2/changelog#versionversion1.0.19-1"&gt;disappear&lt;/a&gt; soon (see the Appendix 1.).&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Base configuration&lt;/h2&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;GNU/Linux Debian&lt;/span&gt;. &lt;span style="font-style:italic;"&gt;Lenny&lt;/span&gt;, with a scent of &lt;span style="font-style:italic;"&gt;testing&lt;/span&gt; and &lt;span style="font-style:italic;"&gt;unstable&lt;/span&gt; (&lt;span style="font-style:italic;"&gt;Squeez&lt;/span&gt; and current &lt;span style="font-style:italic;"&gt;Sid&lt;/span&gt;).&lt;br /&gt;ALSA is the low level sound system here.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Packages You will need&lt;/h2&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;ii  libasound2-plugins  1.0.19-2  ALSA library additional plugins&lt;br /&gt;ii  pulseaudio          0.9.15-2  PulseAudio sound server&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Packages making PulseAudio cool&lt;/h2&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;ii  padevchooser  0.9.3-2  PulseAudio Device Chooser&lt;br /&gt;ii  pavucontrol   0.9.8-1  PulseAudio Volume Control&lt;br /&gt;ii  paprefs       0.9.8-1  PulseAudio Preferences&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;These tools will give you GUI control over PulseAudio.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;To really feel the advantages of PulseAudio&lt;/h2&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;ii  flashplugin-nonfree  1:2.6  Adobe Flash Player - browser plugin&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;This package currently downloads (Firefox about:config):&lt;br /&gt;&lt;code&gt;&lt;br /&gt;Shockwave Flash&lt;br /&gt;    File name: libflashplayer.so&lt;br /&gt;    Shockwave Flash 10.0 r22&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Dependencies&lt;/h2&gt;&lt;br /&gt;Dependencies are going to be fulfilled by some kind of &lt;span style="font-style:italic;"&gt;apt&lt;/span&gt;. Personally I use &lt;a href="http://packages.debian.org/lenny/aptitude"&gt;aptitude&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Details on packages selection&lt;/h2&gt;&lt;br /&gt;You have to omit the installation of &lt;span style="font-style:italic;"&gt;flashplugin-nonfree-extrasound&lt;/span&gt; and &lt;span style="font-style:italic;"&gt;pulseaudio-esound-compat&lt;/span&gt;. They are redundant in this configuration. This is because Adobe Flash Player 10 &lt;a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=477266#35"&gt;uses ALSA&lt;/a&gt; by default, so another emulation layer is not needed.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;How it works&lt;/h2&gt;&lt;br /&gt;As far as I understand this, it works like that...&lt;br /&gt;1) Firefox Flash Plugin sends sounds to ALSA&lt;br /&gt;2) ALSA reads the configuration file (.asoundrc) in my home directory, which orders it to use an ALSA plugin (libasound2-plugins) which sends the sound to PulseAudio&lt;br /&gt;3) PulseAudio gets to physical devices back through an ALSA sink&lt;br /&gt;4) Let there be sound&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;The configuration file&lt;/h2&gt;&lt;br /&gt;From Arch Linux &lt;a href="http://wiki.archlinux.org/index.php/PulseAudio#Configuration_of_the_ALSA_PulseAudio_plugin"&gt;wiki&lt;/a&gt; a recipe for the .asoundconf file in the home directory:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;pcm.pulse {&lt;br /&gt;    type pulse&lt;br /&gt;}&lt;br /&gt;ctl.pulse {&lt;br /&gt;    type pulse&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;pcm.!default {&lt;br /&gt;    type pulse&lt;br /&gt;}&lt;br /&gt;ctl.!default {&lt;br /&gt;    type pulse&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Testing&lt;/h2&gt;&lt;br /&gt;By default PulseAudio doesn't act as a daemon (as the configuration file states - it's better this way). It's run per (graphical) session.&lt;br /&gt;&lt;br /&gt;Let's assure PulseAudio is running (probably this step is redundant as the first use of PulseAudio will launch it):&lt;br /&gt;&lt;code&gt;&lt;br /&gt;pgrep pulseaudio&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;or&lt;br /&gt;&lt;code&gt;&lt;br /&gt;ps axu | grep pulseaudio&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;If we get a line containing &lt;span style="font-style:italic;"&gt;pulseaudio&lt;/span&gt; - it's working.&lt;br /&gt;&lt;br /&gt;If we didn't get that kind of line, we can force the PulseAudio launch by executing:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;padevchooser &amp;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;We should see an icon appear in the notification area. PulseAudio has started. You can click on the icon and then on the "Manager..." menu option to see the details.&lt;br /&gt;&lt;br /&gt;Before starting to panic because there is no sound, we should check if ALSA understood what it shoud do. Execute:&lt;br /&gt;&lt;code&gt;aplay -v /usr/share/sounds/alsa/Noise.wav&lt;/code&gt;&lt;br /&gt;we should see a line like this:&lt;br /&gt;&lt;code&gt;ALSA &lt;-&gt; PulseAudio PCM I/O Plugin&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Final cuts&lt;/h2&gt;&lt;br /&gt;Let's assure that every time our Desktop shows up &lt;span style="font-style:italic;"&gt;padevchooser&lt;/span&gt; starts as well. You will manage to do the rest using the PulseAudio Volume Control (&lt;span style="font-style:italic;"&gt;pavucontrol&lt;/span&gt;).&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Appendix 1: asoundconf fades out&lt;/h2&gt;&lt;br /&gt;As the &lt;span style="font-style:italic;"&gt;alsa-utils&lt;/span&gt; package changelog states:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;alsa-utils (1.0.19-1) unstable; urgency=low&lt;br /&gt;&lt;br /&gt;  This upload removes alsaconf and asoundconf, two scripts which&lt;br /&gt;  could be used to modify certain ALSA parametres, as they caused&lt;br /&gt;  more problems than provided solutions, were outdated and generally&lt;br /&gt;  unuseful.&lt;br /&gt;&lt;br /&gt;  alsaconf was upstream's way to detect sound cards and generate&lt;br /&gt;  system-wide ALSA configurations. However, this should have been&lt;br /&gt;  unnecessary for a very long time, with the introduction of udev&lt;br /&gt;  support and its automatic hardware detection. If this isn't the&lt;br /&gt;  case for you, it's a bug which should be filed and fixed properly.&lt;br /&gt;&lt;br /&gt;  asoundconf was a tool introduced by Ubuntu which could be used to&lt;br /&gt;  generate asoundrc files for systems with special needs. The script&lt;br /&gt;  was not being maintained and was getting buggy, and the Debian and&lt;br /&gt;  Ubuntu teams have agreed to get rid of it for the next release. Users&lt;br /&gt;  can use Pulse or similar technologies to configure their preferred&lt;br /&gt;  sound devices and sinks.&lt;br /&gt;&lt;br /&gt; -- Jordi Mallach &lt;jordi@debian.org&gt;  Sat, 28 Mar 2009 12:53:02 +0100&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9055909554789113715-6178399084833359300?l=penguincopter.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://penguincopter.blogspot.com/feeds/6178399084833359300/comments/default' title='Komentarze do posta'/><link rel='replies' type='text/html' href='http://penguincopter.blogspot.com/2009/07/pulseaudio-beginning.html#comment-form' title='Komentarze (1)'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9055909554789113715/posts/default/6178399084833359300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9055909554789113715/posts/default/6178399084833359300'/><link rel='alternate' type='text/html' href='http://penguincopter.blogspot.com/2009/07/pulseaudio-beginning.html' title='PulseAudio, the beginning'/><author><name>wodny</name><uri>http://www.blogger.com/profile/07353475234651120146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
