<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>en.credativ blog: Category Tip</title>
    <link rel="alternate" type="text/html" href="http://blog.credativ.com/en/" />
    <link rel="self" type="application/atom+xml" href="http://blog.credativ.com/en/atom.xml" />
    <id>tag:blog.credativ.com,2010-03-05:/en//2</id>
    <updated>2011-06-27T11:29:52Z</updated>
    <subtitle>All about Linux and Open Source</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.34-en</generator>

<entry>
    <title>[Tip] Configuring SSH Jumphosts</title>
    <link rel="alternate" type="text/html" href="http://blog.credativ.com/en/2011/05/tip-configuring-ssh-jumphosts.html" />
    <id>tag:blog.credativ.com,2011:/en//2.161</id>

    <published>2011-05-16T14:27:00Z</published>
    <updated>2011-06-27T11:29:52Z</updated>

    <summary> The System Administrator will often come across a situation where an SSH connection to Host B is only possible by making a detour via SHH to Host A: client -&gt; ssh A -&gt; ssh B To shorten this two-step...</summary>
    <author>
        <name>Roland Wolters</name>
        <uri>http://www.credativ.de</uri>
    </author>
    
        <category term="Linux" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Open Source" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Security" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Tip" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="credativ" label="credativ" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="jumphosts" label="Jumphosts" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="linux" label="Linux" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ssh" label="SSH" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="tip" label="Tip" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.credativ.com/en/">
        <![CDATA[<p><img alt="tux.jpg" src="/de/static/tux.jpg" width="86" height="102" class="mt-image-right" style="float: right; margin: 0 0 20px 20px;" /><br />
The System Administrator will often come across a situation where an SSH connection to Host B is only possible by making a detour via SHH to Host A:<br />
client -> ssh A -> ssh B</p>

<p>To shorten this two-step process, an entry can be made in the <tt>~/.ssh/config</tt> of Host A as "Jumphost", to ensure that this step is always followed in future.</p>
<pre class='brush: text'>
Host Bdirekt
Hostname $IP_von_B
User rwo 
ProxyCommand ssh root@A.intern.lan nc %h %p
</pre><p><br />
In the first row an alias is defined - this can be arbitrary, but some relation to B would make sense.  The second row defines the host name of B - for permissions in every network thereafter, an IP is a good idea as a hostname! The option ProxyCommand defines the underlying Jump function - where access via SSH to A and the pipe of data occurs by means of numerical control.</p>

<p>Where SSH keys are properly allocated, there are no more queries.  A simple <tt>ssh Bdirect</tt> leads directly to host B.</p>

<p>All tips in this blog can be found in the <a href="/en/tip/">Tip Category</a>. Should you need further <a href="http://www.credativ.co.uk/services/support/">Support for Linux</a>, you've come to the right place at credativ.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Changing Windows Internet Shortcut (*.url) files into GNOME desktop files</title>
    <link rel="alternate" type="text/html" href="http://blog.credativ.com/en/2011/02/changing-windows-internet-shortcut-url-files-into-gnome-desktop-files.html" />
    <id>tag:blog.credativ.com,2011:/en//2.197</id>

    <published>2011-02-13T02:12:12Z</published>
    <updated>2011-02-13T03:01:14Z</updated>

    <summary> Recursively finding Windows Internet Shortcut (*.url) files and changing them into GNOME desktop files Over the past few days I have finally converted my wife&apos;s computer from WinXP to Linux (Ubuntu 10.10). One of the many fine points of...</summary>
    <author>
        <name>Joe Conway</name>
        <uri>http://www.credativ.us</uri>
    </author>
    
        <category term="Debian" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Linux" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Open Source" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Tip" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="bashlinuxubuntudebianshelldesktop" label="bash linux ubuntu debian shell desktop" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.credativ.com/en/">
        <![CDATA[<p><img alt="tux.jpg" src="http://blog.credativ.com/en/static/tux.jpg" width="86" height="102" class="mt-image-right" style="float: right; margin: 0 0 20px 20px;" /><br />
<em>Recursively finding Windows Internet Shortcut (*.url) files and changing them into GNOME desktop files</em></p>

<p>Over the past few days I have finally converted my wife's computer from WinXP to Linux (Ubuntu 10.10). One of the many fine points of the negotiation leading to this was that I needed to preserve her <em>many</em> Internet Shortcut files. Since she has literally thousands of them, and they are sprinkled about in many a nested folder, I needed a script that could find them, and create the equivalent GNOME desktop files. The following is my solution. Perhaps not the most elegant way to achieve these ends, but it worked great for me. However I cannot promise this script will not eat your files, so please test and use at your own risk ;-)</p>

<p>Create the following script (e.g. using vi)</p>
<pre class='brush: text'>
vi /usr/local/bin/fix_url.sh
</pre><p></p>

<p>Put the following in fix_url.sh (press "i", and then type or paste):</p>
<pre class='brush: text'>
#!/bin/bash

(
    IFS=$'\n'
    files=$(find . -name *.url)
    for fl in $files; do
        NEWFILE=${fl}.desktop
        cp &quot;${fl}&quot; &quot;${NEWFILE}&quot;
        sed -i 's/InternetShortcut/Desktop\ Entry/g' &quot;${NEWFILE}&quot;
        sed -i '/^\[DEFAULT\]/d' &quot;${NEWFILE}&quot;
        sed -i '/^BASEURL/d' &quot;${NEWFILE}&quot;
        sed -i '/^IconFile/d' &quot;${NEWFILE}&quot;
        sed -i '/^IconIndex/d' &quot;${NEWFILE}&quot;
        sed -i 's/\r$//' &quot;${NEWFILE}&quot;
        echo &quot;Type=Link&quot; &gt;&gt; &quot;${NEWFILE}&quot;
    done
)
</pre><p><br />
Save the file by typing ":x" if you used vi.</p>

<p>Make it executable:</p>
<pre class='brush: text'>
chmod +x /usr/local/bin/fix_url.sh
</pre><p></p>

<p>Test/run the new script. Do this first on an isolated test location, e.g. copy some Windows Internet Shortcut files to /tmp/windows_urls:</p>
<pre class='brush: text'>
cd /tmp
/usr/local/bin/fix_url.sh
</pre><p></p>

<p>Check out the resulting *.desktop files. Verify they look correct, and that they actually work when clicked from Nautilus, etc.</p>

<p>If completely satisfied, change to the root of the real directory tree and re-run the script.</p>

<p>When you are all finished, the original *.url files are still hanging around. If you want to get rid of them (again <em>test first</em>):</p>
<pre class='brush: text'>
cd /tmp
find . -name *.url -delete
</pre><p></p>

<p>Hope this helps someone else!<br />
</p>]]>
        
    </content>
</entry>

<entry>
    <title>[Tip] PostgreSQL Tip of the Day - which configs require restart?</title>
    <link rel="alternate" type="text/html" href="http://blog.credativ.com/en/2010/09/tip-postgresql-tip-of-the-day---which-configs-require-restart.html" />
    <id>tag:blog.credativ.com,2010:/en//2.190</id>

    <published>2010-09-11T01:12:19Z</published>
    <updated>2010-09-11T01:32:34Z</updated>

    <summary> I&apos;ve been asked on at least three separate occasions lately how to know if changing a particular postgresql.conf item requires a restart, or a reload, of PostgreSQL. Here is my quick and dirty favorite way to answer this question:...</summary>
    <author>
        <name>Joe Conway</name>
        <uri>http://www.credativ.us</uri>
    </author>
    
        <category term="PostgreSQL" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Tip" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="credativ" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="plpgsql" label="plpgsql" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="postgresql" label="PostgreSQL" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="sequences" label="sequences" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.credativ.com/en/">
        <![CDATA[<p><img alt="postgreslogo.png" src="http://blog.credativ.com/en/static/postgreslogo.png" width="97" height="100" class="mt-image-right" style="float: right; margin: 0 0 20px 20px;" /><br />
I've been asked on at least three separate occasions lately how to know if changing a particular postgresql.conf item requires a restart, or a reload, of PostgreSQL. Here is my quick and dirty favorite way to answer this question:<br />
<br/></p>
<pre class='brush: sql'>
-- configs requiring postgresql restart
select name, setting, context
  from pg_settings where context = 'postmaster';

-- configs requiring postgresql reload
select name, setting, context
 from pg_settings where context = 'sighup';
</pre>]]>
        
    </content>
</entry>

<entry>
    <title>[Tip] PostgreSQL Tip of the Day - mass modification of sequences</title>
    <link rel="alternate" type="text/html" href="http://blog.credativ.com/en/2010/07/postgresql-tip-of-the-day---mass-modification-of-sequences.html" />
    <id>tag:blog.credativ.com,2010:/en//2.180</id>

    <published>2010-07-07T21:34:07Z</published>
    <updated>2010-12-07T12:45:11Z</updated>

    <summary>Someone posted a dilemma to the pgsql-sql list today that involved many if not all of his sequences getting out of sync with their respective &quot;serial&quot; columns. In other words, something like &quot;SELECT max(id) FROM sometable&quot; yields 42, but the...</summary>
    <author>
        <name>Joe Conway</name>
        <uri>http://www.credativ.us</uri>
    </author>
    
        <category term="Open Source" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="PostgreSQL" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Tip" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="credativ" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="plpgsql" label="plpgsql" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="postgresql" label="PostgreSQL" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="sequences" label="sequences" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.credativ.com/en/">
        <![CDATA[<p><img alt="postgreslogo.png" src="/de/static/postgreslogo.png" width="97" height="100" class="mt-image-right" style="float: right; margin: 0 0 20px 20px;" />Someone posted a dilemma to the pgsql-sql list today that involved many if not all of his sequences getting out of sync with their respective "serial" columns. In other words, something like "SELECT max(id) FROM sometable" yields 42, but the sequence nextval for sometable.id is currently set to 36. This is obviously bad (for reasons left as an exercise for the reader). So besides trying to figure out how the database ended up in this state, he needed a script to reset all of his sequences to the correct next value.</p>

<p>I had run into a similar need not too long ago. Namely, when setting up multi-master replication with Bucardo you need your sequences to draw different values on either master so as not to conflict. One solution is to set up all your sequences to jump by 2, and use even numbers on one master and odd numbers on the other. Again, a script makes this easier to deal with, and I had developed one for this situation. So I modified it for the problem mentioned above.</p>

<p>Both versions follow:<br />
</p>
<pre class='brush: sql'>-- create &quot;odd&quot; and &quot;even&quot; sequences in multi-master scenario
CREATE OR REPLACE FUNCTION adjust_seqs(namespace text, starteven bool)
  RETURNS text AS $$
DECLARE
  rec         record;
  startval   bigint;
  sql          text;
  fqname  text;
BEGIN
  FOR rec in EXECUTE 'select relname from pg_class where relkind = ''S''
                      and relnamespace = (select oid from pg_namespace
                      where nspname=''' || namespace || ''')' LOOP
    fqname :=  namespace || '.' ||  rec.relname;
    IF starteven THEN
      EXECUTE 'SELECT ((last_value / 2) * 2) + 2 from ' || fqname INTO startval;
    ELSE
      EXECUTE 'SELECT ((last_value / 2) * 2) + 1 from ' || fqname INTO startval;
    END If;
    sql := 'ALTER SEQUENCE ' || fqname || ' INCREMENT BY 2 RESTART WITH ' || startval;
    EXECUTE sql;
    RAISE NOTICE '%', sql;
  END LOOP;
  RETURN 'OK';
END;
$$ LANGUAGE plpgsql STRICT;
SELECT adjust_seqs('public', true);  -- in master1 (even)
SELECT adjust_seqs('public', false); -- in master2 (odd)
</pre><p><br />
</p>
<pre class='brush: sql'>-- update sequences that have gotten out-of-sync with the
-- PK field for which they normally provide the default
CREATE OR REPLACE FUNCTION adjust_seqs(namespace text)
  RETURNS text AS $$
DECLARE
  rec           record;
  startval     bigint;
  sql            text;
  seqname  text;
BEGIN
  FOR rec in EXECUTE 'select table_name, column_name, column_default
                      from information_schema.columns
                      where table_schema = ''' || namespace || '''
                      and column_default like ''nextval%''' LOOP

    seqname := pg_get_serial_sequence(rec.table_name, rec.column_name);
    sql := 'select max(' || rec.column_name || ') + 1 from ' || rec.table_name;
    EXECUTE sql INTO startval;
    IF startval IS NOT NULL THEN
      sql := 'ALTER SEQUENCE ' || seqname || ' RESTART WITH ' || startval;
      EXECUTE sql;
      RAISE NOTICE '%', sql;
    END IF;
  END LOOP;
  RETURN 'OK';
END;
$$ LANGUAGE plpgsql STRICT;
select adjust_seqs('public');
</pre><p></p>

<p>Neither of these is heavily tested, and both make certain assumptions, so please test and modify to suit your own needs. Caveat emptor!</p>]]>
        
    </content>
</entry>

<entry>
    <title>[Tip] PostgreSQL Tip of the Day - loading a PostGIS database dump</title>
    <link rel="alternate" type="text/html" href="http://blog.credativ.com/en/2010/07/postgresql-tip-of-the-day---loading-a-postgis-database-dump.html" />
    <id>tag:blog.credativ.com,2010:/en//2.179</id>

    <published>2010-07-07T01:10:01Z</published>
    <updated>2010-12-07T12:44:00Z</updated>

    <summary>I was given a Postgres database dump to analyze today created by &quot;pg_dump -Fc&quot;. The source database included PostGIS 1.3.x extensions. I&apos;m not sure if this is standard with PostGIS, but the related database objects were all dumped with a...</summary>
    <author>
        <name>Joe Conway</name>
        <uri>http://www.credativ.us</uri>
    </author>
    
        <category term="Open Source" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="PostgreSQL" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Tip" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="credativ" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="postgis" label="PostGIS" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="postgresql" label="PostgreSQL" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.credativ.com/en/">
        <![CDATA[<p>I was given a Postgres database dump to analyze today created by "pg_dump -Fc". The source database included PostGIS 1.3.x extensions. I'm not sure if this is standard with PostGIS, but the related database objects were all dumped with a hard-coded library path, specifically <tt>/usr/lib/postgresql/8.3/lib</tt>. On my machine, I have many PostgreSQL clusters (essentially at least one for every supported branch dating back to 7.3.x), but they are not located under <tt>/usr/lib/postgresql</tt>.</p>

<p>As such, I needed a quick fix. To wit:<br />
</p>
<pre class='brush: sql'>pg_restore database.with.postgis.tgz &gt; db.w.postgis.dmp
sed 's|/usr/lib/postgresql/8.3/lib|$libdir|g' &lt; db.w.postgis.dmp &gt; db.w.postgis.dmp.new
</pre><p></p>

<p>The first line extracts the dump file from the compressed "custom" format into a human readable text SQL file. The second line replaces the hard-coded library path with the special PostgreSQL $libdir variable. This will always point to the correct location for any given PostgreSQL cluster. You can always discover where this is by running:<br />
<pre>pg_config --libdir</pre></p>]]>
        
    </content>
</entry>

<entry>
    <title>[Tip] Auto rotate images</title>
    <link rel="alternate" type="text/html" href="http://blog.credativ.com/en/2010/03/tip-auto-rotate-images.html" />
    <id>tag:blog.credativ.com,2010:/en//2.141</id>

    <published>2010-03-19T13:55:47Z</published>
    <updated>2010-03-19T13:52:15Z</updated>

    <summary>Many digital cameras today do not just save an image, but also save various meta data in the Exif standard. This data includes information about the position of the camera when the image was taken (such as vertical or horizontal)....</summary>
    <author>
        <name>Roland Wolters</name>
        <uri>http://www.credativ.de</uri>
    </author>
    
        <category term="Debian" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Linux" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Open Source" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Tip" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="camera" label="camera" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="digital" label="digital" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="exif" label="exif" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="exiftran" label="exiftran" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="fbida" label="fbida" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="image" label="image" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="rotate" label="rotate" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.credativ.com/en/">
        <![CDATA[<p><img alt="bash.png" src="/de/static/bash.png" width="90" height="72" class="mt-image-right" style="float: right; margin: 0 0 20px 20px;" />Many digital cameras today do not just save an image, but also save various meta data in the <a href="http://en.wikipedia.org/wiki/Exchangeable_Image_File_Format">Exif</a> standard.  This data includes information about the position of the camera when the image was taken (such as vertical or horizontal). However, some image programs use this data to rotate the image when displaying it while others don't, leaving the user to face inconsistent behaviour.</p>

<p>This can be fixed with the tool <a href="http://linux.bytesex.org/fbida/">exiftran</a>; it automatically rotates all images according to the Exif data, which it discards afterwards. It is also very easy to use for mass conversion:<br />
</p>
<pre class='brush: plain'>
# apt-get install exiftran
$ find -print0 | xargs -0 exifautotran
</pre><p></p>

<p>This tool might be shipped by other distributions under a different name. Fedora, for example, calls it <tt>fbida</tt>.</p>]]>
        
    </content>
</entry>

<entry>
    <title>[Tip] Modifying favorites in rekonq</title>
    <link rel="alternate" type="text/html" href="http://blog.credativ.com/en/2010/03/tip-modifying-favorites-in-rekonq.html" />
    <id>tag:platon.credativ.com,2010:/en//2.124</id>

    <published>2010-03-01T17:08:10Z</published>
    <updated>2010-03-05T11:42:20Z</updated>

    <summary>Currently I am testing the browser rekonq, a WebKit based KDE browser which is handled as the next KDE default browser by some. If that might happen or not is a question best left to the future, but the browser...</summary>
    <author>
        <name>Roland Wolters</name>
        <uri>http://www.credativ.de</uri>
    </author>
    
        <category term="KDE" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Open Source" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Tip" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://blog.credativ.com/en/">
        <![CDATA[<img alt="klogo-official-oxygen-128x128.png" src="/en/static/klogo-official-oxygen-128x128.png" width="100" height="100" class="mt-image-right" style="float: right; margin: 0 0 20px 20px;" />Currently I am testing the browser <a href="http://rekonq.sourceforge.net/">rekonq</a>, a WebKit based KDE browser which is handled as the next KDE default browser by some. If that might happen or not is a question best left to the future, but the browser itself has some nice features in the current <a href="http://adjamblog.wordpress.com/2010/02/11/rekonq-0-4-beta/">version 0.4 beta</a>: kwallet integration, addblock, plugin support, etc.
<br />
<br />
However, with the current git checkout the favorites management is not working properly: on <a href="about:favorites">about:favorites</a> you can easily delete the favorites, but you cannot add new ones or manage them at all. But there is still the config file <tt>$HOME/.kde/share/config/rekonqrc</tt>, all you have to do is to change the entries below "NewTabPage": a comma separated list shows first the URLs and then the comments for the URLs, and is failry simple to edit:
<pre class='brush: plain'>
[NewTabPage]
previewNames=http://www.heise.de,http://www.spiegel.de,http://www.tagesschau.de,,,,,
previewUrls=heise.de,spiegel.de,tagesschau.de,,,,,
</pre>

This is one of the things that rekonq still has some problems with, and it shows that rekonq is still in heavy development. But it is already promising and I do wonder whether it might be a real alternative to other browsers for KDE users.]]>
        
    </content>
</entry>

<entry>
    <title>[Tip] .htaccess example</title>
    <link rel="alternate" type="text/html" href="http://blog.credativ.com/en/2010/02/tip-htaccess-example.html" />
    <id>tag:platon.credativ.com,2010:/en//2.115</id>

    <published>2010-02-24T16:09:03Z</published>
    <updated>2010-06-08T10:35:38Z</updated>

    <summary>One of the fastest ways to restrict the access to a web server path is to use .htaccess files. These are placed in the to-be-restricted path and contain the information how to restrict the access. A simple example is given...</summary>
    <author>
        <name>Roland Wolters</name>
        <uri>http://www.credativ.de</uri>
    </author>
    
        <category term="Debian" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Open Source" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Tip" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="credativ" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://blog.credativ.com/en/">
        <![CDATA[<img alt="bash.png" src="https://platon.credativ.com:2564/en/static/bash.png" width="90" height="72" class="mt-image-right" style="float: right; margin: 0 0 20px 20px;" />One of the fastest ways to restrict the access to a web server path is to use <tt>.htaccess</tt> files. These are placed in the to-be-restricted path and contain the information how to restrict the access. A simple example is given below:
<pre class='brush: plain'>
AuthType Digest
AuthName &quot;SecretDir&quot;
AuthUserFile /etc/apache2/passwords/secretdir.htpasswd
Require valid-user
</pre>
The <tt>.htpasswd</tt> file contains the user login data for accessing the path and thus must not be placed in a path which is exported by the web server! It is created using its own command line tool:
<code>htdigest -c /etc/apache2/passwords/secretdir.htpasswd SecretDir $USERNAME</code>
Note, however, that the <tt>Directory</tt> part of the web site configuration (for example in <emtt/etc/apache2/sites-enabled</tt>) must contain the option <tt>AllowOverride AuthConfig</tt>. Also, since this examples uses the AuthType Digest, make sure the module <tt>mod_auth_digest</tt> is loaded.
<br />
<br />
Further information and a more detailed configuration explanation is given in the article <a href="http://httpd.apache.org/docs/2.2/howto/auth.html">Authentication, Authorization and Access Control</a> in Apache's documentation.]]>
        
    </content>
</entry>

<entry>
    <title>[Tip] activating 256 colors support in vim</title>
    <link rel="alternate" type="text/html" href="http://blog.credativ.com/en/2010/02/tipp-activating-256-colors-support-in-vim.html" />
    <id>tag:platon.credativ.com,2010:/en//2.110</id>

    <published>2010-02-16T11:23:15Z</published>
    <updated>2010-03-05T13:34:21Z</updated>

    <summary>One of the many advantages of vim is the possibility to use syntax highlighting: different terms and chars are displayed in different colors according to their meaning and function.The more colours are available, the better - however, in many cases...</summary>
    <author>
        <name>Roland Wolters</name>
        <uri>http://www.credativ.de</uri>
    </author>
    
        <category term="Linux" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Open Source" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Tip" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://blog.credativ.com/en/">
        <![CDATA[<img alt="bash.png" src="https://platon.credativ.com:2564/en/static/bash.png" width="90" height="72" class="mt-image-right" style="float: right; margin: 0 0 20px 20px;" />One of the many advantages of vim is the possibility to use syntax highlighting: different terms and chars are displayed in different colors according to their meaning and function.The more colours are available, the better - however, in many cases vim falls back to 8 or 16 colors by default. This can be quickly changed with an entry in <tt>~/.vimrc</tt>:
<pre class='brush: plain'>
if &amp;term!=&quot;xterm&quot;
   set t_Co=256            &quot; use 265 colors in vim
   colorscheme desert256   &quot; an appropriate color scheme
endif
</pre>
With this configuration, vim from now on uses 256 colors - and the second line makes sure you a color scheme which actually uses that many colors: <a href="http://www.vim.org/scripts/script.php?script_id=1243">desert256</a> - but make sure you copy the color scheme file to <tt>~/.vim/colors/</tt> before! The if-query ensures that the configuration is not loaded on ttys where you usually don't have 256 colors.
<br />
<br />
By the way: an overview of all kinds of color schemes with "screenshots" for different programming languages can be found at the <a href="http://code.google.com/p/vimcolorschemetest/">vimcolorschemetest</a> project web page.]]>
        
    </content>
</entry>

</feed>

