<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Tech-Blog: Category Linux</title>
    <link>/articles/category/linux</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Mike Pierson's technology blog</description>
    <item>
      <title>vmware broken on Debian Sid</title>
      <description>&lt;p&gt;Just as PB had predicted, my vmware console stopped working after upgrading to the latest Sid.  Herewith, a fix, as written by &lt;a href="http://www.vmware.com/community/thread.jspa?threadID=54921"&gt;wegface&lt;/a&gt; on the vmware community board...&lt;/p&gt;
&lt;blockquote&gt;
 &lt;p&gt;
  &lt;br&gt;
                    fix is as following:
&lt;br&gt;open /usr/lib/vmware/lib/wrapper-gtk24.sh as root.
&lt;br&gt;search for the lines:
&lt;br&gt;vm_run() {
&lt;br&gt;    local exitCode; 
&lt;br&gt;&lt;br&gt;add: 
&lt;br&gt;# Fix for vmplayer pulling in libdbus-1.so.2 instead of .3
&lt;br&gt;   export LD_PRELOAD=/usr/lib/libdbus-1.so.3:$LD_PRELOAD 
&lt;br&gt;&lt;br&gt;so your new /usr/lib/vmware/lib/wrapper-gtk24.sh looks like this: 
&lt;br&gt;# Run "$binary" while watching its progress on its stderr.
&lt;br&gt;vm_run() {
&lt;br&gt;   local exitCode;

&lt;br&gt;&lt;br&gt;   # Fix for vmplayer pulling in libdbus-1.so.2 instead of .3
&lt;br&gt;   export LD_PRELOAD=/usr/lib/libdbus-1.so.3:$LD_PRELOAD
&lt;br&gt;&lt;br&gt;   # Append any libraries that are still missing.
&lt;br&gt;   if [ "$VMWARE_USE_SHIPPED_GTK" = 'force' ]; then 
&lt;br&gt;&lt;br&gt;now you can have installed libdbus-1-2/3 at the same time and vmware will run, too.
&lt;br&gt;&lt;br&gt;Thanks to Roughnecks from the kanotix linux forum for this fix. I can confirm it works fine
 &lt;/p&gt;
&lt;/blockquote&gt;


</description>
      <pubDate>Mon, 25 Sep 2006 14:43:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:be518bfa-39af-493b-84c9-453f23641f2e</guid>
      <author>Mike</author>
      <link>/articles/2006/09/25/vmware-broken-on-debian-sid</link>
      <category>Linux</category>
      <category>debian</category>
      <category>vmware</category>
      <trackback:ping>/articles/trackback/281</trackback:ping>
    </item>
    <item>
      <title>Web quickies</title>
      <description>
&lt;p&gt;Some tidbits from my &lt;a href="http://www.bloglines.com/"&gt;Bloglines&lt;/a&gt; RSS &lt;a href="http://www.bloglines.com/public/mpierson"&gt;subscriptions&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;&lt;a href="http://www.jutils.com/"&gt;Lint4J&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;"Lint4j ("Lint for Java") is a static Java source code analyzer that detects locking and threading issues, performance and scalability problems, and checks complex contracts such as Java serialization by performing type, data flow, and lock graph analysis."&lt;/p&gt;

&lt;h3&gt;&lt;a href="http://www.jot.com/"&gt;JotSpot&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;It&amp;rsquo;s Wiki++.  Typical intranet functionality is available to Wiki users. As seen on &lt;a href="http://weblog.infoworld.com/udell/"&gt;John Udell&amp;rsquo;s blog&lt;/a&gt;.  (I&amp;rsquo;ve added John&amp;rsquo;s blog to my roll.)&lt;/p&gt;

&lt;h3&gt;&lt;a href="http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/BlogYourBuild.rdoc"&gt;Blogging Your Build&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Blogs aren&amp;rsquo;t just for people, you&amp;rsquo;re processes should be blogging too.  Oh yeah.&lt;/p&gt;

&lt;h3&gt;&lt;a href="http://wiki.osuosl.org/display/LNX/Debian+on+Dell+Servers"&gt;Debian on Dell Servers&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;ISOs and pointers for those brave enough to run Dell servers.&lt;/p&gt;

</description>
      <pubDate>Mon, 01 Nov 2004 18:22:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:ba0883a746797eeb121c87ea83b1f45b</guid>
      <author>mop</author>
      <link>/articles/2004/11/01/htmlQuickies-2</link>
      <category>blogs</category>
      <category>web</category>
      <category>Linux</category>
      <category>programming</category>
      <trackback:ping>/articles/trackback/112</trackback:ping>
    </item>
    <item>
      <title>AMD64 and Debian</title>
      <description>
&lt;p&gt;Some notes about my experience installing Debian on an AMD64...&lt;/p&gt;

&lt;h3&gt;hardware&lt;/h3&gt;
&lt;p&gt;It&amp;rsquo;s a refurbished E-Machines &lt;a href="http://www.tigerdirect.ca/applications/SearchTools/item-details.asp?EdpNo=541570&amp;CatId=1344"&gt;T6000&lt;/a&gt; with 512MB RAM and a 160GB Western Digital disk.  TigerDirect was clearing them out @ $850.  It&amp;rsquo;s a nice small box, and quiet too.&lt;/p&gt;

&lt;h3&gt;install&lt;/h3&gt;
&lt;p&gt;I tried to re-partition the disk to save the pre-installed Windoze OS with no luck.  Apparently the Mandrake install disk is able to re-partition XP disks but I was too impatient to burn a Mandrake CD.&lt;/p&gt;
&lt;p&gt;I was also too impatient to burn a &lt;a href="http://www.debian.org/ports/amd64/"&gt;Debian-AMD64&lt;/a&gt; CD, although this approach is apparently quite mature.  Instead, I chose the &lt;a href=""&gt;&amp;rsquo;chroot&amp;rsquo; approach&lt;/a&gt;. Bootstrapping with a normal x86 (backwards compatible CPU platform!) allows the 64-bit OS to be installed in a chroot environment.  The &lt;a href="http://packages.debian.org/cgi-bin/search_packages.pl?searchon=names&amp;version=all&amp;exact=1&amp;keywords=debootstrap"&gt;debootstrap&lt;/a&gt; makes the process almost foolproof.  Not quite mike-proof as I was still groking chroots and &lt;a href="http://packages.debian.org/cgi-bin/search_packages.pl?searchon=names&amp;version=all&amp;exact=1&amp;keywords=grub"&gt;grub&lt;/a&gt;.  The biggest mistake I made was failing to mount a proc file system in the chroot dir &lt;i&gt;before&lt;/i&gt; switching to the new root.&lt;/p&gt;
&lt;p&gt;FWIW, I think it may have been possible to install Debian from CompactFlash, via the USB reader -- maybe in another lifetime.&lt;/p&gt;

&lt;h3&gt;pure 64 port&lt;/h3&gt;
&lt;p&gt;The pure-64 port of Debian more-or-less duplicates the packages in Debian Sid. Packages that do not compile for 64-bit are excluded (e.g. OpenOffice), and some packages compile but segfault (e.g. Xprint).  I have yet to run XFree or even xfb via VNC, but have heard some success stories.  PostgreSQL works as advertised, as does the Blackdown Java port (1.4.2-rc1).&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s worth noting that the Debian community is still divided about the future of the AMD64 port.  The &lt;a href="http://lists.debian.org/debian-vote/2004/07/msg00019.html"&gt;controversy&lt;/a&gt; arose because some would like to see the pure-64 port become the official Debian AMD64 port, even though there is no clear way to support 32-bit applications. Bi-arch solutions tend to be klugy, although it seems to be a necessary evil.&lt;/p&gt;

&lt;h3&gt;performance&lt;/h3&gt;
&lt;p&gt;So far I can only provide circumstantial evidence about the relative performance of my AMD64 box.  It appears to be quite zippy when tasks are in-memory and sluggish when accessing the disk.  I need to add some RAM before benchmarking the H database.&lt;/p&gt;

&lt;h3&gt;specs&lt;/h3&gt;

&lt;pre&gt;
albert:/home/mpierson# cat /proc/cpuinfo 
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 4
model name      : AMD Athlon(tm) 64 Processor 3200+
stepping        : 8
cpu MHz         : 2000.162
cache size      : 1024 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext lm 3dnowext 3dnow
bogomips        : 3923.96
TLB size        : 1088 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp
&lt;/pre&gt;

&lt;pre&gt;
mpierson@albert:~$ /usr/local/jdk/bin/java -version
java version "1.4.2-rc1"
Java(TM) 2 Runtime Environment, Standard Edition (build Blackdown-1.4.2-rc1)
Java HotSpot(TM) 64-Bit Server VM (build Blackdown-1.4.2-rc1, mixed mode)
&lt;/pre&gt;

&lt;pre&gt;
0000:00:00.0 Host bridge: VIA Technologies, Inc. VT8385 [K8T800 AGP] Host Bridge (rev 01)
0000:00:01.0 PCI bridge: VIA Technologies, Inc. VT8237 PCI bridge [K8T800 South]
0000:00:07.0 Communication controller: Conexant HSF 56k HSFi Modem (rev 01)
0000:00:0e.0 FireWire (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host Controller (rev 80)
0000:00:0f.0 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06)
0000:00:10.0 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)
0000:00:10.1 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)
0000:00:10.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)
0000:00:10.3 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)
0000:00:10.4 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 86)
0000:00:11.0 ISA bridge: VIA Technologies, Inc. VT8237 ISA bridge [K8T800 South]
0000:00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller (rev 60)
0000:00:12.0 Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II] (rev 78)
0000:00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 NorthBridge
0000:00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 NorthBridge
0000:00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 NorthBridge
0000:00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 NorthBridge
0000:01:00.0 VGA compatible controller: ATI Technologies Inc RV350 AP [Radeon 9600]
0000:01:00.1 Display controller: ATI Technologies Inc RV350 AP [Radeon 9600] (Secondary)
&lt;/pre&gt;

