<?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>Some stuff &#187; conf</title>
	<atom:link href="http://blog.yhuang.org/?feed=rss2&#038;tag=conf" rel="self" type="application/rss+xml" />
	<link>https://blog.yhuang.org</link>
	<description>here.</description>
	<lastBuildDate>Wed, 27 Aug 2025 08:50:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>disgusting linux package installation issues</title>
		<link>https://blog.yhuang.org/?p=973</link>
		<comments>https://blog.yhuang.org/?p=973#comments</comments>
		<pubDate>Sun, 09 Dec 2012 01:13:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[call]]></category>
		<category><![CDATA[conf]]></category>
		<category><![CDATA[database configuration file]]></category>
		<category><![CDATA[default configuration file]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux package]]></category>
		<category><![CDATA[package]]></category>
		<category><![CDATA[reinstall]]></category>

		<guid isPermaLink="false">http://scripts.mit.edu/~zong/wpress/?p=973</guid>
		<description><![CDATA[Was installing a package on Linux and ran into huge problems. First, the package &#8212; let&#8217;s call it &#8216;somecrap&#8217; &#8212; contained a post-installation configuration. Linux has this terminal pseudo-GUI used sometimes for configuration of packages. You may have seen it, it looks like ASCII art. Unfortunately it&#8217;s so brittle that when you Ctrl-Z out of [...]]]></description>
			<content:encoded><![CDATA[<p>Was installing a package on Linux and ran into huge problems.</p>
<p>First, the package &#8212; let&#8217;s call it &#8216;somecrap&#8217; &#8212; contained a post-installation configuration. Linux has this terminal pseudo-GUI used sometimes for configuration of packages. You may have seen it, it looks like ASCII art. Unfortunately it&#8217;s so brittle that when you Ctrl-Z out of it there is no way to get it back. So I had to just Ctrl-C out of it. Turns out the process that runs it (&#8216;whiptail&#8217;) is stuck using 100% of CPU. So that&#8217;s fine, it too can be killed, but how to get a configuration do-over? The package thinks it&#8217;s already configured &#8212; and indeed, wrote out a default configuration file. There is no way to get a redo short of removing and reinstalling the package. Right? And that&#8217;s where the real problem starts.<br />
<span id="more-973"></span><br />
The package uses &#8216;dbconfig-common&#8217;. When you remove the package, the database modifications are not reverted (understandable), but the database configuration file &#8216;/etc/dbconfig-common/somecrap.conf&#8217; that was generated by this pseudo-GUI was also not removed. When you remove and reinstall the package, it refuses to reconfigure that file, probably because dbconfig-common thinks everything is already configured! So then I just deleted &#8216;somecrap.conf&#8217;, in the quite natural belief that the package will then rerun the configuration to generate it, like on a fresh install.</p>
<p>Turns out no. Every installation gives</p>
<p>dbconfig-common: writing config to /etc/dbconfig-common/somecrap.conf<br />
Not replacing deleted config file /etc/dbconfig-common/somecrap.conf<br />
unable to read input file /etc/dbconfig-common/somecrap.conf</p>
<p>And the configuration fails. It&#8217;s really unbelievable how fatuous &#8216;dbconfig-common&#8217; is here. Somewhere it&#8217;s tracking that &#8216;somecrap.conf&#8217; is supposed to exist, instead of determining whether it actually does, from the ground truth.</p>
<p>All the ideas about removing, purging packages, reinstalling are not going to help here. The thing that worked was to reinstall dbconfig-common, to get it to fix itself:</p>
<p>apt-get install &#8211;reinstall dbconfig-common</p>
<p>debconf then screeches about &#8216;possible database corruption&#8217; and &#8216;adding back missing question&#8217; w.r.t. &#8216;dbconfig-common&#8217;. Reinstalling &#8216;somecrap&#8217; at this point finally brings back the original pseudo-GUI configuration process.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.yhuang.org/?feed=rss2&#038;p=973</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>connection sharing on linux</title>
		<link>https://blog.yhuang.org/?p=774</link>
		<comments>https://blog.yhuang.org/?p=774#comments</comments>
		<pubDate>Mon, 05 Dec 2011 18:50:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[conf]]></category>
		<category><![CDATA[connection]]></category>
		<category><![CDATA[Edit]]></category>
		<category><![CDATA[eth]]></category>
		<category><![CDATA[init]]></category>

		<guid isPermaLink="false">http://scripts.mit.edu/~zong/wpress/?p=774</guid>
		<description><![CDATA[To turn a linux box with two network interfaces into a NAT router with the most basic functions, four separate changes are required. This is more complicated than it needs to be. For future reference: 1. Enable packet forwarding in the &#8220;registry&#8221;: Edit /etc/sysctl.conf to add net/ipv4/ip_forward=1 then > sysctl -p /etc/sysctl.conf 2. Set address [...]]]></description>
			<content:encoded><![CDATA[<p>To turn a linux box with two network interfaces into a NAT router with the most basic functions, four separate changes are required. This is more complicated than it needs to be. For future reference:</p>
<p>1. Enable packet forwarding in the &#8220;registry&#8221;:<br />
Edit <em>/etc/sysctl.conf</em> to add<br />
<em>net/ipv4/ip_forward=1</em> then<br />
> <em>sysctl -p /etc/sysctl.conf</em></p>
<p>2. Set address sharing for outbound traffic and poke holes in the firewall:<br />
Assume eth0 is the WAN-facing interface and eth1 is the LAN-facing interface, then<br />
> <em>iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE</em><br />
> <em>iptables -t filter -A FORWARD -i eth1 -o eth0 -j ACCEPT</em><br />
> <em>iptables -t filter -A FORWARD -i eth0 -o eth1 -m state &#8211;state ESTABLISHED,RELATED -j ACCEPT</em><br />
> <em>/etc/init.d/iptables save active</em><br />
> <em>/etc/init.d/iptables restart</em><br />
Turn on the iptables service in <em>sysvconfig</em></p>
<p>3. Enable automatic serving of dynamic LAN IP&#8217;s:<br />
Assume 10.0.0.x is the LAN-side subnet and 192.168.0.1 is the WAN-side DNS server or gateway, then<br />
Edit <em>/etc/dhcp3/dhcpd.conf</em> to add, e.g.<br />
<em>subnet 10.0.0.0 netmask 255.255.255.0 {<br />
&nbsp;&nbsp;&nbsp;&nbsp; range 10.0.0.2 10.0.0.10;<br />
&nbsp;&nbsp;&nbsp;&nbsp; option routers 10.0.0.1;<br />
&nbsp;&nbsp;&nbsp;&nbsp; option domain-name-servers 192.168.0.1<br />
}</em><br />
> <em>/etc/init.d/dhcp3-server restart</em></p>
<p>4. Set the LAN-facing interface to be on the LAN-side subnet:<br />
Assume 10.0.0.1 is the LAN-side address of connection sharing machine, then<br />
Edit <em>/etc/network/interfaces</em> to add<br />
<em>auto eth1<br />
iface eth1 inet static<br />
&nbsp;&nbsp;&nbsp;&nbsp; address 10.0.0.1<br />
&nbsp;&nbsp;&nbsp;&nbsp; netmask 255.255.255.0<br />
&nbsp;&nbsp;&nbsp;&nbsp; gateway 192.168.0.1</em><br />
> <em>/etc/init.d/networking restart</em></p>
]]></content:encoded>
			<wfw:commentRss>https://blog.yhuang.org/?feed=rss2&#038;p=774</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
