<?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-6940314892895671240</id><updated>2011-11-28T02:06:15.494+01:00</updated><title type='text'>kiilerix</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://kiilerix.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6940314892895671240/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://kiilerix.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>kiilerix</name><uri>http://www.blogger.com/profile/09403356121428495041</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-6940314892895671240.post-98165386617974348</id><published>2009-05-28T13:50:00.002+02:00</published><updated>2009-05-28T14:00:25.528+02:00</updated><title type='text'>Rewriting Windows connection</title><content type='html'>Windows' routing and firewall tools doesn't seem as powerful as I'm used to on Linux.&lt;br /&gt;&lt;br /&gt;So to redirect an outgoing connection headed for 1.2.3.4 I add a custom route on the Windows machine, routing to a Fedora Linux machine 192.168.0.117:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;route add 1.2.3.4 mask 255.255.255.255 192.168.0.117&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;On the linux machine I edit /etc/sysctl.conf&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;net.ipv4.ip_forward = 0&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;and run&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;sysctl -e -p /etc/sysctl.conf&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;In /etc/sysconfig/iptables I add&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;*nat&lt;br /&gt;-A PREROUTING -p tcp -m tcp -d 1.2.3.4 -j DNAT --to-destination 192.168.1.7&lt;br /&gt;-A POSTROUTING -p tcp -m tcp -d 192.168.1.7 -j SNAT --to-source 192.168.0.117&lt;br /&gt;COMMIT&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;and restart iptables.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6940314892895671240-98165386617974348?l=kiilerix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kiilerix.blogspot.com/feeds/98165386617974348/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6940314892895671240&amp;postID=98165386617974348' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6940314892895671240/posts/default/98165386617974348'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6940314892895671240/posts/default/98165386617974348'/><link rel='alternate' type='text/html' href='http://kiilerix.blogspot.com/2009/05/rewriting-windows-connection.html' title='Rewriting Windows connection'/><author><name>kiilerix</name><uri>http://www.blogger.com/profile/09403356121428495041</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><entry><id>tag:blogger.com,1999:blog-6940314892895671240.post-2894320351218762438</id><published>2009-03-29T20:51:00.002+02:00</published><updated>2009-03-29T20:57:49.729+02:00</updated><title type='text'>Using the SUN java plugin in Firefox under Fedora</title><content type='html'>For some stupid reason the danish tax self-service doesn't work with openjdk. So I &lt;span style="font-style: italic;"&gt;had&lt;/span&gt; to install the Sun version. I took the time to do it properly with alternatives:&lt;br /&gt;&lt;br /&gt;Install Suns java:&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;rpm -ihv jre-6u12-linux-i586.rpm&lt;/blockquote&gt;Register it as a high priority alternative for &lt;span style="font-family: courier new;"&gt;libjavaplugin.so&lt;/span&gt;:&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;alternatives --install /usr/lib/mozilla/plugins /libjavaplugin.so libjavaplugin.so /usr/java/jre1.6.0_12 /plugin/i386/ns7/libjavaplugin_oji.so 20000&lt;/blockquote&gt;And select which alternative to use:&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;alternatives --config libjavaplugin.so&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6940314892895671240-2894320351218762438?l=kiilerix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kiilerix.blogspot.com/feeds/2894320351218762438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6940314892895671240&amp;postID=2894320351218762438' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6940314892895671240/posts/default/2894320351218762438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6940314892895671240/posts/default/2894320351218762438'/><link rel='alternate' type='text/html' href='http://kiilerix.blogspot.com/2009/03/using-sun-java-plugin-in-firefox-under.html' title='Using the SUN java plugin in Firefox under Fedora'/><author><name>kiilerix</name><uri>http://www.blogger.com/profile/09403356121428495041</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-6940314892895671240.post-8445262795662810099</id><published>2008-10-12T13:36:00.005+02:00</published><updated>2008-10-12T15:00:17.673+02:00</updated><title type='text'>Mirroring a Plone site</title><content type='html'>I needed an offline backup copy of a Plone 2.5 site. Something like what&lt;br /&gt;&lt;blockquote&gt;wget -m http://site/&lt;/blockquote&gt;does for simple static sites. But wget doesn't work well with plone sites; too many search results and alternative URLs are mirrored, and the folderish behaviour of content makes the mirror break.&lt;br /&gt;&lt;br /&gt;Googles best advice was &lt;a href="http://www.redcor.ch/web/intranet_zope_plone/tutorial/faq/UsingWgetToCreateOfflinePloneSite"&gt;this&lt;/a&gt;, but it didn't work for me. I hope google will find this page next time I search...&lt;br /&gt;&lt;br /&gt;I ended up with the following which gave me a usable mirror:&lt;br /&gt;&lt;blockquote&gt;wget -o wget.log --html-extension --restrict-file-names=windows --convert-links --recursive --level=inf --page-requisites --wait=0 --quota=inf --reject="*_form, *@*, sitemap, RSS" --exclude-directories="search, author" http://site/&lt;/blockquote&gt;Notes:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;web servers can let any URL be of any type, but in the file system html-extension tells what is html and what isn't&lt;br /&gt;&lt;/li&gt;&lt;li&gt;restrict-file-names to the windows subset make it work as many places as possible&lt;br /&gt;&lt;/li&gt;&lt;li&gt;convert-links fixes links that was broken by the changes above, and it also solves that usual file systems can't do what plone can do with both foo.png and foo.png/view&lt;/li&gt;&lt;li&gt;recursion without limits puts a high load on Plone, so be careful&lt;/li&gt;&lt;li&gt;all forms and special views, sitemaps and RSS feeds are left out - they will point to the original URL&lt;/li&gt;&lt;li&gt;searches and author overviews are left out too&lt;/li&gt;&lt;li&gt;the mirror ends up in the folder site/&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;By the way, the fuzzy logic of zip confuses me each time, so for the reference I package the mirror with:&lt;br /&gt;&lt;blockquote&gt;zip -r mirrir-site.zip site/&lt;/blockquote&gt;&lt;br /&gt;One more thing... Raw content objects (for example unscaled images) can be retrieved with WebDAV. On Linux I found that it easiest to use FUSE and wdfs:&lt;br /&gt;&lt;blockquote&gt;wdfs -f http://site:1980/folder /mnt/point&lt;/blockquote&gt;It can be unmounted manually with:&lt;br /&gt;&lt;blockquote&gt;fusermount -u /mnt/point&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6940314892895671240-8445262795662810099?l=kiilerix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kiilerix.blogspot.com/feeds/8445262795662810099/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6940314892895671240&amp;postID=8445262795662810099' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6940314892895671240/posts/default/8445262795662810099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6940314892895671240/posts/default/8445262795662810099'/><link rel='alternate' type='text/html' href='http://kiilerix.blogspot.com/2008/10/mirroring-plone-site.html' title='Mirroring a Plone site'/><author><name>kiilerix</name><uri>http://www.blogger.com/profile/09403356121428495041</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6940314892895671240.post-1739718693887758639</id><published>2008-08-31T23:22:00.004+02:00</published><updated>2008-08-31T23:50:00.248+02:00</updated><title type='text'>Scripting the inbox</title><content type='html'>For some reason I wanted to do some mass-managing of my inbox. If it had been in the file system I would have created a shell script - or used Python. But my mail reader focus on being user friendly for normal users, not on scripting for power users. A wise decision; they can't cover all use cases and preferences for language of chocie etc.&lt;br /&gt;&lt;br /&gt;With Python as my favorite tool imaplib seemed like the obvious choice. imaplib is however not that intuitive to use - unless you know http://tools.ietf.org/html/rfc3501 by heart...&lt;br /&gt;&lt;br /&gt;Making it work was a bit too hard, so here comes the script I came up with - it can easily be customized for other tasks:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;import imaplib&lt;br /&gt;M = imaplib.IMAP4()&lt;br /&gt;print 'logging in:', M.login('username', 'password')&lt;br /&gt;print 'selecting folder:', M.select('HomeInbox')&lt;br /&gt;_type, data = M.search(None, 'ALL') &lt;br /&gt;# or to search for string in field: (None, 'Subject', 'Re:')&lt;br /&gt;message_ids = set()&lt;br /&gt;for num in data[0].split():&lt;br /&gt;    # fetch seems quite obscure - fetching one field at a time to make it "simpler"&lt;br /&gt;    date = M.fetch(num, '(BODY[HEADER.FIELDS (DATE)])')[1][0][1].strip()&lt;br /&gt;    subject = M.fetch(num, '(BODY[HEADER.FIELDS (SUBJECT)])')[1][0][1].strip()&lt;br /&gt;    message_id = M.fetch(num, '(BODY[HEADER.FIELDS (Message-ID)])')[1][0][1].strip()&lt;br /&gt;    if message_id in message_ids:&lt;br /&gt;        print 'deleting', (num, date, subject, message_id)&lt;br /&gt;        #M.store(num, '+FLAGS', '\\Deleted') # uncomment to delete&lt;br /&gt;    else:&lt;br /&gt;        message_ids.add(message_id)&lt;br /&gt;M.expunge()&lt;br /&gt;M.close()&lt;br /&gt;M.logout()&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This script as it is removes all doublets based on message id.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6940314892895671240-1739718693887758639?l=kiilerix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kiilerix.blogspot.com/feeds/1739718693887758639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6940314892895671240&amp;postID=1739718693887758639' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6940314892895671240/posts/default/1739718693887758639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6940314892895671240/posts/default/1739718693887758639'/><link rel='alternate' type='text/html' href='http://kiilerix.blogspot.com/2008/08/scripting-inbox.html' title='Scripting the inbox'/><author><name>kiilerix</name><uri>http://www.blogger.com/profile/09403356121428495041</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><entry><id>tag:blogger.com,1999:blog-6940314892895671240.post-8614198073236903174</id><published>2008-03-29T02:06:00.003+01:00</published><updated>2008-03-29T02:14:43.735+01:00</updated><title type='text'>Quick'n'dirty temporary configuration of internet gateway</title><content type='html'>Scenario: One Fedora 8 host with wireless internet access, and I want to give another Fedora 8 host internet access through cabling to it.&lt;br /&gt;&lt;br /&gt;First connect the cables - and be aware that NetworkManager might start playing tricks when it detects link on the wired interfaces.&lt;br /&gt;&lt;br /&gt;On the host with internet access find a free IP range and configure the network interface:&lt;br /&gt;&lt;blockquote&gt;ifconfig eth0 10.0.0.1 up&lt;/blockquote&gt;Enable IP forwarding:&lt;br /&gt;&lt;blockquote&gt;sysctl net.ipv4.ip_forward=1&lt;/blockquote&gt;But masquerade it:&lt;br /&gt;&lt;blockquote&gt;iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -j MASQUERADE&lt;/blockquote&gt;&lt;br /&gt;On the other host configure the network interface:&lt;br /&gt;&lt;blockquote&gt;ifconfig eth0 10.0.0.2 up&lt;/blockquote&gt;Set default gateway:&lt;br /&gt;&lt;blockquote&gt;route add default gw 10.0.0.1&lt;/blockquote&gt;Configure DNS with settings from the other host:&lt;br /&gt;&lt;blockquote&gt;echo "nameserver 192.168.2.1" &gt; /&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;etc&lt;/span&gt;/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;resolv.conf&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;THAT&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;was&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;dirty&lt;/span&gt;!&lt;br /&gt;&lt;br /&gt;I &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;always&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;forget&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;the&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;masquerading&lt;/span&gt; part and have &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;difficulties&lt;/span&gt; finding it - &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;now&lt;/span&gt; I &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;know&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;where&lt;/span&gt; to find it ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6940314892895671240-8614198073236903174?l=kiilerix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kiilerix.blogspot.com/feeds/8614198073236903174/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6940314892895671240&amp;postID=8614198073236903174' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6940314892895671240/posts/default/8614198073236903174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6940314892895671240/posts/default/8614198073236903174'/><link rel='alternate' type='text/html' href='http://kiilerix.blogspot.com/2008/03/quickndirty-temporary-configuration-of.html' title='Quick&apos;n&apos;dirty temporary configuration of internet gateway'/><author><name>kiilerix</name><uri>http://www.blogger.com/profile/09403356121428495041</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></feed>
