<?xml version="1.0" encoding="iso-8859-1"?><!-- generator="b2evolution/3.3.3" -->
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>phaoost's diginotes</title>
		<link>http://phaoost.net/weblog/index.php</link>
		<atom:link rel="self" type="application/rss+xml" href="http://phaoost.net/weblog/index.php?tempskin=_rss2" />
		<description></description>
		<language>en-EU</language>
		<docs>http://blogs.law.harvard.edu/tech/rss</docs>
		<admin:generatorAgent rdf:resource="http://b2evolution.net/?v=3.3.3"/>
		<ttl>60</ttl>
				<item>
			<title>qemu windows guest with audio over network using pulseaudio</title>
			<link>http://phaoost.net/weblog/index.php/2010/02/08/qemu-windows-guest-with-audio-over</link>
			<pubDate>Sun, 07 Feb 2010 23:39:06 +0000</pubDate>			<dc:creator>phaoost</dc:creator>
			<category domain="main">notes</category>			<guid isPermaLink="false">124@http://phaoost.net/weblog/</guid>
						<description>&lt;p&gt;Recently I had to install Windows XP to run under qemu on Debian to be able to run some chat program which cannot be run in Linux/Wine. I used to work from laptop, however I have a workstation so I decided to run qemu on it to minimize CPU load on a laptop. However, I needed to make sound to work on the network so I could hear chat alerts on the laptop.&lt;/p&gt;

&lt;p&gt;Herebelow is what I did.&lt;/p&gt;

&lt;p&gt;On the workstation:&lt;br /&gt;
Created /home/phaoost/bin/winxp.sh:&lt;br /&gt;
&lt;code&gt;#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
export QEMU_AUDIO_DRV=pa&lt;br /&gt;
export QEMU_PA_SAMPLES=512  # Experimental values&lt;br /&gt;
export QEMU_PA_DIVISOR=0    # on which I got the sound with no jitter&lt;br /&gt;
&lt;br /&gt;
ARGS=&quot;-usb -usbdevice tablet -usbdevice host:auto:*.* -net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=/etc/qemu-ifup -m 1024 -localtime -hdc /dev/sda -soundhw sb16 /var/pub/winxp.dsk&quot;&lt;br /&gt;
/usr/sbin/tunctl -u phaoost -t tap0&lt;br /&gt;
echo &quot;Starting QEMU with...&quot;&lt;br /&gt;
echo $ARGS&lt;br /&gt;
echo &quot;....&quot;&lt;br /&gt;
exec kvm $ARGS&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Added to /etc/sudoers:&lt;br /&gt;
&lt;code&gt;Cmnd_Alias      QEMU=/sbin/ifconfig, \&lt;br /&gt;
                        /sbin/modprobe, \&lt;br /&gt;
                        /usr/sbin/brctl&lt;br /&gt;
phaoost ALL=NOPASSWD: QEMU&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Created /etc/qemu-ifup:&lt;br /&gt;
&lt;code&gt;#!/bin/sh&lt;br /&gt;
echo &quot;Executing /etc/qemu-ifup&quot;&lt;br /&gt;
echo &quot;Bringing up $1 for bridged mode...&quot;&lt;br /&gt;
sudo /sbin/ifconfig $1 0.0.0.0 promisc up&lt;br /&gt;
echo &quot;Adding $1 to br0...&quot;&lt;br /&gt;
sudo /usr/sbin/brctl addif br0 $1&lt;br /&gt;
sleep 2&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Added to /etc/pulse/client.conf:&lt;br /&gt;
&lt;code&gt;default-server = tcp:172.16.17.3:4713  # Laptop IP&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Adjusted /etc/network/interfaces with following:&lt;br /&gt;
&lt;code&gt;auto br0&lt;br /&gt;
iface br0 inet static&lt;br /&gt;
        address 172.16.17.7&lt;br /&gt;
        netmask 255.255.255.224&lt;br /&gt;
        gateway 172.16.17.30&lt;br /&gt;
        bridge_ports eth1&lt;br /&gt;
        bridge_fd 9&lt;br /&gt;
        bridge_hello 2&lt;br /&gt;
        bridge_maxage 12&lt;br /&gt;
        bridge_stp off&lt;br /&gt;
&lt;br /&gt;
# The primary network interface&lt;br /&gt;
allow-hotplug eth0&lt;br /&gt;
iface eth0 inet dhcp&lt;br /&gt;
&lt;br /&gt;
#allow-hotplug eth1&lt;br /&gt;
iface eth1 inet manual&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;On the laptop:&lt;br /&gt;
In /etc/pulse/default.pa added the following line:&lt;br /&gt;
&lt;code&gt;load-module module-native-protocol-tcp auth-ip-acl=172.16.17.0/27  # My LAN&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After that I could capture all windows sounds on a laptop.&lt;/p&gt;

