<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DEEMRHc5eip7ImA9WhRRFE4.&quot;"><id>tag:blogger.com,1999:blog-4256146799450661176</id><updated>2011-11-28T01:31:25.922+02:00</updated><category term="Python" /><category term="xrandr" /><category term="Ubuntu" /><category term="N900" /><title>EMATD</title><subtitle type="html">Extending my ability to document</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://codingdocuments.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://codingdocuments.blogspot.com/" /><author><name>Pyry</name><uri>http://www.blogger.com/profile/15654395450574925916</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>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/ExtendingMyAbilityToDocument" /><feedburner:info uri="extendingmyabilitytodocument" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>ExtendingMyAbilityToDocument</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><entry gd:etag="W/&quot;CEcMRHY7cCp7ImA9WxBbFk0.&quot;"><id>tag:blogger.com,1999:blog-4256146799450661176.post-2593384553547956545</id><published>2010-03-14T22:47:00.004+02:00</published><updated>2010-03-14T23:28:05.808+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-14T23:28:05.808+02:00</app:edited><title>Authenticated smtp using postfix</title><content type="html">I was in a need of virtual email hosting platform, something simple I thought. MySQL for users, postfix for MTA, courier for imap, basic stuff. I have setup similar environment few times already. But the thing that has always bothered me is that I have always failed to configure SASL smtp properly. I have usually tried to fix it few times. But then after a while of going nowhere I have decided to quit. Today I decided once again that I need it, and this time I have even made some progress.&lt;br /&gt;&lt;br /&gt;First I somehow found that I need to enable smtps from master.cf:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;smtps     inet  n       -       n       -       -       smtpd&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Logically I then decided to add "smtpd_tls_wrappermode = yes" into main.cf. After this everything seemed working. I configured thunderbird to use ssl imap and SSL SMTP on port 465 and tried sending mail and fetching my (ahem old) emails. All was nice! I even decided to send an email to my client confirming that everything is now working and we can start creating accounts.&lt;br /&gt;&lt;br /&gt;After this I decided okay, let's test that &lt;u&gt;everything&lt;/u&gt; does really work. First receiving emails.. I logged in into my gmail and sent a test email. Of course it didn't come through..&lt;br /&gt;&lt;br /&gt;Log showed me this:&lt;br /&gt;&lt;pre&gt; &lt;br /&gt;Mar 14 21:33:07 [postfix/smtpd] sql_select option missing&lt;br /&gt;Mar 14 21:33:07 [postfix/smtpd] auxpropfunc error no mechanism available_&lt;br /&gt;Mar 14 21:33:07 [postfix/smtpd] initializing the server-side TLS engine&lt;br /&gt;Mar 14 21:33:07 [postfix/smtpd] connect from mail-ww0-f54.google.com[74.125.82.54]&lt;br /&gt;Mar 14 21:33:07 [postfix/smtpd] setting up TLS connection from mail-ww0-f54.google.com[74.125.82.54]&lt;br /&gt;Mar 14 21:33:07 [postfix/smtpd] mail-ww0-f54.google.com[74.125.82.54]: TLS cipher list "ALL:!EXPORT:!LOW:+RC4:@STRENGTH"&lt;br /&gt;Mar 14 21:33:07 [postfix/smtpd] SSL_accept:before/accept initialization&lt;br /&gt;Mar 14 21:33:07 [postfix/smtpd] read from 080C7C18 [080D2A48] (11 bytes =&gt; -1 (0xFFFFFFFF))&lt;br /&gt;Mar 14 21:36:15 [postfix/smtpd] SSL_accept error from mail-wy0-f173.google.com[74.125.82.173]: -1&lt;br /&gt;Mar 14 21:36:15 [postfix/smtpd] lost connection after CONNECT from mail-wy0-f173.google.com[74.125.82.173]&lt;br /&gt;Mar 14 21:36:15 [postfix/smtpd] disconnect from mail-wy0-f173.google.com[74.125.82.173]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I then fiddled with all the configurations, disabling stuff, modifying stuff, removing stuff, adding stuff. But alas once again it was evident that SASL had bitten me.. I googled and googled but I found nothing relevant. But then (from totally unrelated issue) someone suggested this: "openssl s_client -connect HOSTNAME:25 -starttls smtp" which then failed to connect. And the issue was clear at last. Postfix was serving ssl connections in port 25. Incoming mails were totally blocked. Of course now everything was easy...&lt;br /&gt;&lt;br /&gt;I removed this "smtpd_tls_wrappermode = yes" into main.cf and put it into master.cf like so&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;smtps     inet  n       -       n       -       -       smtpd -o smtpd_tls_wrappermode=yes&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And now it seems everything is working perfectly. Next time this should be easy(tm). Now just the last few modifications to the configuration (should not break anything) and I'm done!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4256146799450661176-2593384553547956545?l=codingdocuments.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ExtendingMyAbilityToDocument/~4/YGbF44ZAKuM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://codingdocuments.blogspot.com/feeds/2593384553547956545/comments/default" title="Lähetä kommentteja" /><link rel="replies" type="text/html" href="http://codingdocuments.blogspot.com/2010/03/authenticated-smtp-using-postfix.html#comment-form" title="0 kommenttia" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4256146799450661176/posts/default/2593384553547956545?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4256146799450661176/posts/default/2593384553547956545?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtendingMyAbilityToDocument/~3/YGbF44ZAKuM/authenticated-smtp-using-postfix.html" title="Authenticated smtp using postfix" /><author><name>Pyry</name><uri>http://www.blogger.com/profile/15654395450574925916</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><feedburner:origLink>http://codingdocuments.blogspot.com/2010/03/authenticated-smtp-using-postfix.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUQMRX45eyp7ImA9WxBRF04.&quot;"><id>tag:blogger.com,1999:blog-4256146799450661176.post-8615718657413280478</id><published>2010-01-06T01:08:00.004+02:00</published><updated>2010-01-06T01:16:24.023+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-06T01:16:24.023+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="N900" /><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu" /><title>Booting ubuntu on nokia n900</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_r0wCFR8vIjo/S0PHKIDuIeI/AAAAAAAAADA/SwliNbFW3sc/s1600-h/n900_ubuntu_status.jpg"&gt;&lt;img style="margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 203px;" src="http://4.bp.blogspot.com/_r0wCFR8vIjo/S0PHKIDuIeI/AAAAAAAAADA/SwliNbFW3sc/s320/n900_ubuntu_status.jpg" border="0" alt="Ubuntu booting on Nokia N900" id="BLOGGER_PHOTO_ID_5423397353059918306" /&gt;&lt;/a&gt;&lt;p&gt;Ubuntu booting for the first time on N900. Nothing works, can't login or anything.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4256146799450661176-8615718657413280478?l=codingdocuments.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ExtendingMyAbilityToDocument/~4/TURiz02nkKc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://codingdocuments.blogspot.com/feeds/8615718657413280478/comments/default" title="Lähetä kommentteja" /><link rel="replies" type="text/html" href="http://codingdocuments.blogspot.com/2010/01/booting-ubuntu-on-nokia-n900.html#comment-form" title="0 kommenttia" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4256146799450661176/posts/default/8615718657413280478?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4256146799450661176/posts/default/8615718657413280478?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtendingMyAbilityToDocument/~3/TURiz02nkKc/booting-ubuntu-on-nokia-n900.html" title="Booting ubuntu on nokia n900" /><author><name>Pyry</name><uri>http://www.blogger.com/profile/15654395450574925916</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><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_r0wCFR8vIjo/S0PHKIDuIeI/AAAAAAAAADA/SwliNbFW3sc/s72-c/n900_ubuntu_status.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://codingdocuments.blogspot.com/2010/01/booting-ubuntu-on-nokia-n900.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0MBSXo9fip7ImA9WxBXGU4.&quot;"><id>tag:blogger.com,1999:blog-4256146799450661176.post-6361842771399328551</id><published>2010-01-02T18:00:00.009+02:00</published><updated>2010-01-31T14:04:18.466+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-31T14:04:18.466+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="xrandr" /><category scheme="http://www.blogger.com/atom/ns#" term="N900" /><category scheme="http://www.blogger.com/atom/ns#" term="Python" /><title>Switching Nokia N900 into portrait mode</title><content type="html">Currently there is no xrandr software installed on the Maemo plattform. But xrandr library is there so all you need is a little bit of python to take advantage of it. This is slightly based on https://launchpad.net/python-xrandr . If your python software needs xrandr support on N900 I think that library might be handy.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Anyways this is the code I used:&lt;div&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;from ctypes import *&lt;br /&gt;import os&lt;br /&gt;import sys&lt;br /&gt;from pprint import pprint&lt;br /&gt;&lt;br /&gt;xlib = cdll.LoadLibrary("libX11.so.6")&lt;br /&gt;rr = cdll.LoadLibrary("libXrandr.so.2")&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;display = xlib.XOpenDisplay(os.getenv("DISPLAY"))&lt;br /&gt;screen = xlib.XDefaultScreen(display)&lt;br /&gt;root = xlib.XDefaultRootWindow(display, screen)&lt;br /&gt;&lt;br /&gt;class XRRScreenConfiguration(Structure):&lt;br /&gt;pass&lt;br /&gt;gsi = rr.XRRGetScreenInfo&lt;br /&gt;gsi.restype = POINTER(XRRScreenConfiguration)&lt;br /&gt;config = gsi(display, root)&lt;br /&gt;&lt;br /&gt;current_time = c_ulong()&lt;br /&gt;rr.XRRTimes.restpye = c_ulong&lt;br /&gt;timestamp = rr.XRRTimes(display, screen, byref(current_time))&lt;br /&gt;&lt;br /&gt;xccr = rr.XRRConfigCurrentRate&lt;br /&gt;xccr.restype = c_int&lt;br /&gt;rate = xccr(config)&lt;br /&gt;&lt;br /&gt;rotation = c_ushort()&lt;br /&gt;size = rr.XRRConfigCurrentConfiguration(config, byref(rotation))&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;rr.XRRSetScreenConfigAndRate(display,config,root,size,int(sys.argv[1]),rate,timestamp)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;So copy that into something like rotate.py and run it like this &lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;for portrait mode "python rotate.py 2"&lt;/li&gt;&lt;li&gt;for landscape mode "python rotate.py 1"&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Portrait mode support is currently lacking but it might have its uses. For example browser currently supports it quite nicely. In the end, I think my Nokia N900 will still be mostly in landscape orientation. Anyways this has been a nice learning experience about python, n900 and xrandr.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Updated daemon version&lt;/h3&gt;&lt;br /&gt;This will rotate the screen automatically&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;from ctypes import *&lt;br /&gt;import os&lt;br /&gt;import sys&lt;br /&gt;import time&lt;br /&gt;from math import atan2&lt;br /&gt;from pprint import pprint&lt;br /&gt;&lt;br /&gt;xlib = cdll.LoadLibrary("libX11.so.6")&lt;br /&gt;rr = cdll.LoadLibrary("libXrandr.so.2")&lt;br /&gt;&lt;br /&gt;def get_rotation():&lt;br /&gt;    f = open("/sys/class/i2c-adapter/i2c-3/3-001d/coord", 'r' )&lt;br /&gt;    coords = [int(w) for w in f.readline().split()]&lt;br /&gt;    f.close()&lt;br /&gt;    return coords&lt;br /&gt;&lt;br /&gt;print get_rotation()&lt;br /&gt;&lt;br /&gt;def rotate(angle):&lt;br /&gt;    rr.XRRSetScreenConfigAndRate(display,config,root,size,angle,rate,timestamp)&lt;br /&gt;&lt;br /&gt;display = xlib.XOpenDisplay(os.getenv("DISPLAY"))&lt;br /&gt;screen = xlib.XDefaultScreen(display)&lt;br /&gt;root = xlib.XDefaultRootWindow(display, screen)&lt;br /&gt;&lt;br /&gt;class XRRScreenConfiguration(Structure):&lt;br /&gt;   pass&lt;br /&gt;&lt;br /&gt;gsi = rr.XRRGetScreenInfo&lt;br /&gt;gsi.restype = POINTER(XRRScreenConfiguration)&lt;br /&gt;config = gsi(display, root)&lt;br /&gt;&lt;br /&gt;current_time = c_ulong()&lt;br /&gt;rr.XRRTimes.restpye = c_ulong&lt;br /&gt;timestamp = rr.XRRTimes(display, screen, byref(current_time))&lt;br /&gt;&lt;br /&gt;xccr = rr.XRRConfigCurrentRate&lt;br /&gt;xccr.restype = c_int&lt;br /&gt;rate = xccr(config)&lt;br /&gt;&lt;br /&gt;rotation = c_ushort()&lt;br /&gt;size = rr.XRRConfigCurrentConfiguration(config, byref(rotation))&lt;br /&gt;&lt;br /&gt;while True:&lt;br /&gt;    [x,y,z] = get_rotation()&lt;br /&gt;    print x,y,z&lt;br /&gt;    if y &lt; -500:&lt;br /&gt;        rotate(1)&lt;br /&gt;    elif y &gt; 500:&lt;br /&gt;        rotate(4)&lt;br /&gt;&lt;br /&gt;    elif x &lt; -500:&lt;br /&gt;        rotate(2)&lt;br /&gt;    elif x &gt; 500:&lt;br /&gt;        rotate(8)&lt;br /&gt;&lt;br /&gt;    time.sleep(1)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This also has a bug that will reboot the phone in some situations. Probably related to software that will handle screen rotation also..&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4256146799450661176-6361842771399328551?l=codingdocuments.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ExtendingMyAbilityToDocument/~4/JW6SjJYoZ7M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://codingdocuments.blogspot.com/feeds/6361842771399328551/comments/default" title="Lähetä kommentteja" /><link rel="replies" type="text/html" href="http://codingdocuments.blogspot.com/2010/01/switching-nokia-n900-into-portrait-mode.html#comment-form" title="0 kommenttia" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4256146799450661176/posts/default/6361842771399328551?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4256146799450661176/posts/default/6361842771399328551?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtendingMyAbilityToDocument/~3/JW6SjJYoZ7M/switching-nokia-n900-into-portrait-mode.html" title="Switching Nokia N900 into portrait mode" /><author><name>Pyry</name><uri>http://www.blogger.com/profile/15654395450574925916</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><feedburner:origLink>http://codingdocuments.blogspot.com/2010/01/switching-nokia-n900-into-portrait-mode.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUQHQ3s9eip7ImA9WxBRFEk.&quot;"><id>tag:blogger.com,1999:blog-4256146799450661176.post-527186617157969971</id><published>2010-01-02T16:44:00.000+02:00</published><updated>2010-01-02T17:48:52.562+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-02T17:48:52.562+02:00</app:edited><title>Hello world!</title><content type="html">So after many many years, I have now bitten the bullet and started blogging. Reason for this is that I just want to get better with my written English. Another and maybe the main point is that I really need a place to publish my computer findings. One of the reasons for choosing blogger and not hosting my own was that I'm hoping that this will somehow affect search-engine visibility.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4256146799450661176-527186617157969971?l=codingdocuments.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ExtendingMyAbilityToDocument/~4/w7S-iNOhRqY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://codingdocuments.blogspot.com/feeds/527186617157969971/comments/default" title="Lähetä kommentteja" /><link rel="replies" type="text/html" href="http://codingdocuments.blogspot.com/2010/01/hi.html#comment-form" title="0 kommenttia" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4256146799450661176/posts/default/527186617157969971?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4256146799450661176/posts/default/527186617157969971?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ExtendingMyAbilityToDocument/~3/w7S-iNOhRqY/hi.html" title="Hello world!" /><author><name>Pyry</name><uri>http://www.blogger.com/profile/15654395450574925916</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><feedburner:origLink>http://codingdocuments.blogspot.com/2010/01/hi.html</feedburner:origLink></entry></feed>

