<?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>Piethein Strengholt&#039;s Blog</title>
	<atom:link href="http://www.strengholt-online.nl/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.strengholt-online.nl</link>
	<description>Bloggen over van alles en nog wat...</description>
	<lastBuildDate>Tue, 19 Mar 2013 17:28:20 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>[WordPress] filter out unneeded menu classes</title>
		<link>http://www.strengholt-online.nl/wordpress-filter-out-unneeded-menu-classes/</link>
		<comments>http://www.strengholt-online.nl/wordpress-filter-out-unneeded-menu-classes/#comments</comments>
		<pubDate>Tue, 19 Mar 2013 17:28:20 +0000</pubDate>
		<dc:creator>Piethein Strengholt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Genesis]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.strengholt-online.nl/?p=1020</guid>
		<description><![CDATA[Here&#8217;s a code snippet for WordPress to filter out unneeded menu classes. Put the following line in your functions.php]]></description>
				<content:encoded><![CDATA[<p>Here&#8217;s a code snippet for WordPress to filter out unneeded menu classes. Put the following line in your functions.php</p>
<pre class="brush: php; title: ; notranslate">// Reduce nav classes, leaving only 'current-menu-item'
function nav_class_filter($var)
{
    return is_array($var) ? array_intersect($var, array(
        'menu',
        'menu-main',
        'menu-primary',
        'menu-item',
        'sub-menu',
        'menu-last-item',
        'menu-first-item',
        'menu-noparent',
        'menu-parent',
        'menu-top',
        'current-menu-item'
    )) : '';
}
add_filter('nav_menu_css_class', 'nav_class_filter', 100, 1);
add_filter('nav_menu_item_id', 'my_css_attributes_filter', 100, 1);</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.strengholt-online.nl/wordpress-filter-out-unneeded-menu-classes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[WordPress] set cookie</title>
		<link>http://www.strengholt-online.nl/wordpress-set-cookie/</link>
		<comments>http://www.strengholt-online.nl/wordpress-set-cookie/#comments</comments>
		<pubDate>Tue, 19 Mar 2013 17:25:41 +0000</pubDate>
		<dc:creator>Piethein Strengholt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.strengholt-online.nl/?p=1018</guid>
		<description><![CDATA[Here&#8217;s a code snippet for WordPress. Since WordPress doesn&#8217;t support any sessions a cookie might be useful. Here&#8217;s a code snippet to use for your functions.php]]></description>
				<content:encoded><![CDATA[<p>Here&#8217;s a code snippet for WordPress. Since WordPress doesn&#8217;t support any sessions a cookie might be useful. Here&#8217;s a code snippet to use for your functions.php</p>
<pre class="brush: php; title: ; notranslate">//Set cookie
function set_newuser_cookie() {
	if (!isset($_COOKIE['sitename_newvisitor'])) {
		setcookie('sitename_newvisitor', 1, time()+1209600, COOKIEPATH, COOKIE_DOMAIN, false);
	}
}
add_action( 'init', 'set_newuser_cookie');</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.strengholt-online.nl/wordpress-set-cookie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[WordPress &amp; Genesis] Add parent and child classses to menu</title>
		<link>http://www.strengholt-online.nl/1016/</link>
		<comments>http://www.strengholt-online.nl/1016/#comments</comments>
		<pubDate>Tue, 19 Mar 2013 17:22:57 +0000</pubDate>
		<dc:creator>Piethein Strengholt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Genesis]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.strengholt-online.nl/?p=1016</guid>
		<description><![CDATA[Here&#8217;s another code snippet for WordPress Genesis Framework. If you would like to add menu classes to parent and child menu&#8217;s, use the code below. Put this in the functions.php file:]]></description>
				<content:encoded><![CDATA[<p>Here&#8217;s another code snippet for WordPress Genesis Framework. </p>
<p>If you would like to add menu classes to parent and child menu&#8217;s, use the code below.<br />
Put this in the functions.php file:</p>
<pre class="brush: php; title: ; notranslate">

// Function to add parent and child classses to menu
class Arrow_Walker_Nav_Menu extends Walker_Nav_Menu
{
    function display_element($element, &amp;$children_elements, $max_depth, $depth = 0, $args, &amp;$output)
    {
        $id_field = $this-&gt;db_fields['id'];
        if (0 == $depth) {
            $element-&gt;classes[] = 'menu-top'; //top main menu
            if (empty($children_elements[$element-&gt;$id_field])) {
                $element-&gt;classes[] = 'menu-noparent'; //no childs
            }
        }
        if (!empty($children_elements[$element-&gt;$id_field])) {
            $element-&gt;classes[] = 'menu-parent'; //child in menu
        }
        Walker_Nav_Menu::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
    }
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.strengholt-online.nl/1016/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[WordPress &amp; Genesis] Add menu classes to first en last menu items</title>
		<link>http://www.strengholt-online.nl/wordpress-genesis-add-menu-classes-to-first-en-last-menu-items/</link>
		<comments>http://www.strengholt-online.nl/wordpress-genesis-add-menu-classes-to-first-en-last-menu-items/#comments</comments>
		<pubDate>Tue, 19 Mar 2013 17:21:52 +0000</pubDate>
		<dc:creator>Piethein Strengholt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Genesis]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.strengholt-online.nl/?p=1014</guid>
		<description><![CDATA[Here&#8217;s a code snippet for WordPress Genesis Framework. If you would like to add menu classes to first en last menu items, use the code below. Put this in the functions.php file:]]></description>
				<content:encoded><![CDATA[<p>Here&#8217;s a code snippet for WordPress Genesis Framework. </p>
<p>If you would like to add menu classes to first en last menu items, use the code below. Put this in the functions.php file:</p>
<pre class="brush: php; title: ; notranslate">// Function to add menu classes to first en last menu items
function add_first_and_last($items)
{
    $items[1]-&gt;classes[]             = 'menu-first-item';
    $items[count($items)]-&gt;classes[] = 'menu-last-item';
    return $items;
}
add_filter('wp_nav_menu_objects', 'add_first_and_last');</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.strengholt-online.nl/wordpress-genesis-add-menu-classes-to-first-en-last-menu-items/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[WordPress &amp; Genesis] custom viewport</title>
		<link>http://www.strengholt-online.nl/wordpress-genesis-custom-viewport/</link>
		<comments>http://www.strengholt-online.nl/wordpress-genesis-custom-viewport/#comments</comments>
		<pubDate>Tue, 19 Mar 2013 17:20:06 +0000</pubDate>
		<dc:creator>Piethein Strengholt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Genesis]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.strengholt-online.nl/?p=1012</guid>
		<description><![CDATA[Here&#8217;s a code snippet for WordPress Genesis Framework. If you would like to use a custom viewport for mobile devices, for example, use the code below:]]></description>
				<content:encoded><![CDATA[<p>Here&#8217;s a code snippet for WordPress Genesis Framework. </p>
<p>If you would like to use a custom viewport for mobile devices, for example, use the code below:</p>
<pre class="brush: php; title: ; notranslate">/** Add Viewport meta tag for mobile browsers */
add_action('genesis_meta', 'add_viewport_meta_tag');
function add_viewport_meta_tag()
{
    echo '&lt;meta name=&quot;viewport&quot; content=&quot;width=1020&quot;&gt;';
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.strengholt-online.nl/wordpress-genesis-custom-viewport/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[WordPress &amp; Genesis] custom footer or custom header</title>
		<link>http://www.strengholt-online.nl/wordpress-genesis-custom-footer-or-custom-header/</link>
		<comments>http://www.strengholt-online.nl/wordpress-genesis-custom-footer-or-custom-header/#comments</comments>
		<pubDate>Tue, 19 Mar 2013 17:18:45 +0000</pubDate>
		<dc:creator>Piethein Strengholt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Genesis]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.strengholt-online.nl/?p=1010</guid>
		<description><![CDATA[Here&#8217;s a code snippet for WordPress Genesis. If you would like to use a custom header or custom footer, don&#8217;t use any header.php of footer.php. Use the code snippet below:]]></description>
				<content:encoded><![CDATA[<p>Here&#8217;s a code snippet for WordPress Genesis. If you would like to use a custom header or custom footer, don&#8217;t use any header.php of footer.php. Use the code snippet below:</p>
<pre class="brush: php; title: ; notranslate">// Include Header, seperate from functions
include 'custom-header.php';

// Include Footer, seperate from functions
include 'custom-footer.php';</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.strengholt-online.nl/wordpress-genesis-custom-footer-or-custom-header/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Synology] How to secure photostation with htaccess</title>
		<link>http://www.strengholt-online.nl/synology-how-to-secure-photostation-with-htaccess/</link>
		<comments>http://www.strengholt-online.nl/synology-how-to-secure-photostation-with-htaccess/#comments</comments>
		<pubDate>Fri, 15 Mar 2013 08:51:53 +0000</pubDate>
		<dc:creator>Piethein Strengholt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Synology]]></category>

		<guid isPermaLink="false">http://www.strengholt-online.nl/?p=1004</guid>
		<description><![CDATA[Here&#8217;s a short instruction on how to protect your synology photostation by using htaccess: Create the following file: /volume1/@appstore/PhotoStation/photo/.htaccess and the following file: /volume1/@appstore/PhotoStation/photo/.passwd Use the passwd htaccess online generate for your own password.]]></description>
				<content:encoded><![CDATA[<p>Here&#8217;s a short instruction on how to protect your synology photostation by using htaccess:</p>
<p>Create the following file: /volume1/@appstore/PhotoStation/photo/.htaccess</p>
<pre class="brush: bash; title: ; notranslate">AuthName &quot;Restricted Area&quot;
AuthType Basic
AuthUserFile /volume1/@appstore/PhotoStation/photo/.htpasswd
AuthGroupFile /dev/null
require valid-user</pre>
<p>and the following file: /volume1/@appstore/PhotoStation/photo/.passwd</p>
<pre class="brush: bash; title: ; notranslate">admin:xxxxxxxxxxxxxxxx</pre>
<p>Use the passwd htaccess online generate for your own password.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.strengholt-online.nl/synology-how-to-secure-photostation-with-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Synology: Monitoring Apache with mod_status</title>
		<link>http://www.strengholt-online.nl/synology-monitoring-apache-with-mod_status/</link>
		<comments>http://www.strengholt-online.nl/synology-monitoring-apache-with-mod_status/#comments</comments>
		<pubDate>Mon, 04 Mar 2013 14:29:51 +0000</pubDate>
		<dc:creator>Piethein Strengholt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mod_status]]></category>
		<category><![CDATA[Synology]]></category>

		<guid isPermaLink="false">http://www.strengholt-online.nl/?p=1001</guid>
		<description><![CDATA[Here another quick manual. If you would like to monitor your apache webserver, you can do that with mod_status. Open the httpd.conf-user file: Copy paste the following content from below: Save the httpd.conf-user file and restart apache with: You can now obtain the apache server status by querying the following url: http://diskstation/server-status?auto This might be [...]]]></description>
				<content:encoded><![CDATA[<p>Here another quick manual. If you would like to monitor your apache webserver, you can do that with mod_status. Open the httpd.conf-user file:</p>
<pre class="brush: bash; title: ; notranslate">pico /usr/syno/apache/conf/httpd.conf-user</pre>
<p>Copy paste the following content from below:</p>
<pre class="brush: bash; title: ; notranslate">&lt;Location /server-status&gt;
   SetHandler server-status
   Order Deny,Allow
   Deny from all
   Allow from all
&lt;/Location&gt;</pre>
<p>Save the httpd.conf-user file and restart apache with:</p>
<pre class="brush: bash; title: ; notranslate">/usr/syno/etc/rc.d/S97apache-user.sh restart</pre>
<p>You can now obtain the apache server status by querying the following url:</p>
<p>http://diskstation/server-status?auto</p>
<p>This might be useful for people working with cacti.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.strengholt-online.nl/synology-monitoring-apache-with-mod_status/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Synology: Run sabnzbd behind apache</title>
		<link>http://www.strengholt-online.nl/synology-run-sabnzbd-behind-apache/</link>
		<comments>http://www.strengholt-online.nl/synology-run-sabnzbd-behind-apache/#comments</comments>
		<pubDate>Mon, 04 Mar 2013 14:21:34 +0000</pubDate>
		<dc:creator>Piethein Strengholt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[behind]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[sabnzbd]]></category>
		<category><![CDATA[Synology]]></category>

		<guid isPermaLink="false">http://www.strengholt-online.nl/?p=998</guid>
		<description><![CDATA[Here&#8217;s a quick instruction for those who would like to run sabnzbd behind apache on a synology nas system. Open up a ssh connection, create the following file: Copy paste the contents below to this file. Please note that my sabnzbd port is 9090. If you would like to change this, change the config file [...]]]></description>
				<content:encoded><![CDATA[<p>Here&#8217;s a quick instruction for those who would like to run sabnzbd behind apache on a synology nas system. Open up a ssh connection, create the following file:</p>
<pre class="brush: bash; title: ; notranslate">nano /usr/syno/etc/sites-enabled-user/sabnzbd.conf</pre>
<p>Copy paste the contents below to this file. Please note that my sabnzbd port is 9090. If you would like to change this, change the config file below.</p>
<pre class="brush: bash; title: ; notranslate"># Put this after the other LoadModule directives
LoadModule proxy_module /usr/syno/apache/modules/mod_proxy.so
LoadModule proxy_http_module /usr/syno/apache/modules/mod_proxy_http.so

&lt;Location /sabnzbd&gt;
order deny,allow
deny from all
allow from all
ProxyPass http://localhost:9090/sabnzbd
ProxyPassReverse http://localhost:9090/sabnzbd
&lt;/Location&gt;</pre>
<p>Save the file by using control-x. Restart apache with the following command:</p>
<pre class="brush: bash; title: ; notranslate">/usr/syno/etc/rc.d/S97apache-user.sh restart</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.strengholt-online.nl/synology-run-sabnzbd-behind-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Restore / Extract Plesk 9.5.4 backup</title>
		<link>http://www.strengholt-online.nl/restore-extract-plesk-9-5-4-backup/</link>
		<comments>http://www.strengholt-online.nl/restore-extract-plesk-9-5-4-backup/#comments</comments>
		<pubDate>Mon, 24 Dec 2012 14:54:37 +0000</pubDate>
		<dc:creator>Piethein Strengholt</dc:creator>
				<category><![CDATA[Plesk]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Restore]]></category>

		<guid isPermaLink="false">http://www.strengholt-online.nl/?p=989</guid>
		<description><![CDATA[If you want to do a manual restore of your Plesk 9.5.4 backup you should use the following commando: The domains, vhosts and databases are found in the clients, domains and resellers folders.]]></description>
				<content:encoded><![CDATA[<p>If you want to do a manual restore of your Plesk 9.5.4 backup you should use the following commando:</p>
<pre class="brush: bash; title: ; notranslate">cat plesk-backup_1205270308.tar* | tar xvf -</pre>
<p>The domains, vhosts and databases are found in the clients, domains and resellers folders.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.strengholt-online.nl/restore-extract-plesk-9-5-4-backup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>updatedb on Synology</title>
		<link>http://www.strengholt-online.nl/updatedb-on-synology/</link>
		<comments>http://www.strengholt-online.nl/updatedb-on-synology/#comments</comments>
		<pubDate>Wed, 19 Dec 2012 13:10:00 +0000</pubDate>
		<dc:creator>Piethein Strengholt</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Synology]]></category>
		<category><![CDATA[updatedb]]></category>

		<guid isPermaLink="false">http://www.strengholt-online.nl/?p=966</guid>
		<description><![CDATA[If you would like to index your Synology file system you should install the mlocate package from optware Install then the  mlocate package with the following command: To update your filesystem use: To then search use the locate command.]]></description>
				<content:encoded><![CDATA[<p>If you would like to index your Synology file system you should install the mlocate package from <a href="http://forum.synology.com/wiki/index.php/Overview_on_modifying_the_Synology_Server,_bootstrap,_ipkg_etc">optware</a></p>
<p>Install then the  mlocate package with the following command:</p>
<pre class="brush: bash; title: ; notranslate">ipkg install mlocate</pre>
<p>To update your filesystem use:</p>
<pre class="brush: bash; title: ; notranslate">updatedb</pre>
<p>To then search use the locate command.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.strengholt-online.nl/updatedb-on-synology/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Useful rc.local script on synology</title>
		<link>http://www.strengholt-online.nl/useful-rc-local-script-on-synology/</link>
		<comments>http://www.strengholt-online.nl/useful-rc-local-script-on-synology/#comments</comments>
		<pubDate>Fri, 29 Jun 2012 14:59:03 +0000</pubDate>
		<dc:creator>Piethein Strengholt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Synology]]></category>

		<guid isPermaLink="false">http://www.strengholt-online.nl/?p=956</guid>
		<description><![CDATA[Here&#8217;s a useful rc.local script which restores the optware (ipkg) functionality after an upgrade:]]></description>
				<content:encoded><![CDATA[<p>Here&#8217;s a useful rc.local script which restores the optware (ipkg) functionality after an upgrade:</p>
<pre class="brush: bash; title: ; notranslate">#!/bin/sh

#optware fixes http://forum.synology.com/enu/viewtopic.php?f=189&amp;amp;t=46095
mount -o bind /volume1/@optware /opt

# remount with noatime
mount -o remount,noatime /
mount -o remount,noatime /volume1

# enable debug spindown
syno_hibernate_debug_tool --enable 10

# Optware setup
[ -x /etc/rc.optware ] &amp;&amp; /etc/rc.optware start

# configure ssh to run on 443
if ! grep &quot;Port 443&quot; /etc/ssh/sshd_config ; then
sed -i &quot;s/Port 22/#Port 22/g&quot; /etc/ssh/sshd_config
echo 'Port 443' &amp;gt;&amp;gt; /etc/ssh/sshd_config
/usr/syno/etc.defaults/rc.d/S95sshd.sh restart
fi

# restore /opt/bin path
if ! grep &quot;/opt/bin&quot; /root/.profile ; then
sed -i &quot;s/PATH=/PATH=\/opt\/bin:/g&quot; /root/.profile
fi

exit 0</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.strengholt-online.nl/useful-rc-local-script-on-synology/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Howto to authenticate with apache against the /etc/passwd file</title>
		<link>http://www.strengholt-online.nl/howto-to-authenticate-with-apache-against-etcpasswd-file/</link>
		<comments>http://www.strengholt-online.nl/howto-to-authenticate-with-apache-against-etcpasswd-file/#comments</comments>
		<pubDate>Fri, 08 Jun 2012 09:04:56 +0000</pubDate>
		<dc:creator>Piethein Strengholt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.strengholt-online.nl/?p=935</guid>
		<description><![CDATA[I used the following files to let apache authenticate against the local /etc/passwd file. The perl-pass.nl is used to generate a file based on the /etc/passwd and shadow file. You can place this in the crontab for example. Only the lower id&#8217;s are used, so root won&#8217;t be in the list. The index.php reads from [...]]]></description>
				<content:encoded><![CDATA[<p>I used the following files to let apache authenticate against the local /etc/passwd file.</p>
<p>The perl-pass.nl is used to generate a file based on the /etc/passwd and shadow file. You can place this in the crontab for example. Only the lower id&#8217;s are used, so root won&#8217;t be in the list.</p>
<p>The index.php reads from the passwd.html file generated by the perl script and will redirect the users to welcome.php when a correct password and username are used.</p>
<ul>
<li><strong><a href="http://www.strengholt-online.nl/wp-content/uploads/2012/passwd/perl-pass.txt">perl-pass.pl</a></strong></li>
<li><strong><a href="http://www.strengholt-online.nl/wp-content/uploads/2012/passwd/index.txt">index.php</a></strong></li>
<li><strong><a href="http://www.strengholt-online.nl/wp-content/uploads/2012/passwd/welcome.txt">welcome.php</a></strong></li>
</ul>
<p>perl-pass.pl</p>
<pre class="brush: perl; title: ; notranslate">#!/usr/bin/perl
#

open(PASSWD,&quot;/etc/passwd&quot;);
open(SHADOW,&quot;/etc/shadow&quot;);
open(FLATFILE,&quot;&gt;/var/www/passwd.httpd&quot;);
while(&lt;SHADOW&gt;){
        chop;
        ($uname,$temppass)=split(/:/);
        $pass{$uname}=$temppass;
}
while(&lt;PASSWD&gt;){
        chop;
        ($uname,$temppass,$uid,$gid,$fn,$homedir,$shell)=split(/:/);
        if ($temppass ne 'x'){ $pass{$uname}=$temppass; }
        if ($uid&gt;=500) {
                print FLATFILE
&quot;$uname:$pass{$uname}:$uid:$gid:$fn:$homedir:$shell\n&quot;;
        }
}

close(PASSWD);
close(SHADOW);
close(FLATFILE);
chmod(0644,&quot;/var/www/passwd.httpd&quot;);
chown(65534,65534,&quot;/var/www/passwd.httpd&quot;);</pre>
<p>index.php</p>
<pre class="brush: php; title: ; notranslate">&lt;? session_start() ?&gt;

&lt;html&gt;
&lt;body&gt;
&lt;p align=&quot;center&quot;&gt;&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;&lt;b&gt;Welcome to Server Manager&lt;/b&gt;
&lt;/p&gt;
&lt;table align=&quot;center&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; bordercolor=&quot;#CCCCCC&quot;&gt;
&lt;tr&gt;&lt;td&gt;
&lt;form method=&quot;POST&quot; action=&quot;index.php&quot;&gt;
  Username: &lt;/td&gt;&lt;td&gt;
  &lt;input type=&quot;text&quot; name=&quot;username&quot; size=&quot;19&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;br&gt;
  &lt;tr&gt;&lt;td&gt;Password: &amp;nbsp;&lt;/td&gt;&lt;td&gt;
  &lt;input type=&quot;password&quot; name=&quot;password&quot; size=&quot;19&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td colspan=&quot;2&quot; align=&quot;center&quot;&gt;
    &lt;br&gt;&lt;input type=&quot;submit&quot; value=&quot;Login&quot;&gt;
&lt;/form&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;/body&gt;
&lt;/html&gt;

&lt;?
// Var
$user = ($_POST['username']);
$pass = ($_POST['password']);
$autharray = file(&quot;/var/www/passwd.httpd&quot;); 

// Check passwd
for ($x = 0; $x &lt; count($autharray); $x++)
  {
   if (eregi(&quot;^$user:&quot;, $autharray[$x])) {
       $passwd = explode(&quot;:&quot;, $autharray[$x]);
       $salt =  substr($passwd[1],0,11);
       $cryptpw = crypt($pass,$salt);
       if ($cryptpw == $passwd[1]) {
		// Succes
             	echo &quot;&lt;br&gt;&lt;p align='center'&gt;Username found on&lt;/p&gt;&quot;;
		echo &quot;&lt;br&gt;&lt;p align='center'&gt;Starting connection: $_SESSION[user]...   Moment Please.....&lt;/p&gt;&quot;;
		$_SESSION['user'] 		= $user;
		$_SESSION['server'] 		= $servername;
		if ( $_SESSION['user'] == &quot;admin&quot; ) { 
			echo&quot; &lt;META HTTP-EQUIV='Refresh' CONTENT='1; URL=admin_overview.php'&gt; &quot;;
		} else {
			echo&quot; &lt;META HTTP-EQUIV='Refresh' CONTENT='1; URL=welcome.php'&gt; &quot;; 
		}
            } else {
			
		// Error on password
              	echo &quot;&lt;br&gt;&lt;p align='center'&gt;Wrong password or username!&lt;/p&gt;&quot;;
	      }
     	}
}
?&gt;</pre>
<p>welcome.php</p>
<pre class="brush: php; title: ; notranslate">&lt;? session_start() ?&gt;

&lt;?

if ( $_SESSION[user] == &quot;&quot; ) { 
   echo &quot;No Access!&quot;; 
} else {
   echo &quot;Welcome $_SESSION['user']&lt;/b&gt;&lt;br&gt;&lt;br&gt;&quot;;
}

?&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.strengholt-online.nl/howto-to-authenticate-with-apache-against-etcpasswd-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stop Synology index, thumb and postgresql services</title>
		<link>http://www.strengholt-online.nl/stop-synology-index-thumb-and-postgresql-services/</link>
		<comments>http://www.strengholt-online.nl/stop-synology-index-thumb-and-postgresql-services/#comments</comments>
		<pubDate>Thu, 07 Jun 2012 18:52:06 +0000</pubDate>
		<dc:creator>Piethein Strengholt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[synoindexd]]></category>
		<category><![CDATA[Synology]]></category>
		<category><![CDATA[thumb]]></category>

		<guid isPermaLink="false">http://www.strengholt-online.nl/?p=933</guid>
		<description><![CDATA[If your synology NAS is slowing down your speed, you might want to give the following commands a try:]]></description>
				<content:encoded><![CDATA[<p>If your synology NAS is slowing down your speed, you might want to give the following commands a try:</p>
<pre class="brush: bash; title: ; notranslate">/usr/syno/etc/rc.d/S77synomkthumbd.sh stop
/usr/syno/etc/rc.d/S66synoindexd.sh stop
/usr/syno/etc/rc.d/S20pgsql.sh stop</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.strengholt-online.nl/stop-synology-index-thumb-and-postgresql-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hyper-V backup with volume shadow</title>
		<link>http://www.strengholt-online.nl/hyper-v-backup-with-volume-shadow/</link>
		<comments>http://www.strengholt-online.nl/hyper-v-backup-with-volume-shadow/#comments</comments>
		<pubDate>Mon, 16 Apr 2012 17:26:00 +0000</pubDate>
		<dc:creator>Piethein Strengholt</dc:creator>
				<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[DataVolumeShadow]]></category>
		<category><![CDATA[diskshadow]]></category>
		<category><![CDATA[volume shadow]]></category>

		<guid isPermaLink="false">http://www.strengholt-online.nl/?p=929</guid>
		<description><![CDATA[As promised; Here&#8217;s my Hyper-v volume schadow backup script. I coded this a while ago. It pauses the hyper-v and creates a virtual shadow. The virtual machine will be started while the backup is running. This results in a minimum downtime. Useful for small production or test environments. backup.bat shadowcreate.txt vmcopy.vbs vmsavestate.vbs vmstart.vbs]]></description>
				<content:encoded><![CDATA[<p>As promised; Here&#8217;s my Hyper-v volume schadow backup script. I coded this a while ago.</p>
<p>It pauses the hyper-v and creates a virtual shadow. The virtual machine will be started while the backup is running. This results in a minimum downtime. Useful for small production or test environments.</p>
<p><strong>backup.bat</strong></p>
<pre class="brush: bash; title: ; notranslate">diskshadow -s shadowcreate.txt</pre>
<p><strong>shadowcreate.txt</strong></p>
<pre class="brush: bash; title: ; notranslate">#DiskShadow script file
delete shadows all
list providers
set context persistent
set metadata D:\MetaData.cab
set verbose on

#Create network share
EXEC vmnetwork.cmd

#Write save state files to harddisk before start backup
EXEC vmsavestate.cmd

begin backup

add volume d: alias DataVolumeShadow

#verify the &quot;Microsoft Hyper-V VSS Writer&quot; writer will be included in the snapshot
#writer verify {66841cd4-6ded-4f4b-8f17-fd23f8ddc3de}
create

expose %DataVolumeShadow% q:

#Start Virtual Machine
EXEC vmstart.cmd

#copy all files to d:\backup
EXEC vmcopy.cmd

unexpose q:
end backup
delete shadows all

#End of script</pre>
<p><strong>vmcopy.vbs</strong></p>
<pre class="brush: vb; title: ; notranslate">'Usage: cscript //NoLogo vmcopy.vbs D:\Backup\
'todo: mailfunctie
'todo: meer logging

Dim ArgObj, backuppath, count
Set ArgObj = WScript.Arguments
backuppath = ArgObj(0)

On Error Resume Next

Set objFS = CreateObject(&quot;Scripting.FileSystemObject&quot;)

Dim iSpc
Set objWMIService = GetObject(&quot;winmgmts:&quot;)
Set objLogicalDisk = objWMIService.Get(&quot;Win32_LogicalDisk.DeviceID='X:'&quot;)
iSpc = objLogicalDisk.FreeSpace/1024/1024
iSpc = FormatNumber(iSpc,0)
Wscript.Echo &quot;Free space on Harddisk: &quot; &amp;amp; iSpc &amp;amp; &quot;GB&quot;

Dim Directory
Set Directory = objFS.GetFolder(&quot;Q:\Hyper-V&quot;)
Dim Dsize
Dsize = Directory.Size/1024/1024
Dsize = FormatNumber(Dsize,0)
Wscript.Echo &quot;Folder size to back-up: &quot; &amp;amp; Dsize &amp;amp; &quot;GB&quot;

Dim BackupLocation
Set BackupLocation = objFS.GetFolder(backuppath)
Dim Tel
Dim Minimum
Minimum = Dsize + 30*1024
Minimum = FormatNumber(Minimum,0)
Wscript.Echo &quot;Folder size needed: &quot; &amp;amp; Minimum &amp;amp; &quot;GB&quot;

Wscript.Echo &quot;Amount of Backup* directories found is: &quot; &amp;amp; ArgObj(1)
count = ArgObj(1)

Wscript.Echo &quot;Looking for &quot; &amp;amp; backuppath
If objFS.FolderExists(backuppath) then
Wscript.Echo &quot;No need to create &quot; &amp;amp; backuppath
Else
objFS.CreateFolder(backuppath)
Wscript.Echo &quot;Path not found.... Creating: &quot; &amp;amp; backuppath
End If
WScript.Sleep 200

If objFS.FolderExists(backuppath &amp;amp; &quot;Backup0&quot; &amp;amp; count) then
Wscript.Echo &quot;Delete folder: &quot; &amp;amp; backuppath &amp;amp; &quot;Backup0&quot; &amp;amp; count
objFS.DeleteFolder(backuppath &amp;amp; &quot;Backup0&quot; &amp;amp; count)
WScript.Sleep 200
Else
Wscript.Echo &quot;Folder not found.... &quot; &amp;amp; backuppath &amp;amp; &quot;Backup0&quot; &amp;amp; count
WScript.Sleep 200
End If

Do While count &amp;gt; 1

If objFS.FolderExists(backuppath &amp;amp; &quot;Backup0&quot; &amp;amp; count - 1) then
Wscript.Echo &quot;Rename folder: &quot; &amp;amp; backuppath &amp;amp; &quot;Backup0&quot; &amp;amp; count - 1 &amp;amp; &quot; to Backup0&quot; &amp;amp; count
objFS.MoveFolder backuppath &amp;amp; &quot;Backup0&quot; &amp;amp; count - 1 , backuppath &amp;amp; &quot;Backup0&quot; &amp;amp; count
WScript.Sleep 200
Else
Wscript.Echo &quot;Path not found.... &quot; &amp;amp; backuppath &amp;amp; &quot;Backup0&quot; &amp;amp; count -1
WScript.Sleep 200
End If

count = count - 1

Loop

Wscript.Echo &quot;Create folder: &quot; &amp;amp; backuppath &amp;amp; &quot;Backup0&quot; &amp;amp; count
objFS.CreateFolder(backuppath &amp;amp; &quot;Backup0&quot; &amp;amp; count)
WScript.Sleep 200

Wscript.Echo &quot;Copying files to destination folder&quot;
objFS.CopyFolder &quot;Q:\Hyper-V&quot;, backuppath &amp;amp; &quot;Backup01\&quot;
Wscript.Echo &quot;Move MetaData.cab to destination folder&quot;
objFS.MoveFile &quot;D:\MetaData.cab&quot;, backuppath &amp;amp; &quot;Backup01\&quot;

Wscript.Echo &quot;Back-up done!&quot;</pre>
<p><strong>vmsavestate.vbs</strong></p>
<pre class="brush: vb; title: ; notranslate">Option Explicit
Dim WMIService
Dim VMList
Dim VMName
Dim ArgObj
Set ArgObj = WScript.Arguments

'Specify the name of the virtual machine that I want to start
VMName = ArgObj(0)

'Get instance of 'virtualization' WMI service on the local computer
Set WMIService = GetObject(&quot;winmgmts:\\.\root\virtualization&quot;)

'Get all the MSVM_ComputerSystem object
Set VMList = WMIService.ExecQuery(&quot;SELECT * FROM Msvm_ComputerSystem WHERE ElementName='&quot; &amp;amp; VMName &amp;amp; &quot;'&quot;)

WScript.Echo &quot;=============================================&quot;
WScript.Echo &quot;VM Name: &quot; &amp;amp; VMList.ItemIndex(0).ElementName
WScript.Echo &quot;VM GUID: &quot; &amp;amp; VMList.ItemIndex(0).Name
WScript.Echo &quot;VM State: &quot; &amp;amp; VMList.ItemIndex(0).EnabledState
WScript.Echo &quot;=============================================&quot;

If VMList.ItemIndex(0).EnabledState = 3 Then
WScript.Echo &quot;Virtual Machine is turned off, no need for saving&quot;
Else

'Request a state change on the first VM that is returned
'2 = start, 3 = stop and 32769 = save state
VMList.ItemIndex(0).RequestStateChange(32769)

'Wait till save state is done
while not VMList.ItemIndex(0).EnabledState = 32769
Set VMList = WMIService.ExecQuery(&quot;SELECT * FROM Msvm_ComputerSystem WHERE ElementName='&quot; &amp;amp; VMName &amp;amp; &quot;'&quot;)
WScript.Echo &quot;VM State: &quot; &amp;amp; VMList.ItemIndex(0).EnabledState
WScript.Sleep 1500
wend
WScript.Echo &quot;=============================================&quot;
Wscript.Echo &quot;Save State-Succeeded!&quot;
WScript.Echo &quot;=============================================&quot;

End If</pre>
<p><strong>vmstart.vbs</strong></p>
<pre class="brush: vb; title: ; notranslate">Option Explicit
Dim WMIService
Dim VMList
Dim VMName
Dim ArgObj
Set ArgObj = WScript.Arguments

'Specify the name of the virtual machine that I want to start
VMName = ArgObj(0)

'Get instance of 'virtualization' WMI service on the local computer
Set WMIService = GetObject(&quot;winmgmts:\\.\root\virtualization&quot;)

'Get all the MSVM_ComputerSystem object
Set VMList = WMIService.ExecQuery(&quot;SELECT * FROM Msvm_ComputerSystem WHERE ElementName='&quot; &amp;amp; VMName &amp;amp; &quot;'&quot;)

WScript.Echo &quot;=============================================&quot;
WScript.Echo &quot;VM Name: &quot; &amp;amp; VMList.ItemIndex(0).ElementName
WScript.Echo &quot;VM GUID: &quot; &amp;amp; VMList.ItemIndex(0).Name
WScript.Echo &quot;VM State: &quot; &amp;amp; VMList.ItemIndex(0).EnabledState
WScript.Echo &quot;=============================================&quot;

If VMList.ItemIndex(0).EnabledState = 3 Then
WScript.Echo &quot;Virtual Machine is turned off, no need to start it&quot;
Else

'Request a state change on the first VM that is returned
'2 = start, 3 = stop and 32769 = save state
VMList.ItemIndex(0).RequestStateChange(2)

'Wait till save state is done
while not VMList.ItemIndex(0).EnabledState = 2
Set VMList = WMIService.ExecQuery(&quot;SELECT * FROM Msvm_ComputerSystem WHERE ElementName='&quot; &amp;amp; VMName &amp;amp; &quot;'&quot;)
WScript.Echo &quot;VM State: &quot; &amp;amp; VMList.ItemIndex(0).EnabledState
WScript.Sleep 1500
wend
WScript.Echo &quot;=============================================&quot;
Wscript.Echo &quot;Start-Succeeded!&quot;
WScript.Echo &quot;=============================================&quot;

End If</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.strengholt-online.nl/hyper-v-backup-with-volume-shadow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