&lt;p&gt;Pretty easy, however it took me hours of research to make it work &lt;img src=&quot;http://phaoost.net/weblog/rsc/smilies/icon_smile.gif&quot; alt=&quot;&amp;#58;&amp;#41;&quot; class=&quot;middle&quot; /&gt;&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://phaoost.net/weblog/index.php/2010/02/08/qemu-windows-guest-with-audio-over&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>Recently I had to install Windows XP to run under qemu on Debian to be able to run some chat program which cannot be run in Linux/Wine. I used to work from laptop, however I have a workstation so I decided to run qemu on it to minimize CPU load on a laptop. However, I needed to make sound to work on the network so I could hear chat alerts on the laptop.</p>

<p>Herebelow is what I did.</p>

<p>On the workstation:<br />
Created /home/phaoost/bin/winxp.sh:<br />
<code>#!/bin/sh<br />
<br />
export QEMU_AUDIO_DRV=pa<br />
export QEMU_PA_SAMPLES=512  # Experimental values<br />
export QEMU_PA_DIVISOR=0    # on which I got the sound with no jitter<br />
<br />
ARGS="-usb -usbdevice tablet -usbdevice host:auto:*.* -net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=/etc/qemu-ifup -m 1024 -localtime -hdc /dev/sda -soundhw sb16 /var/pub/winxp.dsk"<br />
/usr/sbin/tunctl -u phaoost -t tap0<br />
echo "Starting QEMU with..."<br />
echo $ARGS<br />
echo "...."<br />
exec kvm $ARGS</code></p>

<p>Added to /etc/sudoers:<br />
<code>Cmnd_Alias      QEMU=/sbin/ifconfig, \<br />
                        /sbin/modprobe, \<br />
                        /usr/sbin/brctl<br />
phaoost ALL=NOPASSWD: QEMU</code></p>

<p>Created /etc/qemu-ifup:<br />
<code>#!/bin/sh<br />
echo "Executing /etc/qemu-ifup"<br />
echo "Bringing up $1 for bridged mode..."<br />
sudo /sbin/ifconfig $1 0.0.0.0 promisc up<br />
echo "Adding $1 to br0..."<br />
sudo /usr/sbin/brctl addif br0 $1<br />
sleep 2</code></p>

<p>Added to /etc/pulse/client.conf:<br />
<code>default-server = tcp:172.16.17.3:4713  # Laptop IP</code></p>

<p>Adjusted /etc/network/interfaces with following:<br />
<code>auto br0<br />
iface br0 inet static<br />
        address 172.16.17.7<br />
        netmask 255.255.255.224<br />
        gateway 172.16.17.30<br />
        bridge_ports eth1<br />
        bridge_fd 9<br />
        bridge_hello 2<br />
        bridge_maxage 12<br />
        bridge_stp off<br />
<br />
# The primary network interface<br />
allow-hotplug eth0<br />
iface eth0 inet dhcp<br />
<br />
#allow-hotplug eth1<br />
iface eth1 inet manual</code></p>

<p>On the laptop:<br />
In /etc/pulse/default.pa added the following line:<br />
<code>load-module module-native-protocol-tcp auth-ip-acl=172.16.17.0/27  # My LAN</code></p>

<p>After that I could capture all windows sounds on a laptop.</p>

<p>Pretty easy, however it took me hours of research to make it work <img src="http://phaoost.net/weblog/rsc/smilies/icon_smile.gif" alt="&#58;&#41;" class="middle" /></p><div class="item_footer"><p><small><a href="http://phaoost.net/weblog/index.php/2010/02/08/qemu-windows-guest-with-audio-over">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://phaoost.net/weblog/index.php/2010/02/08/qemu-windows-guest-with-audio-over#comments</comments>
			<wfw:commentRss>http://phaoost.net/weblog/index.php?tempskin=_rss2&#38;disp=comments&#38;p=124</wfw:commentRss>
		</item>
				<item>
			<title>IP over IP tunnel setup on Debian Lenny</title>
			<link>http://phaoost.net/weblog/index.php/2009/03/17/ip-over-ip-tunnel-setup-on-debian</link>
			<pubDate>Tue, 17 Mar 2009 06:27:05 +0000</pubDate>			<dc:creator>phaoost</dc:creator>
			<category domain="main">notes</category>			<guid isPermaLink="false">123@http://phaoost.net/weblog/</guid>
						<description>&lt;p&gt;Quick setup IP-over-IP (protocol 4) tunnel on Debian 5.0&lt;/p&gt;

