<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>edelblog</title>
    <link rel="alternate" type="text/html" href="http://edelblog.ch/" />
    <link rel="self" type="application/atom+xml" href="http://edelblog.ch/atom.xml" />
    <id>tag:edelblog.ch,2009-05-25://1</id>
    <updated>2010-05-29T09:51:08Z</updated>
    
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.23-en</generator>

<entry>
    <title>encrypted usb sticks and hard drives step by step</title>
    <link rel="alternate" type="text/html" href="http://edelblog.ch/2010/05/encrypted-usb-sticks-and-hard-drives-step-by-step.html" />
    <id>tag:edelblog.ch,2010://1.7</id>

    <published>2010-05-22T21:22:08Z</published>
    <updated>2010-05-29T09:51:08Z</updated>

    <summary>How to create an encrypted partition on an usb stick or usb harddrive in 6 steps: Partition the stick/hard drive (we assume it is located under /dev/sdb) fdisk /dev/sdb Setup the encrypted partition with cryptsetup cryptsetup -c aes-cbc-essiv:sha256 -s 256...</summary>
    <author>
        <name>hp</name>
        <uri>http://edelblog.ch</uri>
    </author>
    
        <category term="Linux" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Step by step" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="cryptsetupusb" label="cryptsetup usb" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://edelblog.ch/">
        <![CDATA[<p>How to create an encrypted partition on an usb stick or usb harddrive in 6 steps:</p>

<ol>
<li><p>Partition the stick/hard drive (we assume it is located under /dev/sdb)</p>

<p>fdisk /dev/sdb</p></li>
<li><p>Setup the encrypted partition with cryptsetup </p>

<p>cryptsetup -c aes-cbc-essiv:sha256 -s 256 luksFormat /dev/sdb1</p></li>
<li><p>Optionally add aditional keys</p>

<p>cryptsetup luksAddKey /dev/sdb1</p></li>
<li><p>Open the container</p>

<p>cryptsetup luksOpen /dev/sdb1 some_name</p></li>
<li><p>Create the file system</p>

<p>mkfs.ext3 -L label -m 0 /dev/mapper/some_name</p></li>
<li><p>Close the container</p>

<p>cryptsetup luksClose some_name</p></li>
</ol>
]]>
        

    </content>
</entry>

<entry>
    <title>Solaris 10 authentication against openldap</title>
    <link rel="alternate" type="text/html" href="http://edelblog.ch/2009/12/solaris-10-authentication-against-openldap.html" />
    <id>tag:edelblog.ch,2009://1.6</id>

    <published>2009-12-22T14:32:15Z</published>
    <updated>2010-01-05T15:24:33Z</updated>

    <summary>Here is a simple recipe, to authenticate users against an LDAP directory, using the native ldap client of Solaris 10....</summary>
    <author>
        <name>hp</name>
        <uri>http://edelblog.ch</uri>
    </author>
    
        <category term="Solaris" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Step by step" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="System Administration" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="ldap" label="LDAP" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://edelblog.ch/">
        <![CDATA[<p>Here is a simple recipe, to authenticate users against an LDAP directory, using the native ldap client of Solaris 10. </p>
]]>
        <![CDATA[<p>Stop ldapclient and nscd</p>

<pre><code>/etc/init.d/ldap.client stop
/etc/init.d/nscd stop
</code></pre>

<p>Add &#8220;ldap&#8221; to &#8220;passwd&#8221; and &#8220;groups&#8221; in /etc/nsswitch.conf, modify <span class="mt-enclosure mt-enclosure-file" style="display: inline;"><a href="http://edelblog.ch/solaris/pam.conf">/etc/pam.conf</a></span> and install <span class="mt-enclosure mt-enclosure-file" style="display: inline;"><a href="http://edelblog.ch/solaris/ldap_client_file">/var/ldap/ldap<em>client</em>file</a></span>. Create /var/ldap/ldap<em>client</em>cred of the form</p>

<pre><code>NS_LDAP_BINDDN= cn=admin,dc=ifi,dc=uzh,dc=ch
NS_LDAP_BINDPASSWD= {NS1}*****************
</code></pre>

<p>After restarting nscd and ldapclient</p>

<pre><code>/etc/init.d/ldap.client start
/etc/init.d/nscd start
</code></pre>

<p>ldaplist should already yield a list of users defined in LDAP and &#8220;id&#8221; should be able to identify them.</p>

<p>All is left is to create the certificate database for ldapclient. Use the <a href="http://www.mozilla.org/projects/security/pki/nss/tools/certutil.html">certutil</a> to create it and add the RootCA of your LDAP server certificate</p>

<pre><code>certutil -A -n certname.pem -t CT -d /var/ldap -i certname.pem
</code></pre>

<p>Now also login should work.</p>
]]>
    </content>