&lt;pre&gt;
albert:/home/mpierson# cat /proc/version 
Linux version 2.6.7-5-amd64-k8 (root@athlon.lowpingbastards.de) (gcc version 3.3.4 (Debian 1:3.3.4-3)) #1 Thu Jul 15 01:13:32 CEST 2004
&lt;/pre&gt;

</description>
      <pubDate>Thu, 26 Aug 2004 12:03:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:8c455f0084b680f3f15a7d37a358499c</guid>
      <author>mop</author>
      <link>/articles/2004/08/26/amd64-debian</link>
      <category>Linux</category>
      <trackback:ping>/articles/trackback/102</trackback:ping>
    </item>
    <item>
      <title>Converting a MS SQL Server database to PostgreSQL</title>
      <description>

&lt;p&gt;Herewith some notes from my attempt to migrate a database instance from Microsoft SQL Server 7 to PostgreSQL 7.3.  My journey began with Ian Harding&amp;rsquo;s &lt;a href="http://techdocs.postgresql.org/techdocs/sqlserver2pgsql.php"&gt;how-to&lt;/a&gt;, and it&amp;rsquo;s a good place to start.&lt;/p&gt;

&lt;h3&gt;export from SQL Server&lt;/h3&gt;
&lt;p&gt;The &lt;a href=""&gt;bcp&lt;/a&gt; utility is a quick and flexible command line utility that extracts raw table data (or query result) to a file. It works pretty much as advertised, with the only tricky parts being the treatment of nulls and character encoding.  Ian suggested using the &lt;i&gt;-k&lt;/i&gt; parameter which forces bcp to use a null character (x00) to represent an empty field, it&amp;rsquo;s probably the right thing to do. Unfortunately bcp does not distinguish between empty fields(i.e. value is null) and fields containing an empty string.  Character encoding can be dealt with in two ways: the &lt;i&gt;-c&lt;/i&gt; parameter will force all text data into ASCII text, or the &lt;i&gt;-w&lt;/i&gt; parameter will encode text as UTF-16.  The two-byte representation would be a no-brainer, except that the data swells to (almost) twice the original size.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s what I used for each table in the database:&lt;/p&gt;
&lt;pre&gt;
 bcp dbname..tablename out &amp;rsquo;filename&amp;rsquo; -w -k -t "&amp;lt;f-end&amp;gt;" -r "&amp;lt;record-end&amp;gt;" -b 1000