&lt;p&gt;192.168.x.x - router LAN IP&lt;br /&gt;
192.168.x.y - local LAN IP&lt;br /&gt;
172.16.x.x - router tunnel IP&lt;br /&gt;
172.16.x.y - local tunnel IP&lt;/p&gt;

&lt;p&gt;On router add to /etc/network/interfaces:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;# ipip tunnel&lt;br /&gt;
iface ipip0 inet static&lt;br /&gt;
        address 172.16.x.x&lt;br /&gt;
        netmask 255.255.255.255&lt;br /&gt;
        pointopoint 172.16.x.y&lt;br /&gt;
        mtu 1480&lt;br /&gt;
        pre-up  /sbin/ip tunnel add ipip0 mode ipip remote 192.168.x.y local 192.168.x.x dev eth0&lt;br /&gt;
        post-down /sbin/ip tunnel del ipip0&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;On local system add same lines to /etc/network/interfaces switching local and remote IPs. Then use ifup/ifdown to add/remove ipip0 interface&lt;/p&gt;

&lt;p&gt;Following rule may need to exist in iptables mangle table on both systems:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;-A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu&lt;/code&gt;&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://phaoost.net/weblog/index.php/2009/03/17/ip-over-ip-tunnel-setup-on-debian&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>Quick setup IP-over-IP (protocol 4) tunnel on Debian 5.0</p>

<p>192.168.x.x - router LAN IP<br />
192.168.x.y - local LAN IP<br />
172.16.x.x - router tunnel IP<br />
172.16.x.y - local tunnel IP</p>

<p>On router add to /etc/network/interfaces:</p>

<p><code># ipip tunnel<br />
iface ipip0 inet static<br />
        address 172.16.x.x<br />
        netmask 255.255.255.255<br />
        pointopoint 172.16.x.y<br />
        mtu 1480<br />
        pre-up  /sbin/ip tunnel add ipip0 mode ipip remote 192.168.x.y local 192.168.x.x dev eth0<br />
        post-down /sbin/ip tunnel del ipip0</code></p>

<p>On local system add same lines to /etc/network/interfaces switching local and remote IPs. Then use ifup/ifdown to add/remove ipip0 interface</p>

<p>Following rule may need to exist in iptables mangle table on both systems:</p>

<p><code>-A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu</code></p><div class="item_footer"><p><small><a href="http://phaoost.net/weblog/index.php/2009/03/17/ip-over-ip-tunnel-setup-on-debian">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://phaoost.net/weblog/index.php/2009/03/17/ip-over-ip-tunnel-setup-on-debian#comments</comments>
			<wfw:commentRss>http://phaoost.net/weblog/index.php?tempskin=_rss2&#38;disp=comments&#38;p=123</wfw:commentRss>
		</item>
				<item>
			<title>Installing maemo sdk and scratchbox on Debian Sid amd64</title>
			<link>http://phaoost.net/weblog/index.php/2008/12/07/installing-maemo-sdk-and-scratchbox-on</link>
			<pubDate>Sun, 07 Dec 2008 12:07:02 +0000</pubDate>			<dc:creator>phaoost</dc:creator>
			<category domain="main">notes</category>			<guid isPermaLink="false">121@http://phaoost.net/weblog/</guid>
						<description>&lt;p&gt;scratchbox and maemo sdk using i386 binaries which will work fine on amd64 though.&lt;/p&gt;

&lt;p&gt;First, download &lt;a href=&quot;http://repository.maemo.org/stable/4.1.1/maemo-scratchbox-install_4.1.1.sh&quot;&gt;maemo-scratchbox-install_4.1.1.sh&lt;/a&gt; and comment out 'exit 1' at line 447.&lt;/p&gt;