</entry>

<entry>
    <title>working with kvm images</title>
    <link rel="alternate" type="text/html" href="http://edelblog.ch/2009/10/working-with-kvm-images.html" />
    <id>tag:edelblog.ch,2009://1.5</id>

    <published>2009-10-09T20:12:23Z</published>
    <updated>2009-10-11T20:09:15Z</updated>

    <summary>A collection of short recipies on how to enlarge mount kvm images....</summary>
    <author>
        <name>hp</name>
        <uri>http://edelblog.ch</uri>
    </author>
    
        <category term="Linux" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Step by step" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="System Administration" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="kvm" label="kvm" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://edelblog.ch/">
        <![CDATA[<p>A collection of short recipies on how to</p>

<ul>
<li>enlarge</li>
<li>mount</li>
</ul>

<p><a href="http://www.linux-kvm.org/page/Main_Page">kvm</a> images.</p>
]]>
        <![CDATA[<p><strong>How to enlarge a kvm image</strong></p>

<ol>
<li>Stop the kvm maschine.</li>
<li><p>Convert the kvm image to raw format if necessary.</p>

<p>qemu-img convert -O raw original.img raw.img</p></li>
<li><p>Make a backup copy of the image.</p></li>
<li><p>Enlarge the raw image.</p>

<p>dd if=/dev/zero of=raw.img bs=1 count=0 seek=[size in]GB</p></li>
<li><p>Attach the enlarged image to a loop device.</p>

<p>losetup /dev/loop0 raw.img</p></li>
<li><p>Use </p>

<p>fdisk /dev/loop0</p>

<p>to create a new partition or enlarge an existing one to accomodate the additional disk capacity.</p></li>
<li><p>Boot the machine using the new image.</p></li>
<li><p>Log in to the machine and start up lvm. Either add the new partition as a new physical volume (pvcreate) and add it to a volume group (vgextend) or in case an existing partition was enlarges use</p>

<p>lvm> pvresize /dev/vda2</p>

<p>and add the newly available space to logical volumes</p>

<p>lvm> lvresize -L +511.02G /dev/philipp/home</p></li>
<li><p>Enlarge the filesystem (ext2/3).</p>

<p>resize2fs /dev/philipp/home</p></li>
</ol>
]]>
    </content>
</entry>

<entry>
    <title>git step by step</title>
    <link rel="alternate" type="text/html" href="http://edelblog.ch/2009/06/git-step-by-step.html" />
    <id>tag:edelblog.ch,2009://1.4</id>

    <published>2009-06-10T12:00:10Z</published>
    <updated>2009-10-09T20:12:09Z</updated>

    <summary>This article is a collection of notes on how I use git. It is mainly intended for my personal use. If you want to learn more about git, you should better read the tutorial, the manual or gitmagic....</summary>
    <author>
        <name>hp</name>
        <uri>http://edelblog.ch</uri>
    </author>
    
        <category term="Linux" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Step by step" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="git" label="git" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://edelblog.ch/">
        <![CDATA[<p>This article is a collection of notes on how I use <a href="http://git-scm.com/">git</a>. It is mainly intended for my personal use. If you want to learn more about git, you should better read the <a href="http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html">tutorial</a>, the <a href="http://www.kernel.org/pub/software/scm/git/docs/user-manual.html">manual</a> or <a href="http://www-cs-students.stanford.edu/~blynn/gitmagic/">gitmagic</a>.</p>
]]>
        <![CDATA[<p><strong>Global configuration</strong>
These settings have to be done once per machine.</p>

<pre><code>git config --global user.name 'Hanspeter Kunz'
git config --global user.email 'hp@edelkunz.ch'
</code></pre>

<p>More to follow&#8230;</p>
]]>
    </content>