&lt;/pre&gt;
&lt;p&gt;where &lt;i&gt;-b&lt;/i&gt; is the number of rows per transaction, and the &lt;i&gt;-t&lt;/i&gt; and &lt;i&gt;-r&lt;/i&gt; parameters indicate the field and record delimiters.  The key when choosing delimiters is to avoid conflicts with field values.&lt;/p&gt;


&lt;h3&gt;mangle the exported data&lt;/h3&gt;
&lt;p&gt;Here&amp;rsquo;s what I did to the export of each table (after moving files to a Linux box):&lt;/p&gt;
&lt;pre&gt;
 # transform to 8 bit encoding
 recode utf-16..utf-8 $1

 # TODO check for literal &amp;rsquo;
&amp;rsquo;, &amp;rsquo;	&amp;rsquo;

 # replace back slash with forward slash
 perl -pi -e &amp;rsquo;s!\!/!g&amp;rsquo; $1

 # replace tabs with literal &amp;rsquo;	&amp;rsquo;
 perl -pi -e &amp;rsquo;s/	/\t/g&amp;rsquo; $1
 # replace line breaks with literal &amp;rsquo;
&amp;rsquo;
 perl -pi -e &amp;rsquo;s/
/\n/g&amp;rsquo; $1

 # replace field delimiter with tabs
 perl -pi -e &amp;rsquo;s/&amp;lt;f-end&gt;/	/g&amp;rsquo; $1
 # replace record delimiters with line break
 perl -pi -e &amp;rsquo;s/&amp;lt;record-end&gt;/
