<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ejs</title>
	<atom:link href="http://ejs.seniejitrakai.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://ejs.seniejitrakai.net</link>
	<description>a snaphot of time</description>
	<lastBuildDate>Mon, 09 Jan 2012 22:10:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Using Revit Server 2012 by non-domain members</title>
		<link>http://ejs.seniejitrakai.net/2012/01/09/using-revit-server-2012-by-non-domain-members/</link>
		<comments>http://ejs.seniejitrakai.net/2012/01/09/using-revit-server-2012-by-non-domain-members/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 21:47:37 +0000</pubDate>
		<dc:creator>ejs</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[My job]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[AD]]></category>
		<category><![CDATA[credentials]]></category>
		<category><![CDATA[domain]]></category>
		<category><![CDATA[Revit]]></category>
		<category><![CDATA[Revit Server]]></category>

		<guid isPermaLink="false">http://ejs.seniejitrakai.net/?p=231</guid>
		<description><![CDATA[The last issue in the Migration Hell was Revit Server. To be precise, not the application itself, but the client authentification. With all it&#8217;s bells-n-whistles, it lacks most part of the documentation. The application itself runs on IIS, uses Windows (NTLM) or Basic authentification, but nothing is said about the Revit client. The only thing [...]]]></description>
			<content:encoded><![CDATA[<p>The last issue in the Migration Hell was Revit Server. To be precise, not the application itself, but the client authentification.<br />
With all it&#8217;s bells-n-whistles, it lacks most part of the documentation. The application itself runs on IIS, uses Windows (NTLM) or Basic authentification, but nothing is said about the Revit client. The only thing you can find &#8211; you must login as domain member to use the Revit Server.</p>
<p>It&#8217;s not true. You should, but must not.</p>
<p>Two things must be done on the client to use Revit Server:</p>
<ol>
<li><em>authenticate in the domain and <strong>every server</strong></em> you will need to use. You must use your domain login credentials to authentificate. The AD domain uses trust relations to authentificate you in the domain servers. If you prefer not to login to AD domain, you must take care of it by yourself</li>
<li>change environment variables.
<ul>
<li>%USERDOMAIN% point to the current domain,  if logged as domain member. If not, it&#8217;s pointing to the computer name. Setting the variable to the domain name needed (eg. SET USERDOMAIN=MYCOMPANY) will do the job. You should not use DNS domain name, eg. MyCompany.COM, it&#8217;s set in %USERDNSDOMAIN% and is useless in the case of Revit Server</li>
<li> %USERNAME% must be set to your AD&#8217;s username, without AD prefix or FQDN suffix. Eg. if your AD domain login is mycompany.com\PerfectUser or PerfectUser@Mycompany.COM, use &#8220;SET USERNAME=PerfectUser&#8221;.</li>
</ul>
</li>
</ol>
<p>That&#8217;s all. Enjoy.</p>
<p>PS: if you use Local Revit Server, and Central Server is located somewere in the Other Domain, you will probably need to authentificate to the Central Revit Server too. Not sure about this.</p>
]]></content:encoded>
			<wfw:commentRss>http://ejs.seniejitrakai.net/2012/01/09/using-revit-server-2012-by-non-domain-members/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>pull</title>
		<link>http://ejs.seniejitrakai.net/2011/12/12/pull/</link>
		<comments>http://ejs.seniejitrakai.net/2011/12/12/pull/#comments</comments>
		<pubDate>Sun, 11 Dec 2011 23:35:53 +0000</pubDate>
		<dc:creator>ejs</dc:creator>
				<category><![CDATA[*NIX]]></category>
		<category><![CDATA[My job]]></category>
		<category><![CDATA[key]]></category>
		<category><![CDATA[OpenVPN]]></category>
		<category><![CDATA[remote]]></category>
		<category><![CDATA[route]]></category>
		<category><![CDATA[routing]]></category>
		<category><![CDATA[tunnel]]></category>
		<category><![CDATA[VPN]]></category>

		<guid isPermaLink="false">http://ejs.seniejitrakai.net/?p=221</guid>
		<description><![CDATA[is the only missing keyword, OpenVPN client-to-server config need to work correctly on the client. It took me 3 days to figure this out, a lot of RTFM&#8217;ing and head-banging. Full client config looks this way: tls-client pull remote vpn.xxx.xxx dev tun ifconfig 10.0.232.2 10.0.232.1 cert [full-path-to-client's-CRT-file] key [full-path-to-client's-KEY-file] ca [full-path-to-server's-CA-CRT-file] comp-lzo persist-key persist-tun Server [...]]]></description>
			<content:encoded><![CDATA[<p>is the only missing keyword, OpenVPN client-to-server config need to work correctly on the client.<br />
It took me 3 days to figure this out, a lot of RTFM&#8217;ing and head-banging.</p>
<p>Full client config looks this way:<br />
<script type="text/javascript"><!--
google_ad_client = "pub-5014333663142840";
google_ad_slot = "2728381536";
google_ad_width = 728;
google_ad_height = 90;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<br />
<span id="more-221"></span></p>
<blockquote><p>
tls-client<br />
pull<br />
remote vpn.xxx.xxx<br />
dev tun<br />
ifconfig 10.0.232.2 10.0.232.1<br />
cert [full-path-to-client's-CRT-file]<br />
key [full-path-to-client's-KEY-file]<br />
ca [full-path-to-server's-CA-CRT-file]<br />
comp-lzo<br />
persist-key<br />
persist-tun
</p>
</blockquote>
<p>Server config is similar:</p>
<blockquote><p>
port 1194<br />
proto udp<br />
dev tun<br />
ca ca.crt<br />
cert vpn-server.crt<br />
dh dh1024.pem<br />
server 10.0.232.0 255.255.255.0<br />
ifconfig-pool-persist ipp.txt<br />
push &#8220;route 192.168.232.0 255.255.255.0&#8243;<br />
client-config-dir ccd<br />
push &#8220;dhcp-option DNS 10.0.232.1&#8243;<br />
keepalive 10 120<br />
comp-lzo<br />
max-clients 10<br />
user nobody<br />
group daemon<br />
persist-key<br />
persist-tun<br />
status openvpn-status.log<br />
log-append  openvpn.log<br />
verb 3
</p>
</blockquote>
<p>there&#8217;s nothing and in ccd/client.</p>
<p>The worst thing was, i could find no solution for My-Link-Not-Working on the Internet:<br />
Both ends use &#8216;tun&#8217;, the subnets are set correctly, i could even see packets arrivint to the VPN end on port 1194.<br />
But no traffic on &#8216;tun0&#8242;, no ping, no connection. That was kind of strange. I was already to swith to &#8216;tap&#8217; adapter and proceed to bridging, but fortunatelly i&#8217;ve read what &#8216;pull&#8217; means in OpenVPN &#8211; &#8220;This option must be used on a client which is connecting to a multi-client server. It indicates to OpenVPN that it should accept options pushed by the server, provided they are part of the legal set of pushable options (note that the &#8211;pull option is implied by &#8211;client ).&#8221;</p>
<p>No idea why, but:<br />
 routes were correctly set on both ends;<br />
 the firewall was not an issue both on Linux and windows sides;<br />
 the magical &#8220;pull&#8221; made the work done.</p>
]]></content:encoded>
			<wfw:commentRss>http://ejs.seniejitrakai.net/2011/12/12/pull/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IPsec to Sonicwall appliance</title>
		<link>http://ejs.seniejitrakai.net/2011/12/06/ipsec-to-sonicwall-appliance/</link>
		<comments>http://ejs.seniejitrakai.net/2011/12/06/ipsec-to-sonicwall-appliance/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 21:54:37 +0000</pubDate>
		<dc:creator>ejs</dc:creator>
				<category><![CDATA[*NIX]]></category>
		<category><![CDATA[My job]]></category>
		<category><![CDATA[IPsec]]></category>
		<category><![CDATA[remote]]></category>
		<category><![CDATA[tunnel]]></category>
		<category><![CDATA[VPN]]></category>

		<guid isPermaLink="false">http://ejs.seniejitrakai.net/?p=222</guid>
		<description><![CDATA[Just a note: when you need to establish IPsec connection to Sonicwall NSA 3500 firewall, here&#8217;s working config: Linux side: /etc/ipsec.conf : &#8230; include /etc/ipsec.d/*.conf Not sure if &#8216;agressive mode&#8217; is A Good Idea, but it Just Works /etc/ipsec.d/partner.conf : conn partner type=tunnel left=$YOUR_PUBLIC_IP leftid=$YOUR_PUBLIC_IP leftsubnet=$YOUR_PRIVATE_SUBNET/WITH_MASK right=$PARTNER&#8217;S_PUBLIC_IP rightid=$PARTNER&#8217;S_PUBLIC_IP rightsubnet=$PARTHENR&#8217;S_PRIVATE_SUBNET/WITH_MASK rightnexthop=$PARTHENR&#8217;S_ROUTER_IP keyingtries=0 pfs=yes aggrmode=yes auto=add auth=esp [...]]]></description>
			<content:encoded><![CDATA[<p>Just a note:<br />
when you need to establish IPsec connection to Sonicwall NSA 3500 firewall, here&#8217;s working config:<br />
Linux side:<br />
/etc/ipsec.conf :</p>
<blockquote><p>
&#8230;<br />
include /etc/ipsec.d/*.conf
</p></blockquote>
<p><span id="more-222"></span><br />
<script type="text/javascript"><!--
google_ad_client = "pub-5014333663142840";
google_ad_slot = "8842048914";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<br />
Not sure if &#8216;agressive mode&#8217; is A Good Idea, but it Just Works<br />
/etc/ipsec.d/partner.conf :</p>
<blockquote><p>conn partner<br />
        type=tunnel<br />
        left=$YOUR_PUBLIC_IP<br />
        leftid=$YOUR_PUBLIC_IP<br />
        leftsubnet=$YOUR_PRIVATE_SUBNET/WITH_MASK<br />
        right=$PARTNER&#8217;S_PUBLIC_IP<br />
        rightid=$PARTNER&#8217;S_PUBLIC_IP<br />
        rightsubnet=$PARTHENR&#8217;S_PRIVATE_SUBNET/WITH_MASK<br />
        rightnexthop=$PARTHENR&#8217;S_ROUTER_IP<br />
        keyingtries=0<br />
        pfs=yes<br />
        aggrmode=yes<br />
        auto=add<br />
        auth=esp<br />
        esp=3DES-SHA1<br />
        ike=3DES-SHA1<br />
        authby=secret
</p></blockquote>
<p>/etc/ipsec.secrets</p>
<blockquote><p>
$YOUR_PUBLIC_IP $PARTNER&#8217;S_PUBLIC_IP : PSK &#8220;verySecretPreSharedKey&#8221;
</p></blockquote>
<p>If it&#8217;s the very first time you are adding the connection, use</p>
<blockquote><p>
ipsec auto &#8211;add partner
</p></blockquote>
<p>If you are editing the existing connection, use</p>
<blockquote><p>
ipsec auto &#8211;replace partner
</p></blockquote>
<p>Now, restart IPsec and initiate connection</p>
<blockquote><p>
/etc/init.d/ipsec start<br />
ipsec whack &#8211;name partner &#8211;initiate
</p></blockquote>
<p>Ah yes, routing:</p>
<blockquote><p>
ip route add $PARTHENR&#8217;S_PRIVATE_SUBNET/WITH_MASK via $YOUR_PUBLIC_IP src $YOUR_PRIVATE_IP
</p></blockquote>
<p>SonicWall should be set the same way:</p>
<blockquote><p>
Policy: site-to-site;<br />
Authentication Method: IKE using Preshared Secret<br />
IPSec Primary Gateway Name or Address: $YOUR_PUBLIC_IP<br />
Local IKE ID: IP Address, $PARTNER&#8217;S_PUBLIC_IP<br />
Peer IKE ID: IP Address, $YOUR_PUBLIC_IP</p>
<p>IKE (Phase 1) proposal:<br />
Excahnge: Aggressive mode<br />
Encryption: 3DES<br />
Authentication: SHA1<br />
Life Time (seconds) 28800</p>
<p>IPsec (Phase 2) Proposal:<br />
Protocol: ESP<br />
Encryption: 3DES<br />
Authentication: SHA1
</p></blockquote>
<p>Again, not sure if &#8216;Aggressive mode&#8217; is A Good Idea.</p>
<p>References:<br />
<a href="http://www.sonicwall.com/us/products/NSA_3500.html" title="SonicWall NSA 3500" target="_blank">SonicWall NSA 3500</a><br />
<a href="http://www.ghacks.net/2010/03/03/creating-a-vpn-tunnel-between-ubuntu-and-sonicwall/" title="Linux to Sonicwall" target="_blank">Linux to Sonicwall</a> and <a href="http://www.linux-faqs.info/vpn/establish-a-vpn-connection-between-sonicwall-and-linux" title="Linux to Sonicwall" target="_blank">also here</a><br />
<a href="http://www.pelagodesign.com/blog/2009/05/18/ubuntu-linux-how-to-setup-a-vpn-connection-to-a-sonicwall-router-using-openswan-and-pre-shared-keys-psk/" title="Linux to SonicWall TZ190" target="_blank">Linux to SonicWall TZ190</a><br />
<a href="http://linux.die.net/man/5/ipsec.conf" title="ipsec.conf (5)" target="_blank">ipsec.conf (5)</a><br />
<a href="http://www.sherman.ca/archives/2004/11/21/linux-26-ipsec-vpns/" title="IPsec VPN routing" target="_blank">IPsec VPN routing</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ejs.seniejitrakai.net/2011/12/06/ipsec-to-sonicwall-appliance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get rid of removed packages in Debian</title>
		<link>http://ejs.seniejitrakai.net/2011/03/04/get-rid-of-removed-packages-in-debian/</link>
		<comments>http://ejs.seniejitrakai.net/2011/03/04/get-rid-of-removed-packages-in-debian/#comments</comments>
		<pubDate>Fri, 04 Mar 2011 11:44:52 +0000</pubDate>
		<dc:creator>ejs</dc:creator>
				<category><![CDATA[*NIX]]></category>
		<category><![CDATA[My job]]></category>
		<category><![CDATA[Debian]]></category>

		<guid isPermaLink="false">http://ejs.seniejitrakai.net/?p=198</guid>
		<description><![CDATA[Every time package is removed via `apt-get remove`, a tiny piece of its configuration can be kept in your system. If you ever need to reinstall the package, this information can be re-used. These packages has status &#8216;rc&#8217; in the output of `dpkg -l`. But if you want to keep your system tidy and clean, [...]]]></description>
			<content:encoded><![CDATA[<p>Every time package is removed via `apt-get remove`, a tiny piece of its configuration can be kept in your system. If you ever need to reinstall the package, this information can be re-used. These packages has status &#8216;rc&#8217; in the output of `dpkg -l`. But if you want to keep your system tidy and clean, you may want them to be removed.</p>
<p>The miraculous command is</p>
<blockquote><p>dpkg -l | egrep ^r | cut -d &#8216; &#8216; -f 3 | xargs apt-get remove &#8211;purge -y</p></blockquote>
<p><span id="more-198"></span></p>
<p>What it does?</p>
<blockquote><p>dpkg -l</p></blockquote>
<p>list all packages</p>
<blockquote><p>egrep ^r</p></blockquote>
<p>print only those matching status &#8216;r*&#8217;. Package status is the first column, so add &#8216;^&#8217; to match only the lines, beginning with &#8216;r&#8217; symbol.</p>
<blockquote><p>cut -d &#8216; &#8216; -f 3</p></blockquote>
<p>return selected field only. Usually I add field separator symbol with &#8216;-d&#8217; option and specify field number with &#8216;-f&#8217;</p>
<blockquote><p>xargs apt-get remove &#8211;purge -y</p></blockquote>
<p>xargs runs the specified command, appending input from STDIN (you can alter this behaviour vith options). In this case, i&#8217;m executing &#8216;apt-get remove &#8211;purge&#8217; command. &#8216;-y&#8217; swich means &#8221;assume &#8216;yes&#8217; to all questions&#8221; and is needed for apt-get to confirm the removal of packages.</p>
<p>The rest is the magic of pipes.</p>
<p>&nbsp;</p>
<p>Why do i write this?</p>
<p>A strange messages were found in the syslog:</p>
<pre>Errors when running cron:
    grandchild #2047 failed with exit status 1: 1 Time(s)
    grandchild #2205 failed with exit status 1: 1 Time(s)
    grandchild #2342 failed with exit status 1: 1 Time(s)
    grandchild #2658 failed with exit status 1: 1 Time(s)
    grandchild #2878 failed with exit status 1: 1 Time(s)
    grandchild #2972 failed with exit status 1: 1 Time(s)
    grandchild #30732 failed with exit status 1: 1 Time(s)
    grandchild #30832 failed with exit status 1: 1 Time(s)
    grandchild #30934 failed with exit status 1: 1 Time(s)
    grandchild #3094 failed with exit status 1: 1 Time(s)
    grandchild #31290 failed with exit status 1: 1 Time(s)
    grandchild #32395 failed with exit status 1: 1 Time(s)
    grandchild #3262 failed with exit status 1: 1 Time(s)
</pre>
<p>In-deep analysis revealed &#8216;/etc/cron.d/greylistclean&#8217; from package &#8216;sa-exim&#8217;. I don&#8217;t use exim and it was replaced by postfix just after installing the system. The file mentioned did not show any signs of miss-formatting until a new version of cron daemon was installed via &#8216;apt-get dist-upgrade&#8217;</p>
]]></content:encoded>
			<wfw:commentRss>http://ejs.seniejitrakai.net/2011/03/04/get-rid-of-removed-packages-in-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenOffice.org, x64 and .NET interface</title>
		<link>http://ejs.seniejitrakai.net/2011/01/23/openoffice-org-x64-and-net-interface/</link>
		<comments>http://ejs.seniejitrakai.net/2011/01/23/openoffice-org-x64-and-net-interface/#comments</comments>
		<pubDate>Sun, 23 Jan 2011 17:28:42 +0000</pubDate>
		<dc:creator>ejs</dc:creator>
				<category><![CDATA[MatLAB]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[LibreOffice]]></category>
		<category><![CDATA[OpenOffice]]></category>

		<guid isPermaLink="false">http://ejs.seniejitrakai.net/?p=194</guid>
		<description><![CDATA[Here,&#8217;s the story short: I need to create a series of graph for highly scientific data sets. The data is calculated in MatLAB, but the export of figures in MatLAB is a pain for me. On the other hand OpenOffice.org seems to be the right tool for the job. The latest MatLAB has the function, [...]]]></description>
			<content:encoded><![CDATA[<p>Here,&#8217;s the story short:</p>
<p>I need to create a series of graph for highly scientific data sets. The data is calculated in MatLAB, but the export of figures in MatLAB is a pain for me.</p>
<p>On the other hand OpenOffice.org seems to be the right tool for the job. The latest MatLAB has the function, called &#8216;xlswrite&#8217;. Happy with the fact, hoping it should write the XLS file I fire it up and&#8230;</p>
<p>Ouch. One must have Excell installed, as the data export goes through the ActiveX. If no Excell is found, the data is exported into CSV file, overwriting the file every time. Not the Right Thing.<span id="more-194"></span></p>
<p>The job was done via ordinary &#8216;csvwrite&#8217;, but adding data, importing the file to OpenOffice.org Calc and producing a series of graph.</p>
<p>And the milestone is creating &#8216;odswrite&#8217;, implementing the same functionality as &#8216;xlswrite&#8217; presents. As MatLAB supports .NET and OpenOffice.org can be controlled via .NET-UNO bridge, .NET implementation of the function seems to be the easiest task.</p>
<p>The first problem found is it&#8217;s impossible to load &#8216;cli_cpputype&#8217; NET assembly on x64 systems. I&#8217;m not sure if it is because &#8216;cli_cpputype&#8217; is compiled for .NET 2.0, but the problem is too seriuos.</p>
<p>A <a href="http://ejs.seniejitrakai.net/njufsams/OpenOfficeTestApp.exe">small .NET program</a>, based on<a href="http://www.suite101.com/content/creating-an-openoffice-writer-document-with-c-a123686">Creating an OpenOffice Writer Document with C#</a> and<a href="http://www.suite101.com/content/creating-an-openoffice-calc-document-with-c-a124112"> Creating an OpenOffice Calc Document with C# </a>was created. In the case of success, it writes 2 files to user&#8217;s desktop:  &#8220;OpenOfficeTestFile.odt&#8221; for Writer and &#8220;OpenOfficeTestFile.ods&#8221; for Calc.</p>
<p>Here&#8217;s the source for C#. Sorry fot the mess, it&#8217;s my first .NET and C# programm ever compiled <img src='http://ejs.seniejitrakai.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<pre>using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

// OOorg assemblies
using unoidl.com.sun.star.lang; 
using unoidl.com.sun.star.uno; 
using unoidl.com.sun.star.bridge; 
using unoidl.com.sun.star.frame;
using unoidl.com.sun.star.text;
using unoidl.com.sun.star.beans;
using unoidl.com.sun.star.sheet;
using unoidl.com.sun.star.container;
using unoidl.com.sun.star.table;

namespace OONETTest
{
 class OpenOfficeTestApp 
 {
 //Define a file name. Change this to an existing path! 
private static string FileName      = @"OpenOfficeTestFile";  

 static void Main(string[] args)
 {
 string fDesktop = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
 string fFileName = fDesktop + "\\" + FileName;

//Call the bootstrap method to get a new ComponentContext 
 //object. If OpenOffice isn't already started this will 
 //start it and then return the ComponentContext.  

 unoidl.com.sun.star.uno.XComponentContext localContext =  uno.util.Bootstrap.bootstrap(); 

 //Get a new service manager of the MultiServiceFactory type 
 //we need this to get a desktop object and create new CLI 
 //objects.  

 unoidl.com.sun.star.lang.XMultiServiceFactory multiServiceFactory =  (unoidl.com.sun.star.lang.XMultiServiceFactory) localContext.getServiceManager(); 

 //Create a new Desktop instance using our service manager 
 //Notice: We cast our desktop object to XComponent loader 
 //so that we could load or create new documents.  

 XComponentLoader componentLoader = (XComponentLoader) multiServiceFactory.createInstance("com.sun.star.frame.Desktop" ); 

 //Create a new blank writer document using our component 
 //loader object. 
 XComponent oDoc = componentLoader.loadComponentFromURL( "private:factory/swriter",  //a blank writer document 
 "_blank", 0,       //into a blank frame use no searchflag 
 //use no additional arguments. 
 new unoidl.com.sun.star.beans.PropertyValue[0] 
 ); 

 //Cast our component to a the XText interface 
//and write some simple text into document.  

 ((unoidl.com.sun.star.text.XTextDocument)oDoc).getText().setString("Testing OpenOffice.org .NET interface"); 

 //After we insert our text, we cast our component to XStorable 
 //to save it onto the harddisk  

 ((XStorable)oDoc).storeToURL( //Convert the file path into a OpenOffice path 
 PathConverter(fFileName + ".odt"),
 new unoidl.com.sun.star.beans.PropertyValue[0]);            //no additional arguments  

 // close the Writer
 oDoc.dispose();

 // according to
 //http://www.suite101.com/content/creating-an-openoffice-calc-document-with-c-a124112

 //Create a new blank writer document using our component 
 //loader object. 
 XComponent oCalc = componentLoader.loadComponentFromURL("private:factory/scalc",  //a blank Calc document 
 "_blank", 0,       //into a blank frame use no searchflag 
 //use no additional arguments. 
 new unoidl.com.sun.star.beans.PropertyValue[0]
 );

 // get sheets
 XSpreadsheets oSheets = ((XSpreadsheetDocument)oCalc).getSheets();
 XIndexAccess oSheetsIA = (XIndexAccess) oSheets;
 // access sheet by index
 XSpreadsheet oSheet = (XSpreadsheet) oSheetsIA.getByIndex(0).Value;</pre>
<pre>//write some data:
//Each cell in a Calc sheet is indexed by its column and row, so that text (for example) is written to cell A1 by using:

 XCell oCell = oSheet.getCellByPosition( 0, 0 ); //A1
 ((XText)oCell).setString("Testing OpenOffice.org .NET interface");</pre>
<pre>oCell = oSheet.getCellByPosition( 0, 1 ); //A2
 ((XText)oCell).setString("Cost");

 //And a number can be written to B1 by using:
 oCell = oSheet.getCellByPosition( 1, 1 ); //B2
 oCell.setValue(200);

 //And the "setFormula" methods is, of course, used to enter formulae (in this example into B3):

 oCell = oSheet.getCellByPosition( 1, 2 ); //B3
 oCell.setFormula("=B2 * 1.175");

 //After we insert our text, we cast our component to XStorable 
 //to save it onto the harddisk  

 ((XStorable)oCalc).storeToURL( //Convert the file path into a OpenOffice path 
 PathConverter(fFileName + ".ods"),
 new unoidl.com.sun.star.beans.PropertyValue[0]);            //no additional arguments  

 // close Calc
 oCalc.dispose();

 MessageBox.Show("OpenOffice document '" + fFileName + ".odt' saved, \n" + "OpenOffice document '" + fFileName + ".ods' saved", "OpenOffice .NET Test App");

 } 

 /// 
 /// Convert file path  into OO file format 
 /// 
 ///

 private static string PathConverter( string file) 
 {
 try 
 {
 file = file.Replace(@"\", "/");
 return "file:///"+file; 
 }
 catch (System.Exception ex) 
 {
 throw ex; 
 }
 }
 }
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://ejs.seniejitrakai.net/2011/01/23/openoffice-org-x64-and-net-interface/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Running VirtualBox guests from physical drive</title>
		<link>http://ejs.seniejitrakai.net/2010/11/01/running-virtualbox-guests-from-physical-drive/</link>
		<comments>http://ejs.seniejitrakai.net/2010/11/01/running-virtualbox-guests-from-physical-drive/#comments</comments>
		<pubDate>Sun, 31 Oct 2010 22:38:28 +0000</pubDate>
		<dc:creator>ejs</dc:creator>
				<category><![CDATA[*NIX]]></category>
		<category><![CDATA[Hobbies]]></category>
		<category><![CDATA[My job]]></category>

		<guid isPermaLink="false">http://ejs.seniejitrakai.net/?p=175</guid>
		<description><![CDATA[Dual boot is perfect solution in most cases. On the other hand, if you need to peep into the other system&#8217;s files, you need to re-boot. Or use sometimes not so stable filesystem utilities. Running fully virtualized OS, using eg Xen as supervisor, creates additional load an hardware, maybe not too big when running multiple [...]]]></description>
			<content:encoded><![CDATA[<p>Dual boot is perfect solution in most cases.</p>
<p>On the other hand, if you need to peep into the other system&#8217;s files, you need to re-boot. Or use sometimes not so stable filesystem utilities.<br />
Running fully virtualized OS, using eg Xen as supervisor, creates additional load an hardware, maybe not too big when running multiple OS&#8217;es on the pretty new server, but significant, if it is a laptop. And yes, you NEED to keep data in-sync between virtual and real OS.<span id="more-175"></span><br />
VMware users, please don&#8217;t read any more. Yes, you can do it from pre-historic times.</p>
<p>You&#8217;ve been warned!</p>
<p>As for VirtualBox, it is possible to add physical drive or disk partition to your VM setup, although no GUI tools exists to accomplish this.<br />
Every step is documented in VirtualBox User&#8217;s Guide, but really, who read these guides?<br />
So , excerpts from <a href="http://www.virtualbox.org/manual/ch09.html#rawdisk">The Guide, chapter 9</a>:</p>
<p><strong>Step 1:</strong> you need to know the partition layout of the drive.</p>
<p><code>VBoxManage internalcommands listpartitions -rawdisk [physical_drive]</code></p>
<p>Substitute [physical_drive] for <strong>/dev/sd[a-z]</strong> if you live in Linux, <strong>\\.\PhysicalDrive[0..n]</strong> living in windows or <strong>/dev/drive[1..n]</strong> living in OS X.<br />
Note the numbers. Linux usually has partition type 0&#215;83, windows &#8211; 0&#215;07. Not sure about Mac. You need to remember the physical partition you want to use in guest OS.</p>
<p><strong>Step 2:</strong> export it to a file. It&#8217;s as easy as 1-2-3. And no, not the whole partition, but only some information about the layout of partitions will be saved:</p>
<p><code>VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk -rawdisk /dev/sda -partitions [partition_number] -register</code></p>
<p><strong>/path/to/file.vmdk</strong> must be absolute path. Substitute <strong>[partition_number]</strong> with the the partition from step 1. Using &#8220;-register&#8221; automagically registers the image in list of registered images of the VirtualBox.</p>
<p>&nbsp;</p>
<p><strong>Step 3:</strong> attach the newly created file to a guest and run it.</p>
<p><strong>Some notes:</strong> it&#8217;s possible to use entire physical disk for VirtualBox:<br />
<code>VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk -rawdisk [physical_drive]</code><br />
Although it is possible, you should ever never launch the currently running system in VirtualBox. You&#8217;ve been warned.</p>
]]></content:encoded>
			<wfw:commentRss>http://ejs.seniejitrakai.net/2010/11/01/running-virtualbox-guests-from-physical-drive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migration hell: moving printers in Windows</title>
		<link>http://ejs.seniejitrakai.net/2010/10/20/migration-hell-moving-printers/</link>
		<comments>http://ejs.seniejitrakai.net/2010/10/20/migration-hell-moving-printers/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 00:28:26 +0000</pubDate>
		<dc:creator>ejs</dc:creator>
				<category><![CDATA[My job]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://ejs.seniejitrakai.net/?p=164</guid>
		<description><![CDATA[Our campus, Faculty of Architecture, VGTU is moving to the totally new subnet. As we use DHCP for IP distribution, no real problems except `sed` are going to appear. The pleasing moment is we are getting a fresh IP range. The headache is TCP/IP printers. WPKG has good printer addition/ installation guide in http://wpkg.org/Printer_configuration , [...]]]></description>
			<content:encoded><![CDATA[<p>Our campus, <a href="http://www.ar.vgtu.lt">Faculty of Architecture</a>, <a href="http://www.vgtu.lt">VGTU</a> is moving to the totally new subnet. As we use DHCP for IP distribution, no real problems except `sed` are going to appear.<br />
The pleasing moment is we are getting a fresh IP range.<br />
The headache is TCP/IP printers.</p>
<p>WPKG has good printer addition/ installation guide in http://wpkg.org/Printer_configuration , but it does not cover changing IP port numbers.<br />
As a CEO on all computer infrastructure, I need to find any solution to make the movement smoothly.</p>
<p>I was unable to find a ready-made solution, and in-house tool appeared after several hours in the Net.<br />
I need to apologize for bugs and errors, as it is the first (and hopefully the last) VB script. It uses WMI. Testing box was W7, x64.<br />
Maybe someone will find it useful.</p>
<p>Call the file <strong>chprinterport.vbs</strong><span id="more-164"></span><br />
<code><br />
Set args = WScript.Arguments<br />
if args.Count < 2 then<br />
	Wscript.Echo " "<br />
	Wscript.Echo " Change IP ports for TCP/IP printers on Windows boxes"<br />
	Wscript.Echo " "<br />
	Wscript.Echo "   Usage: <em>cscript chprinterport.vbs old_TCP/IP_port new_TC/IP_port</em>"<br />
	Wscript.Echo " "<br />
	Wscript.Echo "    eg: cscript chprinterport.vbs 192.168.1.2 192.168.2.3 will change"<br />
	Wscript.Echo "      port IP from 192.168.1.2 to 192.168.2.3"<br />
	Wscript.Echo " "<br />
	Wscript.Echo "    Partial match is possible, so:"<br />
	Wscript.Echo "      cscript chprinterport.vbs 192.168 210.23 will change"<br />
	Wscript.Echo "      port IP from 192.168.x.y to 210.23.x.y"<br />
	Wscript.Echo " "<br />
	Wscript.Echo " Inspired by:"<br />
	Wscript.Echo "   http://wpkg.org/Printer_configuration"<br />
	Wscript.Echo "   http://gallery.technet.microsoft.com/ScriptCenter/en-us/5777dc6a-9783-43d7-ac8e-fd3bd739690c"<br />
	Wscript.Echo "   http://www.pcreview.co.uk/forums/showpost.php?s=8a077fc479806d3fc03bf734d57b357f&#038;p=5622799&#038;postcount=6"<br />
	Wscript.Echo " "<br />
	Wscript.Echo "                                                            License - BSD"<br />
	Wscript.Echo " "<br />
	Wscript.Echo "                           (c) 2010 ejs@seniejitrakai.net, ejs@ar.vgtu.lt"<br />
	Wscript.Echo "                                             http://ejs.seniejitrakai.net"<br />
  else<br />
	oldIPAddress    = args.Item(0)<br />
	newIPAdress = args.Item(1)<br />
        Dim strComputer<br />
        Dim Result<br />
        strComputer = "."<br />
        Result = ""<br />
	Set objWMIService = GetObject("winmgmts:" &#038; _<br />
"{impersonationLevel=impersonate,(LoadDriver)}!\\" &#038; strComputer &#038; _<br />
"\root\cimv2")<br />
	Set colPorts = objWMIService.ExecQuery ("Select * from Win32_TCPIPPrinterPort")<br />
	For Each objPort in colPorts<br />
		wscript.echo "Found TCP/IP printer port: " &#038; objPort.HostAddress  &#038; ", named " &#038; objPort.Name<br />
	if UCase(Mid(objPort.HostAddress, 1, Len(oldIPAddress))) = oldIPAddress Then<br />
		objPort.HostAddress = newIPAdress &#038;  Mid(objPort.HostAddress, Len(oldIPAddress)+1)<br />
		Wscript.Echo "New Printer port: " &#038; objPort.HostAddress<br />
		Result =  objPort.Put_<br />
	    If Len(Result) > 0 Then<br />
			WScript.Echo "Updated TCP/IP printer port: " &#038; objPort.HostAddress &#038; ", named " &#038; objPort.Name<br />
		Else<br />
			WScript.Echo "Error " &#038; Result &#038; " updating TCP/IP printer port: " &#038; objPort.HostAddress<br />
			WScript.Quit<br />
		End If<br />
	 end if<br />
	 Next<br />
end if<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://ejs.seniejitrakai.net/2010/10/20/migration-hell-moving-printers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A single song</title>
		<link>http://ejs.seniejitrakai.net/2010/06/16/one-song/</link>
		<comments>http://ejs.seniejitrakai.net/2010/06/16/one-song/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 22:33:12 +0000</pubDate>
		<dc:creator>ejs</dc:creator>
				<category><![CDATA[Hobbies]]></category>

		<guid isPermaLink="false">http://ejs.seniejitrakai.net/?p=157</guid>
		<description><![CDATA[I&#8217;ve been working for maybe the third day when i&#8217;ve heard it on some Internet radio station. The song was performed by Mary Hopkin. It&#8217;s tracing back to 1920-ies, was banned up to 1950-ies. Anyway Wikipedia knows more about it. Dude, i&#8217;m feeling to old for rock-n-roll &#8220;Дорогой длинною&#8221;, Сергей Зыков (Youtube post by tombene77): [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working for maybe the third day when i&#8217;ve heard it on some Internet radio station. The song was  performed by Mary Hopkin. It&#8217;s tracing back to 1920-ies, was banned up to 1950-ies. Anyway <a href="http://en.wikipedia.org/wiki/Those_Were_the_Days_%28song%29">Wikipedia knows more about it</a>.</p>
<p>Dude, i&#8217;m feeling to old for rock-n-roll <img src='http://ejs.seniejitrakai.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p align ="center">
<a href="http://www.youtube.com/watch?v=FLC4uOkwWKs">&#8220;Дорогой длинною&#8221;, Сергей Зыков </a> (Youtube post by <a href="http://www.youtube.com/user/tombene77">tombene77</a>):<br />
<object width="640" height="505"><param name="movie" value="http://www.youtube.com/v/FLC4uOkwWKs&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;color1=0x3a3a3a&#038;color2=0x999999"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/FLC4uOkwWKs&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;color1=0x3a3a3a&#038;color2=0x999999" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="505"></embed></object><br />
<span id="more-157"></span></p>
<p align ="center">
<a href="http://www.youtube.com/watch?v=lNVit7cesj8">&#8220;Those were the days&#8221;, Mary Hopkin</a> (Youtube post by <a href="http://www.youtube.com/user/Ibicus">Ibicus</a>):<br />
<object width="640" height="505"><param name="movie" value="http://www.youtube.com/v/lNVit7cesj8&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;color1=0x3a3a3a&#038;color2=0x999999"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/lNVit7cesj8&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;color1=0x3a3a3a&#038;color2=0x999999" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="505"></embed></object></p>
<p align ="center">
<a href="http://www.youtube.com/watch?v=sMUDlhQPOUo">&#8220;Quelli Erano Giorni&#8221;, Gigliola Cinquetti</a> (Youtube post by <a href="http://www.youtube.com/user/tengokuemaki">tengokuemaki</a>):<br />
<object width="640" height="505"><param name="movie" value="http://www.youtube.com/v/sMUDlhQPOUo&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;color1=0x3a3a3a&#038;color2=0x999999"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/sMUDlhQPOUo&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;color1=0x3a3a3a&#038;color2=0x999999" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="505"></embed></object></p>
<p align ="center">
<a href="http://www.youtube.com/watch?v=r-mRHxpax_4">&#8220;Le temps des fleurs&#8221;, Dalida </a> (Youtube post by <a href="http://www.youtube.com/user/VenitienDeLevallois">VenitienDeLevallois</a>):<br />
<object width="640" height="505"><param name="movie" value="http://www.youtube.com/v/r-mRHxpax_4&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;color1=0x3a3a3a&#038;color2=0x999999"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/r-mRHxpax_4&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;color1=0x3a3a3a&#038;color2=0x999999" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="505"></embed></object></p>
<p align ="center">
<a href="http://www.youtube.com/watch?v=T-jtxFOsmsk">&#8220;An jenem Tag&#8221;, Dunja Rajter</a> (Youtube post by <a href="http://www.youtube.com/user/fritz51223">fritz51223</a>):<br />
<object width="640" height="505"><param name="movie" value="http://www.youtube.com/v/T-jtxFOsmsk&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;color1=0x3a3a3a&#038;color2=0x999999"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/T-jtxFOsmsk&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;color1=0x3a3a3a&#038;color2=0x999999" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="505"></embed></object></p>
<p align ="center">
<a href="http://www.youtube.com/watch?v=kV4SiPWrW0Y">&#8220;Kelelis tolimas&#8221;, Virgis Stakėnas </a> (Youtube post by <a href="http://www.youtube.com/user/starkaes">starkaes</a>):<br />
<object width="640" height="505"><param name="movie" value="http://www.youtube.com/v/kV4SiPWrW0Y&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;color1=0x3a3a3a&#038;color2=0x999999"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/kV4SiPWrW0Y&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;color1=0x3a3a3a&#038;color2=0x999999" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="505"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://ejs.seniejitrakai.net/2010/06/16/one-song/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Localised fonts</title>
		<link>http://ejs.seniejitrakai.net/2010/04/20/localised-fonts/</link>
		<comments>http://ejs.seniejitrakai.net/2010/04/20/localised-fonts/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 14:17:20 +0000</pubDate>
		<dc:creator>ejs</dc:creator>
				<category><![CDATA[*NIX]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[My job]]></category>

		<guid isPermaLink="false">http://ejs.seniejitrakai.net/?p=155</guid>
		<description><![CDATA[The very first try on &#8220;Flux-the-Architect&#8220;. Added Ą,Č,Ę,Ė,Į,Š,Ų,Ū,Ž glyphs and some minor symbols (°, ±, ², ³). The font is OpenType in TrueType encoding. OpenType fonts in PS encoding does not work in AutoCAD.]]></description>
			<content:encoded><![CDATA[<p>The very first try on &#8220;<a href="http://ejs.seniejitrakai.net/wp-content/uploads/FluxArchitect-Regular-TT.otf">Flux-the-Architect</a>&#8220;. Added Ą,Č,Ę,Ė,Į,Š,Ų,Ū,Ž glyphs and some minor symbols (°, ±, ², ³). The font is OpenType in TrueType encoding. OpenType fonts in PS encoding does not work in AutoCAD.</p>
]]></content:encoded>
			<wfw:commentRss>http://ejs.seniejitrakai.net/2010/04/20/localised-fonts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Troubles in Virtual World</title>
		<link>http://ejs.seniejitrakai.net/2010/02/24/troubles-in-virtual-world/</link>
		<comments>http://ejs.seniejitrakai.net/2010/02/24/troubles-in-virtual-world/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 12:10:36 +0000</pubDate>
		<dc:creator>ejs</dc:creator>
				<category><![CDATA[*NIX]]></category>

		<guid isPermaLink="false">http://ejs.seniejitrakai.net/?p=143</guid>
		<description><![CDATA[For testing OpenOffice.org i&#8217;ve set up a VirtualBox, running Debian/testing in x86and amd64 architectures. In some cases, mouse integration does not work correctly. Although mouse works perfectly in the Guest window, it&#8217;s impossible to move it out without pressing Host key (left Ctrl in MS Windows). VirtualBox guest additions are installed, guest resizing and shared [...]]]></description>
			<content:encoded><![CDATA[<p>For testing OpenOffice.org i&#8217;ve set up a VirtualBox, running Debian/testing in x86and amd64 architectures.<br />
In some cases, mouse integration does not work correctly. Although mouse works perfectly in the  Guest window, it&#8217;s impossible to move it out without pressing Host key (left Ctrl in MS Windows).<br />
VirtualBox guest additions are installed, guest resizing and shared folders works perfectly.<br />
The solution was found in <a href="http://forums.virtualbox.org/viewtopic.php?t=10800">VirtualBox forums</a> :<br />
/etc/X11/xorg.conf must contain </p>
<blockquote><p>Section &#8220;InputDevice&#8221;<br />
   Identifier   &#8220;Configured Mouse&#8221;<br />
   Driver       &#8220;vboxmouse&#8221;<br />
   Option       &#8220;CorePointer&#8221;<br />
EndSection</p></blockquote>
<p>note two lines: <strong>vboxmouse</strong> tells X.org to use mouse driver from VirtualBox guest additions, and <strong>CorePointer</strong> instructs to use this pointer as primary. Without <em>CorePointer</em> line the vboxmouse driver is used, but it&#8217;s still impossible to move it outside guest&#8217;s window.</p>
]]></content:encoded>
			<wfw:commentRss>http://ejs.seniejitrakai.net/2010/02/24/troubles-in-virtual-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