&lt;p&gt;Then run it with:&lt;br /&gt;
&lt;code&gt;sudo bash maemo-scratchbox-install_4.1.1.sh -s /scratchbox&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you get&lt;br /&gt;
&lt;code&gt;Inconsistency detected by ld.so: rtld.c: 1192: dl_main: Assertion `(void *) ph-&gt;p_vaddr == _rtld_local._dl_sysinfo_dso' failed!&lt;/code&gt;&lt;br /&gt;
after running &lt;em&gt;/scratchbox/login&lt;/em&gt; you may need to add to &lt;em&gt;/etc/sysctl.conf&lt;/em&gt; following lines:&lt;br /&gt;
&lt;code&gt;vm.mmap_min_addr = 4096&lt;br /&gt;
abi.vsyscall32 = 0&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then run &lt;em&gt;sudo sysctl -p&lt;/em&gt; and proceed with installation.&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://phaoost.net/weblog/index.php/2008/12/07/installing-maemo-sdk-and-scratchbox-on&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>scratchbox and maemo sdk using i386 binaries which will work fine on amd64 though.</p>

<p>First, download <a href="http://repository.maemo.org/stable/4.1.1/maemo-scratchbox-install_4.1.1.sh">maemo-scratchbox-install_4.1.1.sh</a> and comment out 'exit 1' at line 447.</p>

<p>Then run it with:<br />
<code>sudo bash maemo-scratchbox-install_4.1.1.sh -s /scratchbox</code></p>

<p>If you get<br />
<code>Inconsistency detected by ld.so: rtld.c: 1192: dl_main: Assertion `(void *) ph->p_vaddr == _rtld_local._dl_sysinfo_dso' failed!</code><br />
after running <em>/scratchbox/login</em> you may need to add to <em>/etc/sysctl.conf</em> following lines:<br />
<code>vm.mmap_min_addr = 4096<br />
abi.vsyscall32 = 0</code></p>

<p>Then run <em>sudo sysctl -p</em> and proceed with installation.</p><div class="item_footer"><p><small><a href="http://phaoost.net/weblog/index.php/2008/12/07/installing-maemo-sdk-and-scratchbox-on">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://phaoost.net/weblog/index.php/2008/12/07/installing-maemo-sdk-and-scratchbox-on#comments</comments>
			<wfw:commentRss>http://phaoost.net/weblog/index.php?tempskin=_rss2&#38;disp=comments&#38;p=121</wfw:commentRss>
		</item>
				<item>
			<title>Setting up VPN with default gateway from ISP on a Linux router</title>
			<link>http://phaoost.net/weblog/index.php/2008/09/10/setting-up-vpn-with-default-gateway-from</link>
			<pubDate>Tue, 09 Sep 2008 23:01:32 +0000</pubDate>			<dc:creator>phaoost</dc:creator>
			<category domain="main">notes</category>			<guid isPermaLink="false">120@http://phaoost.net/weblog/</guid>
						<description>&lt;p&gt;This short article describes how to set up PPTP or OpenVPN connection and leave default gateway to point to ISP on a Linux router while having incoming connectivity from a VPN.&lt;/p&gt;

&lt;p&gt;1. Download &lt;a href=&quot;http://phaoost.net/files/router-script.sh&quot;&gt;router-script.sh&lt;/a&gt;. Edit DEV_GW and DEV_TUN to point to proper devices (see route -n output to determine which devices are used). DEV_GW is a device which connected with your ISP and TUN_GW - VPN device (usually ppp0 for PPTP or tun0 for OpenVPN)&lt;/p&gt;


&lt;p&gt;2. If you are using OpenVPN, comment out 'redirect-gateway' keyword in configuration file. Establish a VPN connection on the router.&lt;/p&gt;

&lt;p&gt;3. Run router-script.sh after VPN connection established.&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://phaoost.net/weblog/index.php/2008/09/10/setting-up-vpn-with-default-gateway-from&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>This short article describes how to set up PPTP or OpenVPN connection and leave default gateway to point to ISP on a Linux router while having incoming connectivity from a VPN.</p>

<p>1. Download <a href="http://phaoost.net/files/router-script.sh">router-script.sh</a>. Edit DEV_GW and DEV_TUN to point to proper devices (see route -n output to determine which devices are used). DEV_GW is a device which connected with your ISP and TUN_GW - VPN device (usually ppp0 for PPTP or tun0 for OpenVPN)</p>


<p>2. If you are using OpenVPN, comment out 'redirect-gateway' keyword in configuration file. Establish a VPN connection on the router.</p>

<p>3. Run router-script.sh after VPN connection established.</p><div class="item_footer"><p><small><a href="http://phaoost.net/weblog/index.php/2008/09/10/setting-up-vpn-with-default-gateway-from">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://phaoost.net/weblog/index.php/2008/09/10/setting-up-vpn-with-default-gateway-from#comments</comments>
			<wfw:commentRss>http://phaoost.net/weblog/index.php?tempskin=_rss2&#38;disp=comments&#38;p=120</wfw:commentRss>
		</item>
			</channel>
</rss>
