<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.1" -->
<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/"
	>

<channel>
	<title>Inorp</title>
	<link>http://www.inorp.com/blog</link>
	<description>Anything the techworld can offer</description>
	<pubDate>Mon, 18 Jun 2007 20:28:43 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.1</generator>
	<language>en</language>
			<item>
		<title>Repair e39 Light module. BTS426L1 alternative component for the BMW E39 LCM (Light module)..</title>
		<link>http://www.inorp.com/blog/2007/06/18/repair-e39-light-module-bts426l1-alternative-component-for-the-bmw-e39-lcm-light-module/</link>
		<comments>http://www.inorp.com/blog/2007/06/18/repair-e39-light-module-bts426l1-alternative-component-for-the-bmw-e39-lcm-light-module/#comments</comments>
		<pubDate>Mon, 18 Jun 2007 20:11:06 +0000</pubDate>
		<dc:creator>ltz</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.inorp.com/blog/2007/06/18/repair-e39-light-module-bts426l1-alternative-component-for-the-bmw-e39-lcm-light-module/</guid>
		<description><![CDATA[So it happened on my e39 as well..  The right headlight just would not shut off. Even if the car was turned off and locked, the right headlight was still on. It&#8217;s an well known problem, but it seems the components are getting harder and harder to get ahold off. The first replacement component, [...]]]></description>
			<content:encoded><![CDATA[<p>So it happened on my e39 as well..  The right headlight just would not shut off. Even if the car was turned off and locked, the right headlight was still on. It&#8217;s an well known problem, but it seems the components are getting harder and harder to get ahold off. The first replacement component, BTS 426 L1 (<a href="http://uk.farnell.com/jsp/Semiconductors/Transistors/INFINEON/BTS426L1./displayProduct.jsp?sku=548686">Farnell is out..</a>) The suggested alternative components were&#8217;nt availiable to swedish non-company customers (VN21 availiable from <a href="http://www.st.com">ST</a>. <a href="http://www.st.com/stonline/stappl/productcatalog/app?path=/comp/stcom/PcStComRPNTableView.onClickFromPartNumber&#038;code=65605&#038;subclassid=1037&#038;subclassheader=High%20Side%20Switches"> VN21</a>). Instead, the only component I could get ahold of was the <a href="http://uk.farnell.com/jsp/Semiconductors/Transistors/INFINEON/BTS426L1/displayProduct.jsp?sku=1214292">BTS426L1 surface mounted (see product image)</a>. This component was not supposed to be mounted this way, but mine have been used this way some 600 km&#8217;s now and seems to be working. </p>
<p>Have a look at the images from the operation.<br />
<a href='http://www.inorp.com/blog/wp-content/uploads/2007/06/img_0272.jpg' title='img_0272.jpg'><img src='http://www.inorp.com/blog/wp-content/uploads/2007/06/img_0272.thumbnail.jpg' alt='img_0272.jpg' /></a><br />
<br/><br />
<a href='http://www.inorp.com/blog/wp-content/uploads/2007/06/img_0274.jpg' title='img_0274.jpg'><img src='http://www.inorp.com/blog/wp-content/uploads/2007/06/img_0274.thumbnail.jpg' alt='img_0274.jpg' /></a><br />
<br/><br />
<a href='http://www.inorp.com/blog/wp-content/uploads/2007/06/img_0275.jpg' title='img_0275.jpg'><img src='http://www.inorp.com/blog/wp-content/uploads/2007/06/img_0275.thumbnail.jpg' alt='img_0275.jpg' /></a><br />
<br/></p>
<p><a href='http://www.inorp.com/blog/wp-content/uploads/2007/06/img_0283.jpg' title='img_0283.jpg'><img src='http://www.inorp.com/blog/wp-content/uploads/2007/06/img_0283.thumbnail.jpg' alt='img_0283.jpg' /></a><br />
<br/><br />
<a href='http://www.inorp.com/blog/wp-content/uploads/2007/06/img_0285.jpg' title='img_0285.jpg'><img src='http://www.inorp.com/blog/wp-content/uploads/2007/06/img_0285.thumbnail.jpg' alt='img_0285.jpg' /></a><br />
<br/><br />
<a href='http://www.inorp.com/blog/wp-content/uploads/2007/06/img_0289.jpg' title='img_0289.jpg'><img src='http://www.inorp.com/blog/wp-content/uploads/2007/06/img_0289.thumbnail.jpg' alt='img_0289.jpg' /></a><br />
<br/><br />
<a href='http://www.inorp.com/blog/wp-content/uploads/2007/06/img_0287.jpg' title='img_0287.jpg'><img src='http://www.inorp.com/blog/wp-content/uploads/2007/06/img_0287.thumbnail.jpg' alt='img_0287.jpg' /></a><br />
<br/><br />
<a href='http://www.inorp.com/blog/wp-content/uploads/2007/06/img_0288.jpg' title='img_0288.jpg'><img src='http://www.inorp.com/blog/wp-content/uploads/2007/06/img_0288.thumbnail.jpg' alt='img_0288.jpg' /></a><br />
<br/><br />
<a href='http://www.inorp.com/blog/wp-content/uploads/2007/06/img_0291.jpg' title='img_0291.jpg'><img src='http://www.inorp.com/blog/wp-content/uploads/2007/06/img_0291.thumbnail.jpg' alt='img_0291.jpg' /></a><br />
<br/><br />
<a href='http://www.inorp.com/blog/wp-content/uploads/2007/06/img_0277.jpg' title='img_0277.jpg'><img src='http://www.inorp.com/blog/wp-content/uploads/2007/06/img_0277.thumbnail.jpg' alt='img_0277.jpg' /></a><br />
<br/></p>
<p>Allright, the process should be visible on the pictures..<br />
<br/><br />
Update:</p>
<li> The soldering to the surface mounted component is secured with melting glue before pressed against the cooling element.
<li> The unit is from a bmw 525tsa -97 e39.
<li> I did try fixing the surface mounted component directly upon the old connectors, ending up destroying one surface mounted component..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.inorp.com/blog/2007/06/18/repair-e39-light-module-bts426l1-alternative-component-for-the-bmw-e39-lcm-light-module/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ubuntu guide to using HSDPA USB-modem Huawei E220 with the Tre network</title>
		<link>http://www.inorp.com/blog/2007/03/13/ubuntu-guide-to-using-hsdpa-usb-modem-huawei-e220-with-the-tre-network/</link>
		<comments>http://www.inorp.com/blog/2007/03/13/ubuntu-guide-to-using-hsdpa-usb-modem-huawei-e220-with-the-tre-network/#comments</comments>
		<pubDate>Tue, 13 Mar 2007 21:09:20 +0000</pubDate>
		<dc:creator>ltz</dc:creator>
		
		<category><![CDATA[*NIX]]></category>

		<category><![CDATA[Comp]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.inorp.com/blog/2007/03/13/ubuntu-guide-to-using-hsdpa-usb-modem-huawei-e220-with-the-tre-network/</guid>
		<description><![CDATA[Using the Huawei E220 under Linux is not supported by the 3G operator 3 (in Swedish: Tre ..). Here&#8217;s a guide how to get it working on Ubuntu. 
Your connection have a pin-code per default set. Its written on your larger sim-card adapter. In order to simplify alot, lets just remove this. Put the 3g [...]]]></description>
			<content:encoded><![CDATA[<p>Using the Huawei E220 under Linux is not supported by the 3G operator 3 (in Swedish: Tre ..). Here&#8217;s a guide how to get it working on Ubuntu. </p>
<p>Your connection have a pin-code per default set. Its written on your larger sim-card adapter. In order to simplify alot, lets just remove this. Put the 3g data simcard in your 3g-phone and remove the sim pin. Then put the card into the USB-modem. </p>
<p>If you start up your Ubuntu machine and plug in the USB-modem, it will show as a cd-rom drive (atleast my does). Also I&#8217;m getting a folder popping up as if it would be a storage device (it does seems to be a storage device for windows drivers..).</p>
<p> - First step, right click on the newly auto-created cd-rom icon on your desktop and choose eject. Close any windows using the device. </p>
<p> - Start a terminal. The commands below should be ran as root.<br />
<strong><br />
rmmod usb-storage<br />
rmmod usbserial</strong><br />
(the later might create an error.)</p>
<p><strong>lsusb</strong><br />
 - The last command shoul show the device connected similiar to:<br />
<code>Bus 001 Device 003: ID 12d1:1003<br />
</code></p>
<p>Run:<br />
<strong>modprobe usbserial vendor=0&#215;12d1 product=0&#215;1003</strong></p>
<p>Now, disconnect the Huawei E220 USB-modem and wait a few seconds before connecting it again.</p>
<p> - As soon as the device have stopped blinking green you should find three new USB-devices by running the command:<br />
<strong>ls -al /dev/ttyU*</strong></p>
<p>Now its time to setup the wvdial.conf file. This config works for me, given that the pin sim-code is removed it whould work right off for you aswell. That is if you have a swedish tre.se turbo3g or 3g data account. </p>
<p><code><br />
[Dialer Defaults]<br />
Init2 = ATZ<br />
Init3 = ATQ0 V1 E1 S0=0 &#038;C1 &#038;D2 +FCLASS=0<br />
Stupid Mode = 1<br />
Modem Type = Analog Modem<br />
ISDN = 0<br />
Phone = *99***1#<br />
Modem = /dev/ttyUSB0<br />
Username = user<br />
Dial Command = ATDT<br />
Password = pass<br />
Baud = 460800<br />
Init4 = AT+CGDCONT=1,"IP","data.tre.se"</p>
<p></code></p>
<p>You should now be able to run the command:<br />
<strong>wvdial</strong></p>
<p>And the log might look something like this:</p>
<p><code></p>
<p>******@pierre-laptop:/# wvdial<br />
--> WvDial: Internet dialer version 1.56<br />
--> Cannot get information for serial port.<br />
--> Initializing modem.<br />
--> Sending: ATZ<br />
ATZ<br />
OK<br />
--> Sending: ATZ<br />
ATZ<br />
OK<br />
--> Sending: ATQ0 V1 E1 S0=0 &#038;C1 &#038;D2 +FCLASS=0<br />
ATQ0 V1 E1 S0=0 &#038;C1 &#038;D2 +FCLASS=0<br />
OK<br />
--> Sending: AT+CGDCONT=1,"IP","data.tre.se"<br />
AT+CGDCONT=1,"IP","data.tre.se"<br />
OK<br />
--> Modem initialized.<br />
--> Sending: ATDT*99***1#<br />
--> Waiting for carrier.<br />
ATDT*99***1#<br />
CONNECT<br />
--> Carrier detected.  Starting PPP immediately.<br />
--> Starting pppd at Tue Mar 13 21:46:20 2007<br />
--> Pid of pppd: 4714<br />
--> Using interface ppp0<br />
--> local  IP address 10.147.106.11<br />
--> remote IP address 80.251.193.196<br />
--> primary   DNS address 80.251.192.244<br />
--> secondary DNS address 80.251.192.245<br />
--> Connect time 0.1 minutes.<br />
--> local  IP address 10.147.106.11<br />
--> remote IP address 80.251.193.196<br />
--> primary   DNS address 80.251.192.244<br />
--> secondary DNS address 80.251.192.245</p>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.inorp.com/blog/2007/03/13/ubuntu-guide-to-using-hsdpa-usb-modem-huawei-e220-with-the-tre-network/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Joomla template creation, Joom!Fish language detection.</title>
		<link>http://www.inorp.com/blog/2007/02/19/joomla-template-creation-joomfish-language-detection/</link>
		<comments>http://www.inorp.com/blog/2007/02/19/joomla-template-creation-joomfish-language-detection/#comments</comments>
		<pubDate>Mon, 19 Feb 2007 21:51:37 +0000</pubDate>
		<dc:creator>ltz</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Comp]]></category>

		<category><![CDATA[Joomla]]></category>

		<guid isPermaLink="false">http://www.inorp.com/blog/2007/02/19/joomla-template-creation-joomfish-language-detection/</guid>
		<description><![CDATA[Creating a Joomla template might be rather simple, when involving different languages on the text-level it all seems simple aswell. However when we want 100% of our website to change language when we swith languages, this requires a workaround. The Joom!fish component is very powerful, however you control 95% of the website content from Joom!fish, [...]]]></description>
			<content:encoded><![CDATA[<p>Creating a Joomla template might be rather simple, when involving different languages on the text-level it all seems simple aswell. However when we want 100% of our website to change language when we swith languages, this requires a workaround. The Joom!fish component is very powerful, however you control 95% of the website content from Joom!fish, the rest should be handled some other way. I find it easy to manipulate these parts from ithin the template, creating a few language files containing the rest of the phrases/imagesfiles/meta tags etc that you whish to translate. Some example code below. </p>
<p><strong>Retrieving the current language setting.</strong></p>
<p>Given that the Joom!Fish component is installed, the following code in your template index.php should do the trick.</p>
<p><code><br />
< ?php<br />
/**<br />
 * @author Pierre Norraeus<br />
 *<br />
 * Return the current language. This variable is controlled by<br />
 * the Joom!Fish Joomla component. Having this function should enable<br />
 * a potential change in the Joom!Fish functionality.<br />
 *<br />
 *<br />
 */<br />
function getCurrentLanguage()	{</p>
<p>	global $mosConfig_lang;</p>
<p>	return $mosConfig_lang;</p>
<p>}</p>
<p>/**<br />
 * @author Pierre Norraeus<br />
 *<br />
 * Detect the current language, for now only accept swedish, and if<br />
 * not swedish lets make english the default.<br />
 *<br />
 * @todo extend more languages..<br />
 *<br />
 */<br />
if (getCurrentLanguage() == "swedish") {</p>
<p>	include_once ('language_texts_se.php');</p>
<p>} else {</p>
<p>	include_once ('language_texts_en.php');</p>
<p>}</p>
<p>? ></p>
<p></code></p>
<p><strong>Example language file.</strong></p>
<p>The variablenames below should of course be according to your coding standard (aswell as the rest of this example..:) ).</p>
<p><code></p>
<p>< ?php<br />
/*<br />
 * @author Pierre Norraeus<br />
 * English language file.<br />
 *<br />
 */</p>
<p> define(main_userid, 'Username');<br />
 define(main_password, 'Password');</p>
<p>? ></p>
<p></code></p>
<p><strong>HTML examples.. </strong></p>
<p>Importing a language-based javascript file..<br />
<code><br />
..script language="JavaScript" type="text/javascript" src="< ?php echo $mosConfig_live_site;?>/templates/Templatename/js/menu_< ?php echo getCurrentLanguage();? >.js&#8221;></script...</p>
<p></code></p>
<p>Language specific image<br />
<code><br />
...img src="< ?php echo $mosConfig_live_site;? >/templates/templatename/images/buttons/search_< ?php echo getCurrentLanguage();? >.gif&#8221; alt=&#8221;" /&#8230;</p>
<p></code></p>
<p>The rest should be handled by the <a href="http://forge.joomla.org/sf/sfmain/do/viewProject/projects.joomfish/">Joom!Fish</a> component, very smooth.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.inorp.com/blog/2007/02/19/joomla-template-creation-joomfish-language-detection/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ZD1211 Wireless LAN installation upon Ubuntu</title>
		<link>http://www.inorp.com/blog/2007/01/31/zd1211-wireless-lan-installation-upon-ubuntu/</link>
		<comments>http://www.inorp.com/blog/2007/01/31/zd1211-wireless-lan-installation-upon-ubuntu/#comments</comments>
		<pubDate>Wed, 31 Jan 2007 11:45:14 +0000</pubDate>
		<dc:creator>ltz</dc:creator>
		
		<category><![CDATA[*NIX]]></category>

		<category><![CDATA[Comp]]></category>

		<guid isPermaLink="false">http://www.inorp.com/blog/2007/01/31/zd1211-wireless-lan-installation-upon-ubuntu/</guid>
		<description><![CDATA[Seems like the wireless area in ubuntu lacks some usable guides. I am trying to configure a standard, very cheap piece of USB Wireless stick of the brand Sweex (model: LC100040. based upon the Zydas 1211 chipset) on an old laptop COMPAQ armada M700 series. Found som standard drivers in the ubuntu universe repository and [...]]]></description>
			<content:encoded><![CDATA[<p class="entry">Seems like the wireless area in ubuntu lacks some usable guides. I am trying to configure a standard, very cheap piece of USB Wireless stick of the brand Sweex (model: LC100040. based upon the Zydas 1211 chipset) on an old laptop COMPAQ armada M700 series. Found som standard drivers in the ubuntu universe repository and even thou I can find some networks with this driver, I cannot connect to any of them. Not even my own wlan-router, which worked fine in windows. Next step is trying out a zd1211 guide I found at an ubuntu forum (<a href="http://ubuntuforums.org/search.php?searchid=13179730" target="_blank" title="Howto Zydas 1211 with Ubuntu EDGY">Howto Zydas 1211 with Ubuntu EDGY</a>). Will get back to the result of this one..</p>
<p><em><strong>Several “Invalid” messages when entering lwconfig</strong></em><br />
<code>eth1 802.11g zd1211 ESSID:"test" Mode:Ad-Hoc Frequency:2.472 GHz Cell: Invalid Bit Rate=1 Mb/s Encryption key:off Link Quality=93/100 Signal level=93/100 Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0 </code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.inorp.com/blog/2007/01/31/zd1211-wireless-lan-installation-upon-ubuntu/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ubuntu PHP5, MySQL, Apache2 installation order..</title>
		<link>http://www.inorp.com/blog/2007/01/22/ubuntu-php5-mysql-apache2-installation-order/</link>
		<comments>http://www.inorp.com/blog/2007/01/22/ubuntu-php5-mysql-apache2-installation-order/#comments</comments>
		<pubDate>Mon, 22 Jan 2007 11:44:12 +0000</pubDate>
		<dc:creator>ltz</dc:creator>
		
		<category><![CDATA[*NIX]]></category>

		<category><![CDATA[Comp]]></category>

		<guid isPermaLink="false">http://www.inorp.com/blog/2007/01/22/ubuntu-php5-mysql-apache2-installation-order/</guid>
		<description><![CDATA[Installing the Ubuntu Server distribution and perhaps only using the php5-cli module (= php interpreted at the command line..) together with MySQL works fine. However if you want apache2 installed later on, the installation might result in an errormessage not very unlike:

Call to undefined function mysql_pconnect() …..
This is because of php not finding the mysql [...]]]></description>
			<content:encoded><![CDATA[<p class="entry">Installing the Ubuntu Server distribution and perhaps only using the php5-cli module (= php interpreted at the command line..) together with MySQL works fine. However if you want apache2 installed later on, the installation might result in an errormessage not very unlike:<em><br />
</em></p>
<p><em><strong>Call to undefined function mysql_pconnect()</strong> …..</em><br />
This is because of php not finding the mysql addon. The installation order in ubuntu messed ut the automatic configuration and the config file will not be able to find the correct <em>mysql.so</em> file. This is of course given that you have installed all the required modules correctly (php5, php5-mysql, apache2, mysql ….+ libs).</p>
<p>Try this for a solution..</p>
<p>Update the database..<strong><br />
sudo slocate -u   </strong></p>
<p>Find the mysql.so file.<strong><br />
locate mysql.so</strong><br />
Probably returns /usr/lib/php5/20051025/mysql.so, create and copy this file to a extensions directory to the php5.<br />
<strong> 			 				sudo mkdir /usr/lib/php5/ext<br />
sudo cp /usr/lib/php5/20051025/mysql.so /usr/lib/php5/ext/</strong><br />
Last, edit the php.ini file.<strong><br />
sudo pico /etc/php5/apache2/php.ini</strong><br />
Look for a mysql.so entry. (Search in pico by using ctrl+w). It should look like:<br />
<strong><em>extension = mysql.so </em></strong><br />
Save the php.ini file. (ctrl+x then enter y)<br />
Restart the apache2 webbserver:<br />
<strong>sudo apache2ctl restart</strong><br />
This should do it..</p>
<p>Edit:<br />
<a href="http://ubuntuforums.org/showthread.php?t=221818?" target="_blank">Link: ubuntu forum guide surrounding the same problem.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.inorp.com/blog/2007/01/22/ubuntu-php5-mysql-apache2-installation-order/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Simple XML parsing with CLI PHP, character encoding problems</title>
		<link>http://www.inorp.com/blog/2007/01/07/simple-xml-parsing-with-cli-php-character-encoding-problems/</link>
		<comments>http://www.inorp.com/blog/2007/01/07/simple-xml-parsing-with-cli-php-character-encoding-problems/#comments</comments>
		<pubDate>Sun, 07 Jan 2007 17:51:41 +0000</pubDate>
		<dc:creator>ltz</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.inorp.com/blog/2007/01/07/simple-xml-parsing-with-cli-php-character-encoding-problems/</guid>
		<description><![CDATA[When using PHP for creating html documents intended to be read by a web browser there&#8217;s the possibility to set character encoding within the html-heading, getting a extra way to handla the character presentation of the content. However when running PHP code through the CLI-PHP software for internal, server-side purposes handling data the character encoding [...]]]></description>
			<content:encoded><![CDATA[<p>When using PHP for creating html documents intended to be read by a web browser there&#8217;s the possibility to set character encoding within the html-heading, getting a extra way to handla the character presentation of the content. However when running PHP code through the CLI-PHP software for internal, server-side purposes handling data the character encoding might require a little bit more work. Reading XML-documents using the PHP &#8220;xml_parser&#8221; and at the same time trusting the character encoding given in the XML-document header as shown below might not be enough in order to make sure you get the correct character encoding.</p>
<p><code>...xml version="1.0" encoding="iso-8859-1" ...</code></p>
<p>Be sure to set the encoding within the creation of the XML-parser. </p>
<p><code><br />
$xml_parser = xml_parser_create();</p>
<p>xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, true);<br />
xml_parser_set_option($xml_parser, XML_OPTION_TARGET_ENCODING, "ISO-8859-1");</p>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.inorp.com/blog/2007/01/07/simple-xml-parsing-with-cli-php-character-encoding-problems/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP IMAP mail fetching including attachments..</title>
		<link>http://www.inorp.com/blog/2006/11/08/php-imap-mail-fetching-including-attachments/</link>
		<comments>http://www.inorp.com/blog/2006/11/08/php-imap-mail-fetching-including-attachments/#comments</comments>
		<pubDate>Wed, 08 Nov 2006 11:44:11 +0000</pubDate>
		<dc:creator>ltz</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.inorp.com/blog/2007/01/31/php-imap-mail-fetching-including-attachments/</guid>
		<description><![CDATA[Took me a while to figure out how to search and fetch a single attachment from a POP mailbox, without ending up with 300+ lines of code..   Maybe this one could help someone else..
// Open pop account.
$mailbox = imap_open( $popaddr, $popuser, $poppasswd);
// Search for the message we are looking for..
$result = imap_search($mailbox, $searchsubject, [...]]]></description>
			<content:encoded><![CDATA[<p>Took me a while to figure out how to search and fetch a single attachment from a POP mailbox, without ending up with 300+ lines of code..   Maybe this one could help someone else..</p>
<p class="php" style="border: 1px dashed #8cacbb; padding: 0.5em; overflow: auto; font-size: 100%; color: black; background-color: #f7f9fa"><span style="color: #808080; font-style: italic">// Open pop account.</span><br />
<span style="color: #0000ff">$mailbox</span> = imap_open<span style="color: #66cc66">(</span> <span style="color: #0000ff">$popaddr</span>, <span style="color: #0000ff">$popuser</span>, <span style="color: #0000ff">$poppasswd</span><span style="color: #66cc66">)</span>;</p>
<p><span style="color: #808080; font-style: italic">// Search for the message we are looking for..</span><br />
<span style="color: #0000ff">$result</span> = imap_search<span style="color: #66cc66">(</span><span style="color: #0000ff">$mailbox</span>, <span style="color: #0000ff">$searchsubject</span>, SE_UID<span style="color: #66cc66">)</span>;</p>
<p><span style="color: #b1b100">if</span> <span style="color: #66cc66">(</span><span style="color: #0000ff">$result</span><span style="color: #66cc66">)</span>  <span style="color: #66cc66">{</span></p>
<p>storePDFAttachment<span style="color: #66cc66">(</span>imap_fetchbody<span style="color: #66cc66">(</span><span style="color: #0000ff">$mailbox</span>,<span style="color: #0000ff">$result</span><span style="color: #66cc66">[</span><span style="color: #cc66cc">0</span><span style="color: #66cc66">]</span>,<span style="color: #cc66cc">2</span><span style="color: #66cc66">)</span>,<span style="color: #0000ff">$savefilename</span>,<span style="color: #0000ff">$savefilepath</span><span style="color: #66cc66">)</span>;</p>
<p><span style="color: #66cc66">}</span> <span style="color: #b1b100">else</span>  <span style="color: #66cc66">{</span></p>
<p><a href="http://www.php.net/exit"><span style="color: #000066">exit</span></a><span style="color: #66cc66">(</span><span style="color: #ff0000">&#8220;message not found in mailbox yet..&#8221;</span><span style="color: #66cc66">)</span>;</p>
<p><span style="color: #66cc66">}</span></p>
<p><span style="color: #808080; font-style: italic">// Close the connection.</span><br />
imap_close<span style="color: #66cc66">(</span><span style="color: #0000ff">$mailbox</span><span style="color: #66cc66">)</span>;</p>
<p><span style="color: #000000; font-weight: bold">function</span> storePDFAttachment<span style="color: #66cc66">(</span> <span style="color: #0000ff">$content</span> , <span style="color: #0000ff">$filename</span> , <span style="color: #0000ff">$localfilepath</span>  <span style="color: #66cc66">)</span>    <span style="color: #66cc66">{</span></p>
<p><span style="color: #0000ff">$file</span> = <a href="http://www.php.net/fopen"><span style="color: #000066">fopen</span></a><span style="color: #66cc66">(</span><span style="color: #0000ff">$localfilepath</span>.<span style="color: #0000ff">$filename</span>, <span style="color: #ff0000">&#8216;w&#8217;</span><span style="color: #66cc66">)</span>;<br />
<a href="http://www.php.net/fwrite"><span style="color: #000066">fwrite</span></a><span style="color: #66cc66">(</span><span style="color: #0000ff">$file</span>, imap_base64<span style="color: #66cc66">(</span><span style="color: #0000ff">$content</span><span style="color: #66cc66">)</span><span style="color: #66cc66">)</span>;</p>
<p><a href="http://www.php.net/fclose"><span style="color: #000066">fclose</span></a><span style="color: #66cc66">(</span><span style="color: #0000ff">$file</span><span style="color: #66cc66">)</span>;<br />
<span style="color: #66cc66">}</span></p>
<p><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.inorp.com/blog/2006/11/08/php-imap-mail-fetching-including-attachments/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Small scale servers and power consumtion.</title>
		<link>http://www.inorp.com/blog/2006/10/28/small-scale-servers-and-power-consumtion/</link>
		<comments>http://www.inorp.com/blog/2006/10/28/small-scale-servers-and-power-consumtion/#comments</comments>
		<pubDate>Sat, 28 Oct 2006 11:42:35 +0000</pubDate>
		<dc:creator>ltz</dc:creator>
		
		<category><![CDATA[Comp]]></category>

		<guid isPermaLink="false">http://www.inorp.com/blog/2006/10/28/small-scale-servers-and-power-consumtion/</guid>
		<description><![CDATA[Electricity costs is a big and growing issue within the IT world. The fact that larger server parks consume large amounts of electricity is given, however how often do you calculate how much electricity that server you got running somewhere in your house is actually consuming? Here’s my findings in this subject, having a small [...]]]></description>
			<content:encoded><![CDATA[<p class="entry">Electricity costs is a big and growing issue within the IT world. The fact that larger server parks consume large amounts of electricity is given, however how often do you calculate how much electricity that server you got running somewhere in your house is actually consuming? Here’s my findings in this subject, having a small server currently running barely any load. The question is if its worth even having it running at all.</p>
<p>According to <a href="http://windows.uwaterloo.ca/Hardware/PC_Power_Consumption.asp" target="_blank" title="University of Waterloo Power consumption">this article</a> from the University of Waterloo, a 40 watt fluorecent overhead lamp draws more power overnight then a modern PC running in safe mode. My guess is that this applies to a client computer and that it would be hard to have a server unit run in safe mode (given that there are some server-load).</p>
<p>An actual electricity measurment would be prefferable, but in my case I have no such tools, and I am willing to settle for an estimate on the consumtion of my servers.</p>
<p>Given the PSU-calculator on <a href="http://www.extreme.outervision.com/PSUEngine" title="http://www.extreme.outervision.com/PSUEngine">this site</a>, the old server computer should draw around 119w / hour. Which totals to around 85 Kw’s per month and around 1020 Kw’s per year.</p>
<p>No monitors, only the server hardware and perhaps some usb devices attached.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.inorp.com/blog/2006/10/28/small-scale-servers-and-power-consumtion/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Camera live motion detection recording with ubuntu linux..</title>
		<link>http://www.inorp.com/blog/2006/10/28/camera-live-motion-detection-recording-with-ubuntu-linux/</link>
		<comments>http://www.inorp.com/blog/2006/10/28/camera-live-motion-detection-recording-with-ubuntu-linux/#comments</comments>
		<pubDate>Sat, 28 Oct 2006 11:42:35 +0000</pubDate>
		<dc:creator>ltz</dc:creator>
		
		<category><![CDATA[*NIX]]></category>

		<category><![CDATA[Comp]]></category>

		<guid isPermaLink="false">http://www.inorp.com/blog/2007/01/31/camera-live-motion-detection-recording-with-ubuntu-linux/</guid>
		<description><![CDATA[This is rather old news, however since I found guides from people explaining how they have spend 10 hours to get this working, I just might have an ubuntu-related guide that does this faster..
Given my local dev-server (1000mhz, 400mb ram) running the latest ubuntu server installation together with my cheap usb1.1 webcam.
Since I’m using the [...]]]></description>
			<content:encoded><![CDATA[<p>This is rather old news, however since I found guides from people explaining how they have spend 10 hours to get this working, I just might have an ubuntu-related guide that does this faster..</p>
<p>Given my local dev-server (1000mhz, 400mb ram) running the latest ubuntu server installation together with my cheap usb1.1 webcam.</p>
<p>Since I’m using the server version, this is the text-based install guide.</p>
<ul>
<li>Given that you have ubuntu installed.</li>
<li>Make sure the /etc/apt/sources.list have both universe and backports enabled. (also run “apt-get update” after any change)</li>
<li>Run “apt-get -s install motion”   and have a quick lock so that any unwanted parts your system installation won’t be removed.</li>
<li>run “apt-get install motion”</li>
<li>run “apt-get install ffmpeg”  (add -s if you which to look over the changes..)</li>
<li>plug-in your usb-webcam.</li>
<li>run “dmesg” and check if the plug and play detection went ok. It should probably be in any of the later rows if you just recently plugged it in.</li>
<li>open /etc/motion/motion.conf   (for instance: “pico /etc/motion/motion.conf”)</li>
<li>change the settings of your choosing (also check the video-device link).. check the motion website for a good explanation of the settings.. <a href="http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome" title="Motion Linux command tool" target="_blank">http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome</a></li>
<li>after completing the config, run “motion”..  Any errors will display.</li>
<li>Check the given directory for image/video-files. given that the camera install went fine.</li>
<li>Your installation is complete. Run motion in deamon mode next time (”motion -d”)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.inorp.com/blog/2006/10/28/camera-live-motion-detection-recording-with-ubuntu-linux/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Implementing updating stock chart</title>
		<link>http://www.inorp.com/blog/2006/10/28/implementing-updating-stock-chart/</link>
		<comments>http://www.inorp.com/blog/2006/10/28/implementing-updating-stock-chart/#comments</comments>
		<pubDate>Sat, 28 Oct 2006 11:37:41 +0000</pubDate>
		<dc:creator>ltz</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.inorp.com/blog/2006/10/28/implementing-updating-stock-chart/</guid>
		<description><![CDATA[Trying to update a html-page without having a) annoying refreshes of the entire page, b) a third party framework implementation (ie: Java/Flash/etc..). My experience is that a “third party” implementation more or less makes the best solution however there are alternatives. For instance a simple AJAX-based implementation of such a function would be possible. This [...]]]></description>
			<content:encoded><![CDATA[<p>Trying to update a html-page without having a) annoying refreshes of the entire page, b) a third party framework implementation (ie: Java/Flash/etc..). My experience is that a “third party” implementation more or less makes the best solution however there are alternatives. For instance a simple AJAX-based implementation of such a function would be possible. This also does have its drawbacks, but for now we could look at the possibilities.</p>
<p>Attached is one solution involving PHP and a standard OSI-certified AJAX-framework called Agent AJAX. Please note the drawbacks of this solution. If the client/server connection is poor, the transfers in AJAX might create problems for the Client. You can of course overcome this problem by simply thinking your solution through and for instance creating feedback to the user at any transaction that might fail.</p>
<p><textarea style="width: 380px; height: 200px"> &lt;?  /*  * Ajax based live updating stock chart example. Based upon the Ajax Agent framework.  * Author Pierre Norraeus  * 2006-02-21  */     // Generate the html-table. you can, ofcourse, do this any way you want.  function printPrices() {           $text = &#8220;&lt;/p&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;&lt;b&gt;Stock&lt;/td&gt; &lt;td&gt;&lt;b&gt;Market&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;b&gt;Open&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;b&gt;Close&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;b&gt;Updated&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;b&gt;Trade&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;AAA&lt;/td&gt; &lt;td&gt;A&lt;/td&gt; &lt;td&gt;10&lt;/td&gt; &lt;td&gt;13&lt;/td&gt; &lt;td&gt;“.date(”Y-m-d H:i:s”).”&lt;/td&gt; &lt;td&gt;&lt;a xhref=http://www.inorp.com/# onclick=\&#8221;call_trade(&#8217;1&#8242;)\&#8221; &gt;Trade&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;BBB&lt;/td&gt; &lt;td&gt;B&lt;/td&gt; &lt;td&gt;20&lt;/td&gt; &lt;td&gt;23&lt;/td&gt; &lt;td&gt;“.date(”Y-m-d H:i:s”).”&lt;/td&gt; &lt;td&gt;&lt;a xhref=http://www.inorp.com/# onclick=\&#8221;call_trade(&#8217;2&#8242;)\&#8221; &gt;Trade&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;CCC&lt;/td&gt; &lt;td&gt;C&lt;/td&gt; &lt;td&gt;30&lt;/td&gt; &lt;td&gt;33&lt;/td&gt; &lt;td&gt;“.date(”Y-m-d H:i:s”).”&lt;/td&gt; &lt;td&gt;&lt;a xhref=http://www.inorp.com/# onclick=\&#8221;call_trade(&#8217;3&#8242;)\&#8221; &gt;Trade&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;p&gt;\n”;    return $text;     }          function trade($pid) {      $text = “trade,”.$pid;     return $text;  }  // include the framework base..   include_once(”agent.php”);    // init the framework..   $agent-&gt;init();  ?&gt;  &lt;html&gt;  &lt;head&gt;   &lt;meta name=&#8221;generator&#8221; content=&#8221;pico&#8221;&gt; &lt;meta name=&#8221;author&#8221; content=&#8221;Norraeus&#8221;&gt; &lt;meta name=&#8221;keywords&#8221; content=&#8221;Ajax testsetup.&#8221;&gt; &lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=iso-8859-1&#8243;&gt;  &lt;/head&gt;&lt;br /&gt; &lt;script&gt;   function call_trade(str) {     agent.call(\&#8217;’,\&#8217;trade’,\&#8217;callback_trade’,str);   }    function callback_trade(str) {     document.getElementById(’divTrade’).innerHTML = str;   }    function call_printPrices() {      call_setLoading();     agent.call(\&#8217;’,\&#8217;printPrices’,\&#8217;callback_printPrices’);        //Update the table every.. 2 seconds?     setTimeout(’call_printPrices()’,2000);   }    function callback_printPrices(str) {      call_unsetLoading();     document.getElementById(’tablePrices’).innerHTML = str;   }     function call_setLoading() {     callback_printLoading(’Loading…’);   }   function call_unsetLoading() {     callback_printLoading(’ ‘);   }   function callback_printLoading(str) {     document.getElementById(’showLoading’).innerHTML = str;   }   function init()  {      call_printPrices();   }  &lt;/script&gt; &lt;p&gt;  &lt;body onload=&#8221;init()&#8221;&gt; &lt;center&gt; &lt;b&gt;Simple stock chart example..&lt;/b&gt;&lt;/p&gt; &lt;h4&gt;Current Stock Prices&lt;/h4&gt; &lt;p&gt;&lt;!&#8211; you can also have a button for updates.. &#8211;&gt; &lt;!&#8211; &lt;a xhref=http://www.inorp.com/# onclick=&#8221;call_printPrices()&#8221;&gt;&lt;b&gt;here&lt;/b&gt;&lt;/a&gt; to test.–&gt;&lt;/p&gt; &lt;div id=&#8217;tablePrices&#8217;&gt;&lt;/div&gt; &lt;div id=&#8217;divTrade&#8217;&gt;&lt;/div&gt; &lt;div id=&#8217;showLoading&#8217;&gt;&lt;/div&gt; &lt;p&gt;&lt;a xhref=&#8221;http://www.ajaxtechforums.com&#8221;  &gt;Ajax Tech Forums&lt;/a&gt; &lt;/center&gt;  &lt;/body&gt; &lt;/html&gt;   </textarea></p>
]]></content:encoded>
			<wfw:commentRss>http://www.inorp.com/blog/2006/10/28/implementing-updating-stock-chart/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