</entry>

<entry>
    <title>logcheck step by step</title>
    <link rel="alternate" type="text/html" href="http://edelblog.ch/2009/06/logcheck-step-by-step.html" />
    <id>tag:edelblog.ch,2009://1.3</id>

    <published>2009-06-10T11:31:01Z</published>
    <updated>2009-07-28T12:40:02Z</updated>

    <summary>This step by step recipe is probably only interesting to myself. It tells me the procedure how to get logcheck from git, develop and test its rules, upload the modifications back to the repository, and build an updated debian package...</summary>
    <author>
        <name>hp</name>
        <uri>http://edelblog.ch</uri>
    </author>
    
        <category term="Debian" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Step by step" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="git" label="git" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="logcheck" label="logcheck" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="syslog" label="syslog" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://edelblog.ch/">
        <![CDATA[<p>This step by step recipe is probably only interesting to myself. It tells me the procedure how to </p>

<ul>
<li>get <a href="http://logcheck.org/">logcheck</a> from git, </li>
<li>develop and test its rules, </li>
<li>upload the modifications back to the repository, and</li>
<li>build an updated <a href="http://www.debian.org/">debian</a> package</li>
</ul>

<p>If you&#8217;re you want to help developing logcheck yourself, you probably better read <a href="git clone git://git.debian.org/git/logcheck/logcheck.git">this</a>. </p>
]]>
        <![CDATA[<p><strong>Get or update logcheck from git</strong></p>

<p>Before starting, get logcheck from git</p>

<pre><code>git clone git://git.debian.org/git/logcheck/logcheck.git
</code></pre>

<p>or bring it to current state</p>

<pre><code>git pull --rebase
</code></pre>

<p>N.B. Browse the the git repository <a href="http://git.debian.org/?p=logcheck/logcheck.git;a=summary">online</a>. </p>

<p><strong>Develop and test rules</strong></p>

<p>Let&#8217;s say we want to filter out message like</p>

<pre><code>Sep 16 23:26:30 seamus deliver(vmail): msgid=3ee0701c9180f$a9da4580$0201a8c0@D9MCN291: saved mail to INBOX
</code></pre>

<p>As deliver is part of dovecot, the file were rule has to be added or modified is</p>

<pre><code>rulefiles/linux/ignore.d.server/dovecot
</code></pre>

<p>Check <a href="http://logcheck.org/docs/README.logcheck-database">README.logcheck-database</a> in case it is not clear where to look for or put the rule.
To test if the message is not already filtered (because somebody else wrote a rule) do</p>

<pre><code>egrep -v -f rulefiles/linux/ignore.d.server/dovecot
</code></pre>

<p>and paste the message or, alternatively, use </p>

<pre><code>egrep -v "[rule]"
</code></pre>

<p>to test the rule directly. If the pasted message is echoed, it is not filtered. Thus, add or modify a rule, until the rule fits. </p>

<p>Add an entry to debian/changelog with</p>

<pre><code>dch -a
</code></pre>

<p>(leave out the -a to bump the version number) and commit both the rulefile and the changelog with</p>

<pre><code>git add rulefiles/linux/ignore.d.server/dovecot debian/changelog
debcommit -e
</code></pre>

<p><strong>Upload the modifications back to the repository</strong></p>

<p>When satisfied, push the changes to the remote repository</p>

<pre><code>git push
</code></pre>

<p><strong>Build an updated debian package</strong></p>
]]>
    </content>
</entry>

</feed>
