<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>syslog.warten.de</title>
	<atom:link href="http://syslog.warten.de/feed/" rel="self" type="application/rss+xml" />
	<link>http://syslog.warten.de</link>
	<description></description>
	<lastBuildDate>Sat, 17 Dec 2011 20:19:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Fetch IP addresses of Pingdom&#8217;s probe servers</title>
		<link>http://syslog.warten.de/2011/12/fetch-ip-addresses-of-pingdoms-probe-servers/</link>
		<comments>http://syslog.warten.de/2011/12/fetch-ip-addresses-of-pingdoms-probe-servers/#comments</comments>
		<pubDate>Sun, 11 Dec 2011 02:16:36 +0000</pubDate>
		<dc:creator>sw</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[pingdom]]></category>
		<category><![CDATA[regex]]></category>

		<guid isPermaLink="false">http://syslog.warten.de/?p=396</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<pre class="brush: plain; title: ; notranslate">
wget --quiet -O- https://www.pingdom.com/rss/probe_servers.xml | perl -nle 'print $1 if /IP: (([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5]));/'
</pre>
]]></content:encoded>
			<wfw:commentRss>http://syslog.warten.de/2011/12/fetch-ip-addresses-of-pingdoms-probe-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install MGSE on other distributions than Linux Mint</title>
		<link>http://syslog.warten.de/2011/12/install-mgse-on-other-distributions-than-linux-mint/</link>
		<comments>http://syslog.warten.de/2011/12/install-mgse-on-other-distributions-than-linux-mint/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 19:15:08 +0000</pubDate>
		<dc:creator>sw</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[gnome3]]></category>
		<category><![CDATA[linux mint]]></category>
		<category><![CDATA[mgse]]></category>

		<guid isPermaLink="false">http://syslog.warten.de/?p=391</guid>
		<description><![CDATA[The friendly guys from Linux Mint wrote some Gnome Shell extentions which make Gnome 3 feel more like Gnome 2. The good thing is that you can benefit from that even if you are using a different distribution. First of &#8230; <a href="http://syslog.warten.de/2011/12/install-mgse-on-other-distributions-than-linux-mint/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The friendly guys from <a href="http://linuxmint.com/">Linux Mint</a> wrote some Gnome Shell extentions which make Gnome 3 feel more like Gnome 2. The good thing is that you can benefit from that even if you are using a different distribution. First of all, we will install the <a href="https://github.com/linuxmint/MGSE">Linux Mint Shell Extensions for Gnome 3 (MGSE)</a>.</p>
<pre class="brush: plain; title: ; notranslate">
$ git clone https://github.com/linuxmint/MGSE.git
$ cd MGSE/
$ ./test
</pre>
<p>To make the Gnome Shell load the new extentions, reload Gnome Shell by hitting <code>ALT-F2</code> and executing <code>r</code>.</p>
<p>Use <code>gnome-tweak-tool</code> to activate the extentions you want.</p>
]]></content:encoded>
			<wfw:commentRss>http://syslog.warten.de/2011/12/install-mgse-on-other-distributions-than-linux-mint/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solutions for Tour of Go exercises</title>
		<link>http://syslog.warten.de/2011/11/solutions-for-tour-of-go-exercises/</link>
		<comments>http://syslog.warten.de/2011/11/solutions-for-tour-of-go-exercises/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 08:55:18 +0000</pubDate>
		<dc:creator>sw</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[go]]></category>
		<category><![CDATA[golang]]></category>

		<guid isPermaLink="false">http://syslog.warten.de/?p=369</guid>
		<description><![CDATA[I am learning Go and the Tour of Go, an interactive tutorial, is a good resource to start with. At the end of each section is a series of exercises for the reader to complete. Unfortunately, there are no example &#8230; <a href="http://syslog.warten.de/2011/11/solutions-for-tour-of-go-exercises/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I am learning <a href="http://golang.org/">Go</a> and the <a href="http://tour.golang.org/">Tour of Go</a>, an interactive tutorial, is a good resource to start with. At the end of each section is a series of exercises for the reader to complete.</p>
<p>Unfortunately, there are no example solutions for those exercises, so its hard to get a hint if you are stuck. Therefore I post my solutions here. I do not think they are the best way to solve the problems in Go (as I said, I am learning too) but code is compiling and it is doing what it should. You are welcome to comment with your solutions and code improvements.</p>
<ul>
<li>
<a href="http://tour.golang.org/#44">Exercise: Loops and Functions</a></p>
<pre class="brush: plain; title: ; notranslate">
package main

import (
	&quot;fmt&quot;
	&quot;math&quot;
)

func Sqrt(x float64) float64 {
    var z, d float64 = x, 1
    for d &gt; 1e-15 {
        z0 := z
        z = z-(z*z-x)/(2*z)
        d = z-z0
        if d &lt; 0 {
            d = -d
        }
    }
    return z
}

func main() {
	fmt.Println(Sqrt(2))
	fmt.Println(math.Sqrt(2))
}
</pre>
</li>
<li>
<a href="http://tour.golang.org/#45">Exercise: Maps</a></p>
<pre class="brush: plain; title: ; notranslate">
package main

import (
	&quot;strings&quot;
	&quot;tour/wc&quot;
)

func WordCount(s string) map[string]int {
	m:=make(map[string]int)
	for _, w:=range strings.Fields(s) {
		m[w]++
	}
	return m
}

func main() {
	wc.Test(WordCount)
}
</pre>
</li>
<li>
<a href="http://tour.golang.org/#46">Exercise: Slices</a></p>
<pre class="brush: plain; title: ; notranslate">
package main

import &quot;tour/pic&quot;

func Pic(dx, dy int) [][]uint8 {
    mat := make([][]uint8, dx)
    for i := range mat {
        mat[i] = make([]uint8, dy)
	for j := range mat[i] {
	    mat[i][j]=uint8(i^j)
	}
    }
    return mat
}

func main() {
	pic.Show(Pic)
}
</pre>
</li>
<li>
<a href="http://tour.golang.org/#47">Exercise: Fibonacci closure</a></p>
<pre class="brush: plain; title: ; notranslate">
package main

import &quot;fmt&quot;

// fibonacci is a function that returns
// a function that returns an int.
func fibonacci() func() int {
	var a, b, count int = 0, 1, 0
	return func() int {
		switch count {
		case 0:  count++
			 return a
		case 1:  count++
			 return b
		}
		sum:=a+b
		a=b
		b=sum
		return sum
	}
}

func main() {
	f := fibonacci()
	for i := 0; i &lt; 10; i++ {
		fmt.Println(f())
	}
}
</pre>
</li>
<li>
<a href="http://tour.golang.org/#48">Advanced Exercise: Complex cube roots</a></p>
<pre class="brush: plain; title: ; notranslate">
package main

import (
	&quot;fmt&quot;
	&quot;math&quot;
	&quot;cmath&quot;
)

func Cbrt(x complex128) complex128 {
    var z complex128 = x
    for i:=0; i&lt;10; i++ {
        z = z-(z*z*z-x)/(3*z*z)
    }
    return z
}

func main() {
	fmt.Println(Cbrt(2))
	fmt.Println(math.Cbrt(2))
	fmt.Println(cmath.Pow( Cbrt(2), 3 ))
	fmt.Println(math.Pow( math.Cbrt(2), 3 ))
}
</pre>
</li>
<li>
<a href="http://tour.golang.org/#58">Exercise: Errors</a></p>
<pre class="brush: plain; title: ; notranslate">
package main

import (
	&quot;fmt&quot;
	&quot;os&quot;
)

type ErrNegativeSqrt float64

func (e ErrNegativeSqrt) String() string {
    return fmt.Sprintf(
    	&quot;cannot Sqrt negative number: %v&quot;,
	float64(e))
}

func Sqrt(f float64) (float64, os.Error) {
    if f &lt; 0 {
    	return 0, ErrNegativeSqrt(f)
    }
    var z, d float64 = f, 1
    for d &gt; 1e-15 {
        z0 := z
        z = z-(z*z-f)/(2*z)
        d = z-z0
        if d &lt; 0 {
            d = -d
        }
    }
    return z, nil
}

func main() {
	if value, err := Sqrt(-2.0); err != nil {
		fmt.Println(err)
	} else {
		fmt.Println(value)
	}
}
</pre>
</li>
<li>
<a href="http://tour.golang.org/#59">Exercise: Images</a></p>
<pre class="brush: plain; title: ; notranslate">
package main

import (
	&quot;image&quot;
	&quot;tour/pic&quot;
)

type Image struct {}

func (m *Image) ColorModel() image.ColorModel {
    return image.RGBAColorModel
}

func (m *Image) Bounds() image.Rectangle {
    return image.Rect(0,0,256,256)
}

func (m *Image) At(x, y int) image.Color {
    v:=uint8(x^y)
    return image.RGBAColor{v, v, 255, 255}
}

func main() {
	m := &amp;Image{}
	pic.ShowImage(m)
}
</pre>
</li>
<li>
<a href="http://tour.golang.org/#60">Exercise: Rot13 Reader</a></p>
<pre class="brush: plain; title: ; notranslate">
package main

import (
	&quot;io&quot;
	&quot;os&quot;
	&quot;strings&quot;
)

type rot13Reader struct {
	r io.Reader
}

func rot13(b byte) byte {
    switch {
        case 'A' &lt;= b &amp;&amp; b &lt;= 'M':
                b = (b - 'A')+'N'
        case 'N' &lt;= b &amp;&amp; b &lt;= 'Z':
                b = (b - 'N')+'A'
        case 'a' &lt;= b &amp;&amp; b &lt;= 'm':
                b = (b - 'a')+'n'
        case 'n' &lt;= b &amp;&amp; b &lt;= 'z':
                b = (b - 'n')+'a'
    }
    return b
}

func (b *rot13Reader) Read(p []byte) (n int, err os.Error) {
	n, err = b.r.Read(p)
	for i:=range(p[:n]) {
		p[i]=rot13(p[i])
	}
	return
}

func main() {
	s := strings.NewReader(
		&quot;Lbh penpxrq gur pbqr!&quot;)
	r := rot13Reader{s}
	io.Copy(os.Stdout, &amp;r)
}
</pre>
</li>
<li>
<a href="http://tour.golang.org/#69">Exercise: Equivalent Binary Trees</a></p>
<pre class="brush: plain; title: ; notranslate">
package main

import (
	&quot;fmt&quot;
	&quot;tour/tree&quot;
)

// Walk walks the tree t sending all values
// from the tree to the channel ch.
func Walk(t *tree.Tree, ch chan int) {
	if t.Left != nil {
		Walk(t.Left, ch)
	}
	ch&lt;-t.Value
	if t.Right != nil {
		Walk(t.Right, ch)
	}
}

// Same determines whether the trees
// t1 and t2 contain the same values.
func Same(t1, t2 *tree.Tree) bool {
	ch1:=make(chan int)
	ch2:=make(chan int)
	go Walk(t1, ch1)
	go Walk(t2, ch2)
	for i:=0; i&lt;10; i++ {
		if &lt;-ch1 != &lt;-ch2 {
			return false
		}
	}
	return true
}	

func main() {
	ch := make(chan int)
	go Walk(tree.New(1), ch)

	for i:=0; i&lt;10; i++ {
		fmt.Println(&lt;-ch)
	}

	fmt.Println(&quot;Equivalent Binary Trees?&quot;,
		Same(tree.New(1), tree.New(1)))

	fmt.Println(&quot;Equivalent Binary Trees?&quot;,
		Same(tree.New(1), tree.New(2)))
}
</pre>
</li>
<li>
<a href="http://tour.golang.org/#70">Exercise: Web Crawler</a></p>
<pre class="brush: plain; title: ; notranslate">
package main

import (
	&quot;os&quot;
	&quot;fmt&quot;
)

type Fetcher interface {
	// Fetch returns the body of URL and
	// a slice of URLs found on that page.
	Fetch(url string) (body string, urls []string, err os.Error)
}

// Crawl uses fetcher to recursively crawl
// pages starting with url, to a maximum of depth.
func Crawl(url string, depth int, fetcher Fetcher) {
	type target struct{
		urls  []string
		depth int
	}
	more := make(chan target)

	fetchPage := func(url string, depth int) {
		body, urls, err := fetcher.Fetch(url)
		if err != nil {
			fmt.Println(err)
		} else {
			fmt.Printf(&quot;found: %s %q\n&quot;, url, body)
		}
		more &lt;- target{urls, depth+1}
	}

	go fetchPage(url, 0)

	visited := map[string]bool{url:true}
	for counter := 1; counter &gt; 0; {
		next := &lt;-more
		counter--
		if next.depth &gt; depth {
			continue
		}
		for _, url := range next.urls {
			if _, seen := visited[url]; seen {
				continue
			}
			visited[url] = true
			counter++
			go fetchPage(url, next.depth)
		}
	}
}

func main() {
	Crawl(&quot;http://golang.org/&quot;, 4, fetcher)
}

// fakeFetcher is Fetcher that returns canned results.
type fakeFetcher map[string]*fakeResult

type fakeResult struct {
	body string
	urls     []string
}

func (f *fakeFetcher) Fetch(url string) (string, []string, os.Error) {
	if res, ok := (*f)[url]; ok {
		return res.body, res.urls, nil
	}
	return &quot;&quot;, nil, fmt.Errorf(&quot;not found: %s&quot;, url)
}

// fetcher is a populated fakeFetcher.
var fetcher = &amp;fakeFetcher{
	&quot;http://golang.org/&quot;: &amp;fakeResult{
		&quot;The Go Programming Language&quot;,
		[]string{
			&quot;http://golang.org/pkg/&quot;,
			&quot;http://golang.org/cmd/&quot;,
		},
	},
	&quot;http://golang.org/pkg/&quot;: &amp;fakeResult{
		&quot;Packages&quot;,
		[]string{
			&quot;http://golang.org/&quot;,
			&quot;http://golang.org/cmd/&quot;,
			&quot;http://golang.org/pkg/fmt/&quot;,
			&quot;http://golang.org/pkg/os/&quot;,
		},
	},
	&quot;http://golang.org/pkg/fmt/&quot;: &amp;fakeResult{
		&quot;Package fmt&quot;,
		[]string{
			&quot;http://golang.org/&quot;,
			&quot;http://golang.org/pkg/&quot;,
		},
	},
	&quot;http://golang.org/pkg/os/&quot;: &amp;fakeResult{
		&quot;Package os&quot;,
		[]string{
			&quot;http://golang.org/&quot;,
			&quot;http://golang.org/pkg/&quot;,
		},
	},
}
</pre>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://syslog.warten.de/2011/11/solutions-for-tour-of-go-exercises/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title></title>
		<link>http://syslog.warten.de/2011/09/363/</link>
		<comments>http://syslog.warten.de/2011/09/363/#comments</comments>
		<pubDate>Thu, 15 Sep 2011 08:32:12 +0000</pubDate>
		<dc:creator>sw</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cacert]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[ocsp]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://syslog.warten.de/?p=363</guid>
		<description><![CDATA[I cannot open some SSL-encrypted websites (https) in Firefox right now. I have found out that this is caused by the Online Certificate Status Protocol (OCSP) which confirms the current validity of certificates. All those websites are using certificates issued &#8230; <a href="http://syslog.warten.de/2011/09/363/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I cannot open some SSL-encrypted websites (https) in Firefox right now. I have found out that this is caused by the Online Certificate Status Protocol (OCSP) which confirms the current validity of certificates. All those websites are using certificates issued by <a href="http://cacert.org">cacert.org</a> and their OCSP server (ocsp.cacert.org) is currently quiet busy (&#8220;Too many users&#8221; or timeouts).</p>
<p>Quick workaround is to temporarily disable OCSP in Firefox (or other affected web browsers). You can uncheck this feature in Preferences → Advanced → Encryption → Validation in Firefox.</p>
<p><strong>Update:</strong> Server seems to be working again.</p>
]]></content:encoded>
			<wfw:commentRss>http://syslog.warten.de/2011/09/363/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Significant improvements to indexes in MongoDB v2.0</title>
		<link>http://syslog.warten.de/2011/09/significant-improvements-to-indexes-in-mongodb-v2-0/</link>
		<comments>http://syslog.warten.de/2011/09/significant-improvements-to-indexes-in-mongodb-v2-0/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 20:50:16 +0000</pubDate>
		<dc:creator>sw</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[mongodb]]></category>

		<guid isPermaLink="false">http://syslog.warten.de/?p=358</guid>
		<description><![CDATA[I have upgraded my MongoDB installation to version 2.0 today and converted existing indexes to {v:1} format. According to the release notes, &#8220;Indexes are often 25% smaller and 25% faster (depends on the use case)&#8221;. In my case, a more &#8230; <a href="http://syslog.warten.de/2011/09/significant-improvements-to-indexes-in-mongodb-v2-0/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have upgraded my MongoDB installation to version 2.0 today and converted existing indexes to {v:1} format. According to the <a href="http://www.mongodb.org/display/DOCS/2.0+Release+Notes">release notes</a>, <em>&#8220;Indexes are often 25% smaller and 25% faster (depends on the use case)&#8221;</em>.</p>
<pre class="brush: plain; title: ; notranslate">
&gt; db.hashes.totalIndexSize()
5932986112
&gt; db.hashes.runCommand( &quot;compact&quot; )
{ &quot;ok&quot; : 1 }
&gt; db.hashes.totalIndexSize()
3527294016
</pre>
<p>In my case, a more than 10 GB database, the <code>totalIndexSize</code> of {v:1} format indexes is reduced by more than 40% to only 59.45% of the size of the old {v:0} format indexes. Well done, MongoDB developers!</p>
]]></content:encoded>
			<wfw:commentRss>http://syslog.warten.de/2011/09/significant-improvements-to-indexes-in-mongodb-v2-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Instant query log for MySQL</title>
		<link>http://syslog.warten.de/2011/09/instant-query-log-for-mysql/</link>
		<comments>http://syslog.warten.de/2011/09/instant-query-log-for-mysql/#comments</comments>
		<pubDate>Tue, 06 Sep 2011 18:11:55 +0000</pubDate>
		<dc:creator>sw</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[maatkit]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[tcpdump]]></category>

		<guid isPermaLink="false">http://syslog.warten.de/?p=350</guid>
		<description><![CDATA[MySQL has build-in logging for queries (general) and slow queries (slow). You can enable them at startup. It is not recommended to enable general logs on a high-traffic database server for performance reasons but sometimes you may want to be &#8230; <a href="http://syslog.warten.de/2011/09/instant-query-log-for-mysql/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>MySQL has <a href="http://dev.mysql.com/doc/refman/5.5/en/server-logs.html">build-in logging</a> for queries (general) and slow queries (slow). You can enable them at startup. It is not recommended to enable general logs on a high-traffic database server for performance reasons but sometimes you may want to be able to see what queries are executed there. </p>
<p>Since <a href="http://www.maatkit.org/doc/mk-query-digest.html">mk-query-digest</a> is able to read <a href="http://www.tcpdump.org/">tcpdumps</a>, it is the perfect tool to create an instant query log. Just pipe all network traffic on MySQL port to mk-query-digest for analysis.</p>
<pre class="brush: bash; title: ; notranslate">
tcpdump -i eth2 port 3306 -s 65535  -x -n -q -tttt | \
  mk-query-digest --type tcpdump
</pre>
<p>There are much more things you can do with mk-query-digest, so it is worth to write a dump of network traffic to a file and work with it.</p>
<pre class="brush: bash; title: ; notranslate">
tcpdump -i eth2 port 3306 -s 65535  -x -n -q -tttt &gt; tcpdump.out
</pre>
<p>You can convert it to slow query log format and parse it with your favorite analysis tool.</p>
<pre class="brush: bash; title: ; notranslate">
mk-query-digest --type tcpdump --print --noreport &lt; tcpdump.out &gt; slow.log
</pre>
<p>The report of an analysis of mk-query-digest fingerprints queries. To search for them in your logfile, you can use the <code><a href="http://www.maatkit.org/doc/mk-query-digest.html#filter">--filter</a></code> parameter.</p>
<pre class="brush: bash; title: ; notranslate">
mk-query-digest slow.log --no-report --print \
--filter '$event-&gt;{fingerprint} &amp;&amp; make_checksum($event-&gt;{fingerprint}) eq &quot;76A68B0365255C58&quot;'
</pre>
]]></content:encoded>
			<wfw:commentRss>http://syslog.warten.de/2011/09/instant-query-log-for-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Logrotate with MongoDB</title>
		<link>http://syslog.warten.de/2011/08/logrotate-with-mongodb/</link>
		<comments>http://syslog.warten.de/2011/08/logrotate-with-mongodb/#comments</comments>
		<pubDate>Mon, 22 Aug 2011 18:44:41 +0000</pubDate>
		<dc:creator>sw</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[logrotate]]></category>
		<category><![CDATA[mongodb]]></category>

		<guid isPermaLink="false">http://syslog.warten.de/?p=342</guid>
		<description><![CDATA[MongoDB packages are shipped with logging enabled in configuration but without a script to rotate the logfile. There are two build-in ways to let MongoDB rotate its logfile. You can execute db.runCommand("logRotate"); from the mongo shell or kill -SIGUSR1 $(cat &#8230; <a href="http://syslog.warten.de/2011/08/logrotate-with-mongodb/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>MongoDB packages are shipped with <a href="http://www.mongodb.org/display/DOCS/Logging">logging</a> enabled in configuration but without a script to rotate the logfile. There are two build-in ways to let MongoDB rotate its logfile. You can execute <code>db.runCommand("logRotate");</code> from the mongo shell or <code>kill -SIGUSR1 $(cat /var/lib/mongodb/mongod.lock)</code> from unix shell.</p>
<p>The best way to automate this is to use <code>logrotate</code>. Copy the following code into <code>/etc/logrotate.d/mongodb</code> and make sure that pathes and filenames in the script correspond with those in your system.</p>
<pre class="brush: plain; title: ; notranslate">
/var/log/mongodb/mongodb.log {
    daily
    rotate 7
    compress
    missingok
    notifempty
    sharedscripts
    postrotate
        /bin/kill -SIGUSR1 `cat /var/lib/mongodb/mongod.lock` &amp;&amp; \
        rm -f /var/log/mongodb/mongodb.log.????-??-??T??-??-??
    endscript
}
</pre>
<p>It rotates the logfile <code>/var/log/mongodb/mongodb.log</code> on a daily basis and keeps them for 7 days compressed. Since MongoDB&#8217;s build-in <code>logRotate</code> conflicts with <code>logrotate</code>, it also cleans up the empty, log-rotated files created by MongoDB.</p>
]]></content:encoded>
			<wfw:commentRss>http://syslog.warten.de/2011/08/logrotate-with-mongodb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title></title>
		<link>http://syslog.warten.de/2011/08/340/</link>
		<comments>http://syslog.warten.de/2011/08/340/#comments</comments>
		<pubDate>Mon, 22 Aug 2011 18:29:12 +0000</pubDate>
		<dc:creator>sw</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bash]]></category>

		<guid isPermaLink="false">http://syslog.warten.de/?p=340</guid>
		<description><![CDATA[Writing robust Bash shell scripts]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.davidpashley.com/articles/writing-robust-shell-scripts.html">Writing robust Bash shell scripts</a></p>
]]></content:encoded>
			<wfw:commentRss>http://syslog.warten.de/2011/08/340/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title></title>
		<link>http://syslog.warten.de/2011/08/338/</link>
		<comments>http://syslog.warten.de/2011/08/338/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 17:21:29 +0000</pubDate>
		<dc:creator>sw</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://syslog.warten.de/?p=338</guid>
		<description><![CDATA[Mastering Perl]]></description>
			<content:encoded><![CDATA[<p><a href="http://www252.pair.com/comdog/mastering_perl/">Mastering Perl</a></p>
]]></content:encoded>
			<wfw:commentRss>http://syslog.warten.de/2011/08/338/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solarize your terminal!</title>
		<link>http://syslog.warten.de/2011/08/solarize-your-terminal/</link>
		<comments>http://syslog.warten.de/2011/08/solarize-your-terminal/#comments</comments>
		<pubDate>Mon, 01 Aug 2011 20:27:14 +0000</pubDate>
		<dc:creator>sw</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[appearance]]></category>
		<category><![CDATA[colors]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://syslog.warten.de/?p=333</guid>
		<description><![CDATA[I have read about Solarized recently. It is a sixteen color palette designed for use with terminal and gui applications. I am using both the dark and light mode in Gnome Terminal, vim and Netbeans since a few days and &#8230; <a href="http://syslog.warten.de/2011/08/solarize-your-terminal/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have <a href="http://www.xaprb.com/blog/2011/07/28/easy-on-the-eyes-the-solarized-color-theme/">read</a> about <a href="http://ethanschoonover.com/solarized">Solarized</a> recently. It is a sixteen color palette designed for use with terminal and gui applications. I am using both the dark and light mode in <a href="https://github.com/sigurdga/gnome-terminal-colors-solarized">Gnome Terminal</a>, <a href="https://github.com/altercation/vim-colors-solarized">vim</a> and <a href="https://github.com/fentie/netbeans-colors-solarized">Netbeans</a> since a few days and I really like to work with it and do not want to miss it.</p>
]]></content:encoded>
			<wfw:commentRss>http://syslog.warten.de/2011/08/solarize-your-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

