<rdf:RDF
    xmlns:s='http://snipsnap.org/rdf/snip-schema#'
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xml:base='http://tom.conjective.ch/tomtom/rdf'>
    <s:Snip rdf:about='http://tom.conjective.ch/tomtom/rdf#Unix+Stuff'
         s:cUser='tom'
         s:oUser='tom'
         s:mUser='tom'>
        <s:name>Unix Stuff</s:name>
        <s:content>1 Base64 Encoding a String&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;echo some-string | openssl enc -base64 -e&#xD;&#xA;{code}&#xD;&#xA;Use the -d option to decode.&#xD;&#xA;&#xD;&#xA;1 FTP Login&#xD;&#xA;&#xD;&#xA;If your shell login works but your FTP or secure FTP login doesn&apos;t, check your shell login script and make sure it doesn&apos;t generate any&#xD;&#xA;console output.&#xD;&#xA;&#xD;&#xA;1 Emacs Essentials&#xD;&#xA;&#xD;&#xA;General: Command keys like C-x means Ctrl-x. Mode (meta) keys&#xD;&#xA;like M-x means Meta-x (use ESC, Alt or Windows key as meta key)&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;F10     - Navigate the menus in a text console (ncurses) emacs.&#xD;&#xA;C-x C-c - Exit; allows you to save modified buffers.&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;1 vi Essentials&#xD;&#xA;&#xD;&#xA;Use ESC to put vi in command mode, &apos;i&apos; or &apos;a&apos; to type text.&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;:q      - Exit, no save (add ! to discard changes)&#xD;&#xA;:x      - Save and exit&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;i       - insert text&#xD;&#xA;a       - append text&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;yy      - copy current line&#xD;&#xA;Nyy     - copy N lines (including current one)&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;dd      - delete current line&#xD;&#xA;Ndd     - delete N lines (including current one)&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;p       - paste&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;/string - search for &apos;string&apos; from cursor&#xD;&#xA;/       - repeat search&#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;1 Searching The File System&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;find . -name &quot;filename.*&quot;                (searches for files)&#xD;&#xA;find . -exec grep -H &apos;pattern&apos; &apos;{}&apos; &amp;#92;;   (searches for &apos;pattern&apos;)&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;1 Text Find/Replace in Multiple Files&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;find . -name Root -exec sed -i s/olduser/newuser/g &apos;{}&apos; &amp;#92;;&#xD;&#xA;{code}&#xD;&#xA;Replaces &apos;olduser&apos; with &apos;newuser&apos; in all files named Root under the current directory tree.&#xD;&#xA;&#xD;&#xA;1 Viewing a growing log file&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;tail -f filename&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;1 Running an X11 virtual frame buffer&#xD;&#xA;&#xD;&#xA;Java applications running on servers sometimes require a running X11 environment and a display server they can contact in order to run or function properly. (As an alternative, setting the Java system property java.awt.headless=true usually eliminates this requirement. However, it didn&apos;t in my case.)&#xD;&#xA;&#xD;&#xA;You can start a virtual X11 server with the following command:&#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;Xvfb :any-free-display-number&#xD;&#xA;{code}&#xD;&#xA; &#xD;&#xA;Then do a &#xD;&#xA;{code}&#xD;&#xA;setenv DISPLAY :your-xvfb-display-number.0&#xD;&#xA;{code}&#xD;&#xA;And run your application.&#xD;&#xA;&#xD;&#xA;In a Java application I was running using this approach, the fonts in image files generated by the application were scaled wrongly. The reason for this was a wrong DPI setting of my virtual frame buffer (Xvfb uses the default DPI setting initialized with Xserver on the system). This was 100 DPI in my case and I wasn&apos;t in a position to change that.&#xD;&#xA;&#xD;&#xA;However, I was able to trick Xvfb into returning a DPI value other than 100 when queried by an application. This was possible because the dimension in pixels of the virtual frame buffer was irrelevant to my application (i.e. I could run Xvfb with any screen resolution). The follwing table shows a few possible screen resolutions and resulting DPI values.&#xD;&#xA;{table}&#xD;&#xA;#Pixels|Screen Size (mm)|Screen Size (mm) Rounded|Resulting DPI&#xD;&#xA;1|0.254|0|#DIV/0!&#xD;&#xA;2|0.508|1|51&#xD;&#xA;3|0.762|1|76&#xD;&#xA;4|1.016|1|102&#xD;&#xA;5|1.27|1|127&#xD;&#xA;6|1.524|2|76&#xD;&#xA;7|1.778|2|89&#xD;&#xA;8|2.032|2|102&#xD;&#xA;9|2.286|2|114&#xD;&#xA;10|2.54|3|85&#xD;&#xA;11|2.794|3|93&#xD;&#xA;12|3.048|3|102&#xD;&#xA;13|3.302|3|110&#xD;&#xA;14|3.556|4|89&#xD;&#xA;15|3.81|4|95&#xD;&#xA;16|4.064|4|102&#xD;&#xA;17|4.318|4|108&#xD;&#xA;18|4.572|5|91&#xD;&#xA;19|4.826|5|97&#xD;&#xA;20|5.08|5|102&#xD;&#xA;21|5.334|5|107&#xD;&#xA;22|5.588|6|93&#xD;&#xA;23|5.842|6|97&#xD;&#xA;24|6.096|6|102&#xD;&#xA;25|6.35|6|106&#xD;&#xA;26|6.604|7|94&#xD;&#xA;27|6.858|7|98&#xD;&#xA;28|7.112|7|102&#xD;&#xA;29|7.366|7|105&#xD;&#xA;30|7.62|8|95&#xD;&#xA;31|7.874|8|98&#xD;&#xA;32|8.128|8|102&#xD;&#xA;33|8.382|8|105&#xD;&#xA;34|8.636|9|96&#xD;&#xA;35|8.89|9|99&#xD;&#xA;36|9.144|9|102&#xD;&#xA;37|9.398|9|104&#xD;&#xA;{table}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;As an example, this is what I had to do to have my Java application generate images for a target system with 76 DPIs (see line 3 in the table above, 3x3 in the command means the screen resolution):&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;Xvfb :99 -screen 0 3x3x24 &amp; &#xD;&#xA;&#xD;&#xA;setenv DISPLAY :99.0&#xD;&#xA;&#xD;&#xA;&lt;run my Java application&gt;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;By the way, you can query the properties of your display with the xdpyinfo command. For example:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;xdpyinfo -display :99&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;</s:content>
        <s:mTime>2007-09-03 15:40:51.238</s:mTime>
        <s:cTime>2007-04-26 15:00:31.55</s:cTime>
        <s:comments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='http://tom.conjective.ch/tomtom/rdf#SnipSnap/themes/SnipSnap/css'/>
                <rdf:li rdf:resource='http://tom.conjective.ch/tomtom/rdf#Knoblauch Peperoncini Spaghetti mit Cherry Tomaten und Basilikum'/>
            </rdf:Bag>
        </s:snipLinks>
        <s:attachments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
    </s:Snip>
</rdf:RDF>