/g&amp;rsquo; $1

 # remove Windoze line feeds
 perl -pi -e &amp;rsquo;s/
//g&amp;rsquo; $1

 # remove nulls
 perl -pi -e &amp;rsquo;s/x00//g&amp;rsquo; $1
&lt;/pre&gt;

&lt;p&gt;Here&amp;rsquo;s the step by step explanation:&lt;/p&gt;
 &lt;ul&gt;
  &lt;li&gt;bcp exports Unicode using UTF-16, PostgreSQL expects UTF-8; and UTF-8 is easier to move around via SCP
  &lt;li&gt;the backslash character is significant when importing into PostgreSQL, and I couldn&amp;rsquo;t think of a reason to keep them in a field value
  &lt;li&gt;PostgreSQL uses the backslash to encode tabs and line breaks within fields values
  &lt;li&gt;obviously tabs and line breaks are used as delimiters
  &lt;li&gt;just housekeeping, I don&amp;rsquo;t think the line feeds cause a problem
  &lt;li&gt;nulls seem to confuse PostgreSQL&amp;rsquo;s import process
 &lt;/ul&gt;

&lt;p&gt;Notes: next time around I&amp;rsquo;ll use sed instead of perl, but I was too lazy to check the syntax of &lt;i&gt;recode&lt;/i&gt; for stream ops;  you&amp;rsquo;ll see that the null characters inserted by &lt;i&gt;bcp&lt;/i&gt; to represent empty fields are being stripped - could be that we don&amp;rsquo;t need the nulls in the exports, or that we should keep them in the export and convince PostgreSQL that they are significant.&lt;/p&gt;

