<?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>kevin&#039;s blog &#187; Linux</title>
	<atom:link href="http://blog.kevin-k.com/category/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.kevin-k.com</link>
	<description>just another blog from just another blogger.</description>
	<lastBuildDate>Fri, 03 Feb 2012 23:01:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Buffalo Linkstation: Controlling LEDs with microapl</title>
		<link>http://blog.kevin-k.com/2012-01-14/buffalo-linkstation-controlling-leds-with-microapl.html</link>
		<comments>http://blog.kevin-k.com/2012-01-14/buffalo-linkstation-controlling-leds-with-microapl.html#comments</comments>
		<pubDate>Sat, 14 Jan 2012 11:36:38 +0000</pubDate>
		<dc:creator>kevin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.kevin-k.com/?p=1195</guid>
		<description><![CDATA[microapl is a wrapper script for micro_evtd, which passes the corresponding hexadecimal value for setting different values of your buffalo linkstation. In my case, debian squeeze was installed onto a Buffalo LS-Pro v1. There are two types of controlling the leds: With &#8220;mcon&#8221;, the leds are controlled by the linkstation. With &#8220;cpu&#8221;, you can set [...]]]></description>
			<content:encoded><![CDATA[<p>microapl is a wrapper script for micro_evtd, which passes the corresponding hexadecimal value for setting different values of your buffalo linkstation. In my case, <a href="http://buffalo.nas-central.org/wiki/Install_Debian_on_the_Linkstation_Pro/Live">debian squeeze</a> was installed onto a Buffalo LS-Pro v1.</p>
<p>There are two types of controlling the leds: With &#8220;mcon&#8221;, the leds are controlled by the linkstation. With &#8220;cpu&#8221;, you can set the leds by yourself.</p>
<p>To get all possible settings, type in:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>box:~ microapl
option: boot_start
boot_end
power_off
shutdown_wait
shutdown_cancel
skip_standby
delay_standby
standby
reboot
temp_get
fan_set_speed <span style="color: #7a0874; font-weight: bold;">&#91;</span>arg<span style="color: #7a0874; font-weight: bold;">&#93;</span>
fan_get_speed
bz_on <span style="color: #7a0874; font-weight: bold;">&#91;</span>arg<span style="color: #7a0874; font-weight: bold;">&#93;</span>
bz_set_freq <span style="color: #7a0874; font-weight: bold;">&#91;</span>arg<span style="color: #7a0874; font-weight: bold;">&#93;</span>
bz_melody tempo note ...
bz_imhere tempo note ...
int_get_switch_status <span style="color: #7a0874; font-weight: bold;">&#91;</span>arg<span style="color: #7a0874; font-weight: bold;">&#93;</span>
led_set_bright <span style="color: #7a0874; font-weight: bold;">&#91;</span>arg<span style="color: #7a0874; font-weight: bold;">&#93;</span>
led_set_cpu_mcon <span style="color: #7a0874; font-weight: bold;">&#91;</span>arg<span style="color: #7a0874; font-weight: bold;">&#93;</span>
led_set_on_off <span style="color: #7a0874; font-weight: bold;">&#91;</span>arg<span style="color: #7a0874; font-weight: bold;">&#93;</span>
led_set_blink <span style="color: #7a0874; font-weight: bold;">&#91;</span>arg<span style="color: #7a0874; font-weight: bold;">&#93;</span>
led_set_code_error <span style="color: #7a0874; font-weight: bold;">&#91;</span>arg<span style="color: #7a0874; font-weight: bold;">&#93;</span>
led_set_code_information <span style="color: #7a0874; font-weight: bold;">&#91;</span>arg<span style="color: #7a0874; font-weight: bold;">&#93;</span>
led_set_cpu_mcon <span style="color: #7a0874; font-weight: bold;">&#91;</span>arg<span style="color: #7a0874; font-weight: bold;">&#93;</span>
mcon_get_status
hdd_set_power <span style="color: #7a0874; font-weight: bold;">&#91;</span>arg<span style="color: #7a0874; font-weight: bold;">&#93;</span>
mcon_get_version</pre></div></div>

<p>As you see, you can do many cool stuff, for example play a melody with bz_melody, or set and get the fan speed. Just try out.</p>
<p>To get the current controlling type of the leds (cpu or mcon), type in:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>box:~ microapl <span style="color: #660033;">-a</span> led_set_cpu_mcon
<span style="color: #666666; font-style: italic;">#[microapl.led_set_cpu_mcon]</span>
<span style="color: #007800;">led_power</span>=mcon
<span style="color: #007800;">led_info</span>=mcon
<span style="color: #007800;">led_diag</span>=mcon
<span style="color: #007800;">led_link</span>=mcon</pre></div></div>

<p>If you want to change the diag-led (error, red) by yourself, set the the led_diag value to &#8220;cpu&#8221;:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>box:~ microapl <span style="color: #660033;">-a</span> led_set_cpu_mcon diag
root<span style="color: #000000; font-weight: bold;">@</span>box:~ microapl <span style="color: #660033;">-a</span> led_set_cpu_mcon
<span style="color: #666666; font-style: italic;">#[microapl.led_set_cpu_mcon]</span>
<span style="color: #007800;">led_power</span>=mcon
<span style="color: #007800;">led_info</span>=mcon
<span style="color: #007800;">led_diag</span>=cpu
<span style="color: #007800;">led_link</span>=mcon</pre></div></div>

<p>Now the value of led_diag is changed changed to &#8220;cpu&#8221;. To light up the diag-led, type in:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>box:~ microapl <span style="color: #660033;">-a</span> led_set_on_off diag
root<span style="color: #000000; font-weight: bold;">@</span>box:~ microapl <span style="color: #660033;">-a</span> led_set_on_off
<span style="color: #666666; font-style: italic;">#[microapl.led_set_on_off]</span>
<span style="color: #007800;">led_power</span>=off
<span style="color: #007800;">led_info</span>=off
<span style="color: #007800;">led_diag</span>=on
<span style="color: #007800;">led_link</span>=off</pre></div></div>

<p>To change the power, link, info and diag led to cpu and light them up, type in:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>box:~ microapl <span style="color: #660033;">-a</span> led_set_cpu_mcon power info diag <span style="color: #c20cb9; font-weight: bold;">link</span>
root<span style="color: #000000; font-weight: bold;">@</span>box:~ microapl <span style="color: #660033;">-a</span> led_set_on_off power info diag <span style="color: #c20cb9; font-weight: bold;">link</span></pre></div></div>

<p>To change everything back to mcon (default), just use &#8220;off&#8221; as parameter:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>box:~ microapl <span style="color: #660033;">-a</span> led_set_cpu_mcon off</pre></div></div>

<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kevin-k.com/2012-01-14/buffalo-linkstation-controlling-leds-with-microapl.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installation VMWare Tools auf Debian Squeeze (6)</title>
		<link>http://blog.kevin-k.com/2011-07-03/installation-vmware-tools-auf-debian-squeeze-6.html</link>
		<comments>http://blog.kevin-k.com/2011-07-03/installation-vmware-tools-auf-debian-squeeze-6.html#comments</comments>
		<pubDate>Sun, 03 Jul 2011 11:33:54 +0000</pubDate>
		<dc:creator>kevin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualisierung]]></category>

		<guid isPermaLink="false">http://blog.kevin-k.com/?p=1000</guid>
		<description><![CDATA[apt-get install linux-headers-$(uname -r) gcc make tar xfzv VMwareTools-8.3.7-341836.tar.gz ./vmware-tools-distrib/vmware-install.pl]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="code" style="font-family:monospace;">apt-get install linux-headers-$(uname -r) gcc make
tar xfzv VMwareTools-8.3.7-341836.tar.gz
./vmware-tools-distrib/vmware-install.pl</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.kevin-k.com/2011-07-03/installation-vmware-tools-auf-debian-squeeze-6.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ESXi Snapshot-Revert Script</title>
		<link>http://blog.kevin-k.com/2011-02-20/esxi-snapshot-revert-script.html</link>
		<comments>http://blog.kevin-k.com/2011-02-20/esxi-snapshot-revert-script.html#comments</comments>
		<pubDate>Sun, 20 Feb 2011 11:27:03 +0000</pubDate>
		<dc:creator>kevin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualisierung]]></category>

		<guid isPermaLink="false">http://blog.kevin-k.com/?p=975</guid>
		<description><![CDATA[In meiner Test-VM stelle ich oft einen vorherigen Snapshot her, um mit Test usw. mit einer leeren Debian Installation zu beginnen. Mit folgendem Script kann ich einen Snapshot direkt aus der Test-VM wiederherstellen, ohne mich im vSphere-Client einloggen zu müssen: #!/bin/bash &#160; host=&#34;esxi-host&#34; vm=&#34;test/test.vmx&#34; &#160; # get vm-id vmid=$&#40;ssh $host 'vim-cmd vmsvc/getallvms' &#124; grep &#34;$vm&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>In meiner Test-VM stelle ich oft einen vorherigen Snapshot her, um mit Test usw. mit einer leeren Debian Installation zu beginnen. Mit folgendem Script kann ich einen Snapshot direkt aus der Test-VM wiederherstellen, ohne mich im vSphere-Client einloggen zu müssen:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #007800;">host</span>=<span style="color: #ff0000;">&quot;esxi-host&quot;</span>
<span style="color: #007800;">vm</span>=<span style="color: #ff0000;">&quot;test/test.vmx&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># get vm-id</span>
<span style="color: #007800;">vmid</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #007800;">$host</span> <span style="color: #ff0000;">'vim-cmd vmsvc/getallvms'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$vm</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #ff0000;">'print $1'</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;vm-id: <span style="color: #007800;">$vmid</span>&quot;</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #007800;">$host</span> <span style="color: #ff0000;">&quot;vim-cmd vmsvc/snapshot.revert <span style="color: #007800;">$vmid</span> suppressPowerOff &amp;&amp; vim-cmd vmsvc/power.on <span style="color: #007800;">$vmid</span>&quot;</span></pre></div></div>

<p>Der Befehl <em>vim-cmd vmsvc/snapshot.revert</em> stellt den ersten Snapshot der VM wieder her. Sollte man verzweigte Snapshots haben, gibt es zusätzlich die optionalen Parameter <em>snapshotLevel</em> und <em>snapshotIndex</em>.</p>
<p>Votaussetzung für das Script ist, dass man über SSH Zugriff auf die Maschine hat (TechMode).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kevin-k.com/2011-02-20/esxi-snapshot-revert-script.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unix Rechte und Besitzer zurücksetzen</title>
		<link>http://blog.kevin-k.com/2010-07-16/unix-rechte-und-besitzer-zurucksetzen.html</link>
		<comments>http://blog.kevin-k.com/2010-07-16/unix-rechte-und-besitzer-zurucksetzen.html#comments</comments>
		<pubDate>Fri, 16 Jul 2010 18:11:23 +0000</pubDate>
		<dc:creator>kevin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.kevin-k.com/?p=941</guid>
		<description><![CDATA[Kleiner Reminder: find dir -type f -print0 &#124; xargs -0 -r chmod 0644 find dir -type d -print0 &#124; xargs -0 -r chmod 0755 chown -R root:root dir]]></description>
			<content:encoded><![CDATA[<p>Kleiner Reminder:</p>

<div class="wp_syntax"><div class="code"><pre class="code" style="font-family:monospace;">find dir -type f -print0 | xargs -0 -r chmod 0644
find dir -type d -print0 | xargs -0 -r chmod 0755
chown -R root:root dir</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.kevin-k.com/2010-07-16/unix-rechte-und-besitzer-zurucksetzen.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>sysbench unter Debian Lenny kompilieren</title>
		<link>http://blog.kevin-k.com/2010-01-10/sysbench-unter-debian-lenny-kompilieren.html</link>
		<comments>http://blog.kevin-k.com/2010-01-10/sysbench-unter-debian-lenny-kompilieren.html#comments</comments>
		<pubDate>Sun, 10 Jan 2010 11:11:18 +0000</pubDate>
		<dc:creator>kevin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.kevin-k.com/?p=894</guid>
		<description><![CDATA[sysbench downloaden: http://sourceforge.net/projects/sysbench/ Notwendige Pakete: apt-get install automake libmysqlclient15-dev Kompilieren: ./configure sed -i configure.ac -e 's/AC_PROG_LIBTOOL/AC_PROG_RANLIB/' # fix ./autogen.sh # fix make make install]]></description>
			<content:encoded><![CDATA[<p>sysbench downloaden: http://sourceforge.net/projects/sysbench/</p>
<p>Notwendige Pakete:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">apt-get install automake libmysqlclient15-dev</pre></div></div>

<p>Kompilieren:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">./configure
sed -i configure.ac -e 's/AC_PROG_LIBTOOL/AC_PROG_RANLIB/' # fix
./autogen.sh # fix
make
make install</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.kevin-k.com/2010-01-10/sysbench-unter-debian-lenny-kompilieren.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux Interface-Mirroring</title>
		<link>http://blog.kevin-k.com/2009-12-24/linux-interface-mirroring.html</link>
		<comments>http://blog.kevin-k.com/2009-12-24/linux-interface-mirroring.html#comments</comments>
		<pubDate>Thu, 24 Dec 2009 10:40:00 +0000</pubDate>
		<dc:creator>kevin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.kevin-k.com/?p=883</guid>
		<description><![CDATA[apt-get install daemonlogger daemonlogger -i eth0 -o eth3]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">apt-get install daemonlogger
daemonlogger -i eth0 -o eth3</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.kevin-k.com/2009-12-24/linux-interface-mirroring.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash-Script um zeitgesteuert Programme zu starten</title>
		<link>http://blog.kevin-k.com/2009-12-12/bash-script-um-zeitgesteuert-programme-zu-starten.html</link>
		<comments>http://blog.kevin-k.com/2009-12-12/bash-script-um-zeitgesteuert-programme-zu-starten.html#comments</comments>
		<pubDate>Sat, 12 Dec 2009 13:24:53 +0000</pubDate>
		<dc:creator>kevin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.kevin-k.com/?p=841</guid>
		<description><![CDATA[Wenn man beispielsweise heute um 20:15 Uhr ein bestimmtes Script starten möchte, kommt man meist um ein Crontab nicht herum. Mit diesem kleinen Script übergibt man als Parameter ein Datum und/oder Uhrzeit und das Script wartet dann bis zu diesem Zeitstempel, bevor das Script beendet wird und das darauf folgende Programm gestartet wird &#8211; somit [...]]]></description>
			<content:encoded><![CDATA[<p>Wenn man beispielsweise heute um 20:15 Uhr ein bestimmtes Script starten möchte, kommt man meist um ein Crontab nicht herum. Mit diesem kleinen Script übergibt man als Parameter ein Datum und/oder Uhrzeit und das Script wartet dann bis zu diesem Zeitstempel, bevor das Script beendet wird und das darauf folgende Programm gestartet wird &#8211; somit spart man sich das aufwändige editieren der Crontab-Files.</p>
<h3>Beispiel</h3>
<p>Uhrzeit:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@test:~$ ./tsleep.sh 14:30; reboot
i sleep until 2009-12-12 14:30:00 ...</pre></div></div>

<p>Datum:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">./tsleep.sh 2009-12-24; reboot
i sleep until 2009-12-24 00:00:00 ...</pre></div></div>

<p>Datum mit Uhrzeit:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@test:~$ ./tsleep.sh 2009-12-24 13:45:12; reboot
i sleep until 2009-12-24 13:45:12 ...</pre></div></div>

<h3>Funktionsweise</h3>
<p>Der Zeitstempel wird in Sekunden umgerechnet und über eine while-Schleife sekündlich mit dem aktuellen Datum abgeprüft. Ist das aktuelle Datum gleich oder älter dem Zeitstempel, wird das Script beendet und das darauf folgende Program gestartet. Als Zeitstempel kann man alles verwenden was <em>date</em> futtert.</p>
<p>Eine alternative wäre die Differenz der aktuellen Zeit und des Zeitstempels in Sekunden umzurechnen und dann <emm>sleep</em> zu übergeben. Ob das perfomanter ist &#8211; keine Ahnung, mein Script dagegen überlebt auch Zeit-Anpassungen (z.b. rdate/ntpdate), daher habe ich diesen Weg gewählt.</p>
<p>Sollte jemand Fehler finden oder das Script verbessern, würde ich mich freuen, wenn Ihr mir das mitteilt ;).</p>
<h3>Script</h3>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage: $0 &lt;timestamp&gt;&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">2</span>
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">elif</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;$2&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">date</span>=<span style="color: #ff0000;">&quot;$1&quot;</span>
<span style="color: #000000; font-weight: bold;">else</span>
        <span style="color: #007800;">date</span>=<span style="color: #ff0000;">&quot;$1 $2&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #007800;">date_end</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> <span style="color: #660033;">--date</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$date</span>&quot;</span> +<span style="color: #000000; font-weight: bold;">%</span>s <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null<span style="color: #7a0874; font-weight: bold;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;error: invalid date&quot;</span> <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span>
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$date_end</span> <span style="color: #660033;">-le</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;error: end time is lower or eqal start time&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">2</span>
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;i sleep until <span style="color: #007800;">$(date --date=&quot;$date&quot; &quot;+%Y-%m-%d %H:%M:%S&quot;)</span> ...&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #660033;">-le</span> <span style="color: #007800;">$date_end</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></div></div>

<h3>Download</h3>
<p><a class="download" href="http://blog.kevin-k.com/wp-content/uploads/2009/12/tsleep.sh">Download tsleep.sh</a></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">wget http://blog.kevin-k.com/wp-content/uploads/2009/12/tsleep.sh
chmod +x tsleep.sh</pre></div></div>

<h3>at</h3>
<p>Alternativ gibt es auch <em>at</em>, das Befehle direkt von Standard-Input oder einer Datei ließt und zu einer bestimmten Uhrzeit ausführt.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kevin-k.com/2009-12-12/bash-script-um-zeitgesteuert-programme-zu-starten.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Download VMware Server 2 via wget</title>
		<link>http://blog.kevin-k.com/2009-09-04/download-vmware-server-2-via-wget.html</link>
		<comments>http://blog.kevin-k.com/2009-09-04/download-vmware-server-2-via-wget.html#comments</comments>
		<pubDate>Fri, 04 Sep 2009 06:58:47 +0000</pubDate>
		<dc:creator>kevin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.kevin-k.com/?p=731</guid>
		<description><![CDATA[Its a little bit tricky, but this is how it works: Get download-url Go to http://www.vmware.com/go/getserver and login (or register). get the download-url of the file (right-click&#8230;): Get cookie To download via wget, you need to get the cookie named &#8220;ObSSOCookie&#8221; from your browser. Download via wget Use this command to download the file: wget [...]]]></description>
			<content:encoded><![CDATA[<p>Its a little bit tricky, but this is how it works:</p>
<h2>Get download-url</h2>
<p>Go to <a href="http://www.vmware.com/go/getserver">http://www.vmware.com/go/getserver</a> and login (or register).</p>
<p>get the download-url of the file (right-click&#8230;):<br />
<img src="http://blog.kevin-k.com/wp-content/uploads/2009/09/vmware_download.png" alt="vmware download Download VMware Server 2 via wget" title="vmware_download" width="543" height="65" class="alignnone size-full wp-image-732" /></p>
<h2>Get cookie</h2>
<p>To download via wget, you need to get the cookie named &#8220;<strong>ObSSOCookie</strong>&#8221; from your browser.<br />
<img src="http://blog.kevin-k.com/wp-content/uploads/2009/09/vmware_download_cookie.png" alt="vmware download cookie Download VMware Server 2 via wget" title="vmware_download_cookie" width="405" height="344" class="alignnone size-full wp-image-733" /></p>
<h2>Download via wget</h2>
<p>Use this command to download the file:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">wget --no-check-certificate --header=&quot;Cookie: ObSSOCookie=&lt;content&gt;&quot; &quot;&lt;url&gt;&quot; -O vmware-server.tar.gz</pre></div></div>

<p>Example:</p>
<blockquote><p>wget &#8211;no-check-certificate &#8211;header=&#8221;Cookie: ObSSOCookie=content&#8221; &#8220;https://www.vmware.com/freedownload/p/download.php?product=server20&#038;a=DOWNLOAD_FILE&#038;baseurl=http://download2.vmware.com/software/server/&#038;filename=VMware-server-2.0.1-156745.i386.tar.gz&#8221;  -O vmware-server.tar.gz
</p></blockquote>
<p>Happy downloading ;).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kevin-k.com/2009-09-04/download-vmware-server-2-via-wget.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installation von VMware Tools auf Debian Lenny</title>
		<link>http://blog.kevin-k.com/2009-08-22/installation-von-vmware-tools-auf-debian-lenny.html</link>
		<comments>http://blog.kevin-k.com/2009-08-22/installation-von-vmware-tools-auf-debian-lenny.html#comments</comments>
		<pubDate>Sat, 22 Aug 2009 13:42:42 +0000</pubDate>
		<dc:creator>kevin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.kevin-k.com/?p=719</guid>
		<description><![CDATA[apt-get install build-essential psmisc gcc-4.1 linux-headers-$(uname -r) tar xfzv VMwareTools-7.8.4-126130.tar.gz ./vmware-tools-distrib/vmware-install.pl CC=/usr/bin/gcc-4.1 /usr/bin/vmware-config-tools.pl gcc-4.1 ist notwendig, wenn der Kernel (z.b. aus den Repositories) mit einer anderen GCC Version kompiliert wurde, als auf dem System vorhanden: Your kernel was built with &#8220;gcc&#8221; version &#8220;4.1.3&#8243;, while you are trying to use &#8220;/usr/bin/gcc&#8221; version &#8220;4.3.2&#8243;. This configuration is [...]]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">apt-get install build-essential psmisc gcc-4.1 linux-headers-$(uname -r)
tar xfzv VMwareTools-7.8.4-126130.tar.gz
./vmware-tools-distrib/vmware-install.pl
CC=/usr/bin/gcc-4.1 /usr/bin/vmware-config-tools.pl</pre></div></div>

<p>gcc-4.1 ist notwendig, wenn der Kernel (z.b. aus den Repositories) mit einer anderen GCC Version kompiliert wurde, als auf dem System vorhanden:</p>
<blockquote><p>
Your kernel was built with &#8220;gcc&#8221; version &#8220;4.1.3&#8243;, while you are trying to use<br />
&#8220;/usr/bin/gcc&#8221; version &#8220;4.3.2&#8243;. This configuration is not recommended and<br />
VMware Tools may crash if you&#8217;ll continue. Please try to use exactly same<br />
compiler as one used for building your kernel. Do you want to go with compiler<br />
&#8220;/usr/bin/gcc&#8221; version &#8220;4.3.2&#8243; anyway?
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.kevin-k.com/2009-08-22/installation-von-vmware-tools-auf-debian-lenny.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>snmpd: cannot open /proc/net/dev or /proc/net/snmp</title>
		<link>http://blog.kevin-k.com/2009-06-22/snmpd-cannot-open-procnetdev-or-procnetsnmp.html</link>
		<comments>http://blog.kevin-k.com/2009-06-22/snmpd-cannot-open-procnetdev-or-procnetsnmp.html#comments</comments>
		<pubDate>Mon, 22 Jun 2009 21:14:01 +0000</pubDate>
		<dc:creator>kevin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.kevin-k.com/?p=621</guid>
		<description><![CDATA[I get the following message in syslog from snmpd: Jun 22 17:10:43 test snmpd[9508]: cannot open /proc/net/snmp ... Jun 22 17:10:45 test snmpd[9508]: cannot open /proc/net/dev ... The problem is, that snmpd has no rights to access the proc-filesystem to gather information about interfaces and so. check the rights of the user and group of [...]]]></description>
			<content:encoded><![CDATA[<p>I get the following message in syslog from snmpd:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Jun 22 17:10:43 test snmpd[9508]: cannot open /proc/net/snmp ...
Jun 22 17:10:45 test snmpd[9508]: cannot open /proc/net/dev ...</pre></div></div>

<p>The problem is, that snmpd has no rights to access the proc-filesystem to gather information about interfaces and so.</p>
<p>check the rights of the user and group of snmpd:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@test:~$ cat /proc/$(pidof snmpd)/status | grep -i -e &quot;^[u|g]id&quot;
Uid:    106     106     106     106
Gid:    0       0       0       0</pre></div></div>

<p>In my case, the problem was that i was running a grsec kernel (stupid default kernel of my root) and access to proc by users was permitted by the kernel.<br />
to change this, you must change your kernel config (see grsecurity for instructions).</p>
<p>another solution is to change the user or group to a special grsec user/group. but event this is not working correct under some distributions, but <a href="http://blog.oxynux.org/post/2008/12/07/Grsec-snmpd">patching the source code of snmpd</a> may help.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kevin-k.com/2009-06-22/snmpd-cannot-open-procnetdev-or-procnetsnmp.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

