<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>mbant's technical notes - Scripts &amp; Code</title>
    <link>http://technotes.mbant.de/</link>
    <description>technical stuff</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.3 - http://www.s9y.org/</generator>
    <pubDate>Sun, 06 Jan 2008 21:18:02 GMT</pubDate>

    <image>
        <url>http://technotes.mbant.de/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: mbant's technical notes - Scripts &amp; Code - technical stuff</title>
        <link>http://technotes.mbant.de/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Linker Problems with Matlab on Linux?</title>
    <link>http://technotes.mbant.de/archives/10-Linker-Problems-with-Matlab-on-Linux.html</link>
            <category>Scripts &amp; Code</category>
    
    <comments>http://technotes.mbant.de/archives/10-Linker-Problems-with-Matlab-on-Linux.html#comments</comments>
    <wfw:comment>http://technotes.mbant.de/wfwcomment.php?cid=10</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://technotes.mbant.de/rss.php?version=2.0&amp;type=comments&amp;cid=10</wfw:commentRss>
    

    <author>nospam@example.com (Martin)</author>
    <content:encoded>
    If you&#039;re writing a C/C++ program using Matlab libraries on a linux system you get errors like this if the system isn&#039;t configured properly:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/ld: warning: libut.so, needed by /path/removed/libmx.so, not found (try using -rpath or -rpath-link)&lt;br /&gt;
&lt;br /&gt;
The reason can be found in the ld manpage: libmx.so has more dependencies, but ld can&#039;t find them. The -rpath-link linker switch might be a solution, but Linux systems have a central place for this kind of config: /etc/ld.so.conf.&lt;br /&gt;
&lt;br /&gt;
If you have a directory called /etc/ld.so.conf.d/, create a file there with no other contents than the path to your matlab libs ($MATLAB/bin/glnx86 for i386) and call it matlab.conf or something like that (it needs a .conf suffix!). If this directory does not exists, append a line with this path to /etc/ld.so.conf. Then, re-run ldconfig and your problem should be solved.&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Sun, 06 Jan 2008 22:18:02 +0100</pubDate>
    <guid isPermaLink="false">http://technotes.mbant.de/archives/10-guid.html</guid>
    <category>linker</category>
<category>matlab</category>
<category>programming</category>

</item>
<item>
    <title>Reducing PDF file size</title>
    <link>http://technotes.mbant.de/archives/5-Reducing-PDF-file-size.html</link>
            <category>Scripts &amp; Code</category>
    
    <comments>http://technotes.mbant.de/archives/5-Reducing-PDF-file-size.html#comments</comments>
    <wfw:comment>http://technotes.mbant.de/wfwcomment.php?cid=5</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://technotes.mbant.de/rss.php?version=2.0&amp;type=comments&amp;cid=5</wfw:commentRss>
    

    <author>nospam@example.com (Martin)</author>
    <content:encoded>
    Sometimes, especially when I create PDF files with lots of images, I end up with huge PDF files, sometimes in the gigabyte range, even though the actual images themself were just a couple of megabytes.&lt;br /&gt;
These files aren&#039;t just impractical, but most printers can&#039;t handle them so basically they are useless.&lt;br /&gt;
&lt;br /&gt;
While it&#039;s probably better to tackle the problem where it begins (in my case, the PDF file printer driver) I decided to go for a more &#039;hacky&#039; approach: I wrote a script which cleans and recompresses the PDF files. This is useful because I noticed that quite a lot of PDF files (especially ones I didn&#039;t create myself) are unnecessarily huge and contain PDF errors.&lt;br /&gt;
This script passes the PDFs through all available ghostscript filters until it ends up with a nice new and shiny PDF.&lt;br /&gt;
&lt;br /&gt;
Warning: the process is ressource-consuming, can take a while and will definitely take up some disk space.&lt;br /&gt;
&lt;br /&gt;
By now way do I guarantee for any file loss or damage. USE AT YOUR OWN RISK.&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
&lt;div class=&quot;bash&quot; style=&quot;text-align: left&quot;&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#!/bin/bash&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt; -z $&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;; then&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Usage: cleanpdf infile.pdf [outfile.pdf]&quot;&lt;/span&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066;&quot;&gt;exit&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;fi&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;infile=&lt;/span&gt;$&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;wipe=&lt;/span&gt;false&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt; -z $&lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;; then&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt; no thingy given&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;outfile=&lt;/span&gt;$&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;wipe=&lt;/span&gt;true&amp;lt;br /&amp;gt;&lt;br /&gt;else&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt; -e $&lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;; then&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Error: file $2 already exists, won&#039;t overwrite.&quot;&lt;/span&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #000066;&quot;&gt;exit&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; fi&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;outfile=&lt;/span&gt;$&lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;fi&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;tmpfile1=&lt;/span&gt;tmpfilecleanpdf123131212.ps&amp;lt;br /&amp;gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;tmpfile2=&lt;/span&gt;tmpfilecleanpdf123131412.ps&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Converting to PostScript...&quot;&lt;/span&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;pdf2ps &lt;span style=&quot;color: #0000ff;&quot;&gt;$infile&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$tmpfile1&lt;/span&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Cleaning PostScript...&quot;&lt;/span&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;ps2ps &lt;span style=&quot;color: #0000ff;&quot;&gt;$tmpfile1&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$tmpfile2&lt;/span&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$wipe&lt;/span&gt; = true &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;; then&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Wiping original...&quot;&lt;/span&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; rm &lt;span style=&quot;color: #0000ff;&quot;&gt;$infile&lt;/span&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;fi&amp;lt;br /&amp;gt;&lt;br /&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Converting clean PostScript to PDF...&quot;&lt;/span&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;ps2pdf &lt;span style=&quot;color: #0000ff;&quot;&gt;$tmpfile2&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$outfile&lt;/span&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;rm &lt;span style=&quot;color: #0000ff;&quot;&gt;$tmpfile1&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$tmpfile2&lt;/span&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Done.&quot;&lt;/span&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;&lt;br /&gt;
&lt;/pre&gt; 
    </content:encoded>

    <pubDate>Sat, 23 Dec 2006 18:11:38 +0100</pubDate>
    <guid isPermaLink="false">http://technotes.mbant.de/archives/5-guid.html</guid>
    <category>bash</category>
<category>file size</category>
<category>pdf</category>
<category>script</category>

</item>

</channel>
</rss>