&lt;h3&gt;create PostgreSQL schema&lt;/h3&gt;
&lt;p&gt;I used brute force.  It would be nice to build a &lt;i&gt;schema.sql&lt;/i&gt; script with ant and &lt;a href="http://blog.intouch.ca/mpierson/pyblosxom.cgi/makedata.html"&gt;makedata&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;import into PostgreSQL&lt;/h3&gt;
&lt;p&gt;The &lt;a href="http://www.postgresql.org/docs/7.3/static/sql-copy.html"&gt;COPY&lt;/a&gt; command allows table data to be imported from a local file.  The only tricky part is the interpretation of null field values; following Ian&amp;rsquo;s lead I&amp;rsquo;ve specified the empty string:&lt;/p&gt;
&lt;pre&gt;
 COPY tablename FROM &amp;rsquo;filename&amp;rsquo; WITH NULL AS &amp;rsquo;&amp;rsquo;;
&lt;/pre&gt;
&lt;p&gt;This approach worked for all tables except those that contained empty strings in columns defined as &amp;rsquo;NOT NULL&amp;rsquo;.  I kluged these tables by altering the schema: "... ALTER COLUMN xxx DROP NOT NULL".&lt;/p&gt;

&lt;h3&gt;update&lt;/h3&gt;
&lt;p&gt;It&amp;rsquo;s probably also a good idea to run the maintenance.sql script to clean up some tables before extracting.  Smaller is better.&lt;/p&gt;

</description>
      <pubDate>Wed, 11 Aug 2004 12:46:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:25f558fd59b12d8d2f7ca71efa42fda2</guid>
      <author>mop</author>
      <link>/articles/2004/08/11/sqlServer2PostgreSQL</link>
      <category>Linux</category>
      <category>programming</category>
      <trackback:ping>/articles/trackback/134</trackback:ping>
    </item>
    <item>
      <title>PostgreSQL benchmarks</title>
      <description>
&lt;p&gt;&lt;a href="http://www.postgresql.org/"&gt;PostgreSQL&lt;/a&gt; has been the highest profile open source transactional RDBMS for a while, deserved or no.  It gets the most eyeballs and one hopes that this translates to reliability and performance.  My experience with a certain proprietary RDBMS and PostgreSQL suggests that open source translates to reliability.  But performance?  Don&amp;rsquo;t know.&lt;/p&gt;

&lt;p&gt;Benchmarks have always been tightly controlled by the big vendors like Oracle and Microsoft. Can&amp;rsquo;t blame them for discouraging the publication of ad-hoc test results -- it&amp;rsquo;s a non-linear system and results are highly dependent on conditions beyond the control of the vendor. The &lt;a href="http://www.tpc.org/default.asp"&gt;Transaction Processing Performance Council&lt;/a&gt; (TPC) is a non-profit that publishes benchmark results from standardized tests.  You&amp;rsquo;ll find some impressive numbers for Microsoft SQL Server, IBM DB2, and Oracle, mostly running on expensive hardware.  So where are the open source benchmarks?  I&amp;rsquo;m guessing that nobody has yet ponied up the cash required to put PostgreSQL through the TPC tests.&lt;/p&gt;

&lt;p&gt;Cheers to the &lt;a href="http://www.osdl.org/"&gt;Open Source Development Labs&lt;/a&gt; for taking on the task of creating a test suite and providing an alternative to the TPC.  Their test suite currently runs with PostgreSQL and &lt;a href="http://www.mysql.com/products/maxdb/"/&gt;SAP DB&lt;/a&gt; (now MaxDB).  Some of the results are un-impressive, 20 TPS on 4xPIII 700MHz, when compared with commercial RDBMS. More interesting are the evaluations of the Linux kernels and file systems.&lt;/p&gt;

</description>
      <pubDate>Tue, 29 Jun 2004 21:59:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:aea7416e55d1d9f048a05fee91219960</guid>
      <author>mop</author>
      <link>/articles/2004/06/29/postgresql-benchmarks</link>
      <category>Linux</category>
      <trackback:ping>/articles/trackback/125</trackback:ping>
    </item>
  </channel>
</rss>
