<?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>Mike / Michael Fogel &#187; debian</title>
	<atom:link href="http://www.fogel.ca/tag/debian/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fogel.ca</link>
	<description>soapbox and search engine spam</description>
	<lastBuildDate>Fri, 24 Jun 2011 05:50:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>HOWTO: ubuntu/debian + mobile broadband + local wired subnet = internet access</title>
		<link>http://www.fogel.ca/2010/11/15/howto-ubuntu-debian-mobile-broadband-local-wired-subnet-internet-access/</link>
		<comments>http://www.fogel.ca/2010/11/15/howto-ubuntu-debian-mobile-broadband-local-wired-subnet-internet-access/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 23:31:22 +0000</pubDate>
		<dc:creator>Mike Fogel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[t-mobile]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[wifi]]></category>

		<guid isPermaLink="false">http://www.fogel.ca/?p=1052</guid>
		<description><![CDATA[This post describes one way to quickly set up a two-computer network such that both machines on the network can access the outside internet.  The use case in mind here is you&#8217;re at a cafe with a friend, the wifi there sucks, you have your mobile broadband connection and you want to share it [...]]]></description>
			<content:encoded><![CDATA[<p>This post describes one way to quickly set up a two-computer network such that both machines on the network can access the outside internet.  The use case in mind here is you&#8217;re at a cafe with a friend, the wifi there sucks, you have your mobile broadband connection and you want to share it with your friend.</p>
<p>Note that there are many ways to get to the desired end result here.  This solution has your local laptop doing NAT and forwarding packets at the IP layer.</p>
<p><strong>Supplies:</strong></p>
<ul>
<li>your debian/ubuntu laptop</li>
<li>a &#8220;mobile broadband&#8221; connection with some provider, like Verizon or T-Mobile</li>
<li>an ethernet cord</li>
</ul>
<p><strong>Step 0:</strong> Get your mobile broadband connection working, <a href="http://www.fogel.ca/2010/10/05/t-mobile-webconnect-rocket-2-0-on-debianubuntu">possibly with T-Mobile</a>.</p>
<p><strong>Step 1:</strong> Set up your machine to run a dhcp server for your local wired network</p>
<ul>
<li>sudo apt-get install isc-dhcp-server</li>
<li>Edit /etc/dhcp/dhcpd.conf.  Here are the relevant parts of mine. (Yes, the &#8216;authoritative&#8217; directive is commented out, I&#8217;m not sure how essential this is or not &#8211; but I&#8217;m trying avoid the dhcp server from taking over my local machine&#8217;s default route.)
<pre>
default-lease-time 600;
max-lease-time 7200;
#authoritative;
log-facility syslog;
subnet 172.16.16.0 netmask 255.255.255.0 {
  range 172.16.16.10 172.16.16.250;
  option domain-name-servers 208.67.222.222; # opendns
  option routers 172.16.16.1;
}
</pre>
</li>
<li>Edit /etc/defaults/isc-dhcp-server:
<pre>
mike@110psi:$ cat /etc/default/isc-dhcp-server | tail -n 1
INTERFACES="eth4"
</pre>
<li>sudo ifconfig eth4 172.16.16.1 netmask 255.255.255.0</li>
<li>sudo /etc/init.d/isc-dhcpd-server restart</li>
</ul>
<p>At this point you should physically connect your friend&#8217;s laptop to yours using an ethernet cable.  To watch the connection happen: tail -f /var/log/syslog. You should be able to go between the two computers and ping each other.  If you can&#8217;t, then you want to debug this until you can&#8230; the rest of this recipe won&#8217;t have any effect if your local wired net is broken.</p>
<p><strong>Step 2:</strong> Fix up your routing table</p>
<p>Between pppd, your local dhcp server, and you issuing manual ifconfig commands, it&#8217;s easy for your local routing table to get in a bad state.  Here&#8217;s what you want it to look like:</p>
<pre>
mike@110psi:~$ netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.0.0.1        0.0.0.0         255.255.255.255 UH        0 0          0 ppp0
172.16.16.0     0.0.0.0         255.255.255.0   U         0 0          0 eth4
0.0.0.0         0.0.0.0         0.0.0.0         U         0 0          0 ppp0
</pre>
<p>If you need to remove/add/edit routes, the tool you want to use is &#8216;route&#8217;.  For example:</p>
<pre>
sudo route del default
sudo route add default gw 10.0.0.1
</pre>
<p><strong>Step 3:</strong> Set up your computer to do some NAT</p>
<p>I scripted this out.  Here&#8217;s the script:</p>
<pre>
#!/bin/sh
# nat and firewall
# for now, just nat.

ipt=/sbin/iptables
EXTIF=ppp0
INTIF=eth4

case "$1" in
	start)
		echo "Starting firewall:"

		echo -ne "\tClearing existing rules..."
		$ipt -F INPUT
		$ipt -F OUTPUT
		$ipt -F FORWARD
		$ipt -t nat -F
		echo " done."

		echo -ne "\tInput / Output rules..."
		$ipt -P INPUT ACCEPT
		$ipt -P OUTPUT ACCEPT
		echo " done."

		echo -ne "\tForwarding rules, and /proc/sys/net/ipv4/ip_forward..."
		echo "1" > /proc/sys/net/ipv4/ip_forward
		#$ipt -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
		$ipt -A FORWARD -i $EXTIF -o $INTIF -j ACCEPT
		$ipt -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
		echo " done."

		echo -ne "\tEnabling MASQUERADE on $EXTIF..."
		$ipt -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
		echo " done."

		echo "Firewall.sh is up."
	;;
	stop)
		echo -n "Stopping firewall...";
		$ipt -F INPUT
		$ipt -F OUTPUT
		$ipt -F FORWARD
		$ipt -P INPUT ACCEPT
		$ipt -P FORWARD ACCEPT
		$ipt -P OUTPUT ACCEPT
		$ipt -t nat -F
		echo "0" > /proc/sys/net/ipv4/ip_forward
		echo " done.";
		echo "Firewall.sh is down."
	;;
	*)
		N=/etc/init.d/firewall.sh
        	echo "Usage: $N {start|stop}" >&#038;2
		exit 1
	;;
esac
</pre>
<p>Start your NAT up with &#8220;sudo ./nat-script-name.sh start&#8221;.</p>
<p><strong>Step 4:</strong> debug it because it doesn&#8217;t work.</p>
<p>Break the problem into pieces:</p>
<ul>
<li>debug the connection between the two computers (/var/log/syslog, ifconfig, isc-dhcp-server and ping are your friends here)</li>
<li>debug your local routing table (using netstat and route commands)</li>
<li>debug your connection to your mobile broadband provider (pppd, wvdial, minicom, ping, etc)</li>
</ul>
<p>If you find some variant of this recipe works better for your local machine, please post it in the comments so we can all share.  Good luck.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fogel.ca/2010/11/15/howto-ubuntu-debian-mobile-broadband-local-wired-subnet-internet-access/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>T-Mobile webConnect Rocket 2.0 on Debian/Ubuntu</title>
		<link>http://www.fogel.ca/2010/10/05/t-mobile-webconnect-rocket-2-0-on-debianubuntu/</link>
		<comments>http://www.fogel.ca/2010/10/05/t-mobile-webconnect-rocket-2-0-on-debianubuntu/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 06:14:38 +0000</pubDate>
		<dc:creator>Mike Fogel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[tmobile]]></category>

		<guid isPermaLink="false">http://www.fogel.ca/?p=983</guid>
		<description><![CDATA[It is possible &#8211; I&#8217;m writing this post via T-Mobile and my new webConnect Rocket.
Step 0: see if your webConnect Rocket is actually the same as mine.

mike@110psi:~$ lsusb
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation [...]]]></description>
			<content:encoded><![CDATA[<p>It is possible &#8211; I&#8217;m writing this post via T-Mobile and my new webConnect Rocket.</p>
<p><strong>Step 0</strong>: see if your webConnect Rocket is actually the same as mine.</p>
<pre>
mike@110psi:~$ lsusb
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 19d2:1201 ONDA Communication S.p.A.
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
</pre>
<p>If you don&#8217;t have the &#8220;19d2:1201 ONDA Communication S.p.A.&#8221; line, then likely you have a different version of the webConnect Rocket than I do and this guide may or may not apply.</p>
<p><strong>Step 1</strong>: usb_modeswitch.  This is necessary because the webConnect, like many usb dongles these days, actually has its windows (and mac?) drivers loaded directly on it.  When the dongle is first inserted into a windows machine, it appears as a hard drive with its driver on it.  Windows installs the driver, then magically changes the device into a modem.  We need to use usb_modeswitch to do that magic change ourselves.</p>
<pre>
sudo apt-get install usb-modeswitch
</pre>
<p>As of this writing, you need to manually add the file /etc/usb_modeswitch.d/19d2:1201 with text:</p>
<pre>
# t-mobile ZTE MF691  Rocket 2

DefaultVendor=  0x19d2
DefaultProduct= 0x1201

TargetVendor=   0x19d2
TargetProduct=  0x1203

MessageContent="5553424392020000000000000000061B000000020000000000000000000000"
</pre>
<p>For more details, see this <a href="http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?p=3334">forum post</a> and <a href="http://ubuntuforums.org/showthread.php?p=9905846">this one</a>.  Hopefully this file will be included directly in the usb-modeswitch-data package soon, but for the meantime it looks like the maintainer is <a href="http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?t=492">currently traveling</a>.</p>
<p>Now, we need to configure udev to run usb_modeswitch automatically when it sees the webConnect hard drive.  Add the following lines to the file /lib/udev/rules.d/40-usb_modeswitch.rules:</p>
<pre>
# t-mobile ZTE MF691  Rocket 2
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1201", RUN+="usb_modeswitch '%b/%k'"
</pre>
<p>(Before you add those lines check that they haven&#8217;t already been added by upstream since this writing.  No need to have them in there twice.)</p>
<p>At this point I&#8217;d recommend a) restarting your machine and the b) inserting your webConnect Rocket.  To test everything&#8217;s good so far, you should be able to use minicom to connect to both /dev/ttyACM0 and /dev/ttyACM1 and issue some basic <a href="http://en.wikipedia.org/wiki/Hayes_command_set">AT commands</a>.</p>
<p><strong>Step 2</strong>: I haven&#8217;t been able to get network-manager to work correctly with the webConnect rocket.  I get a lot of &#8220;modem-manager: Got failure code 100: Unknown error&#8221; in the logs. If you&#8217;ve got the time, the relevant source is <a href="http://cgit.freedesktop.org/ModemManager/ModemManager/tree/plugins/mm-plugin-zte.c">here</a>.</p>
<p>However, we can use wvdial and pppd to connect.  If you haven&#8217;t already:</p>
<pre>
sudo apt-get install wvdial pppd
</pre>
<p>You can run &#8216;wvdailconf&#8217; as root to generate a basic /etc/wvdial.conf.  Then you want to edit it to look like mine:</p>
<pre>
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &#038;C1 &#038;D2 +FCLASS=0
Modem Type = USB Modem
ISDN = 0
New PPPD = yes
Phone = *99***1#
Modem = /dev/ttyACM0
Username = user
Password = pass
Baud = 460800
Stupid Mode = 1
</pre>
<p>I suspect there may be other options that should be in here that would be helpful.  But in any case, this is a working base case.  If you find any additional helpful options, please let me know in the comments.</p>
<p><strong>Step 3</strong>:  Connect to T-Mobile!  To connect, run</p>
<pre>
sudo wvdial
</pre>
<p>Wvdial will manage the connection process to T-Mobile, spawning an instance of pppd to maintain the connection.  Once the connection is established, you can hit cntrl-c to kill the instance of wvdial while still leaving pppd alive and your connection to T-Mobile active.</p>
<p>To disconnect:</p>
<pre>
sudo pkill pppd
</pre>
<p>does the trick.</p>
<p>It&#8217;ll be nice once modem-manager (and hence network-manager) has functioning support for this device.  I&#8217;ll update this post once it does.  In the meantime&#8230; good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fogel.ca/2010/10/05/t-mobile-webconnect-rocket-2-0-on-debianubuntu/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Elegantly dropping priviledge in an /etc/cron.daily script</title>
		<link>http://www.fogel.ca/2010/08/07/elegantly-dropping-priviledge-in-an-etccron-daily-script/</link>
		<comments>http://www.fogel.ca/2010/08/07/elegantly-dropping-priviledge-in-an-etccron-daily-script/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 19:25:08 +0000</pubDate>
		<dc:creator>Mike Fogel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.fogel.ca/?p=933</guid>
		<description><![CDATA[Debian-based distributions have a really useful series of directories to run cron scripts from.  Any executable you place in /etc/cron.hourly, /etc/cron.daily, /etc/cron.weekly or /etc/cron.monthly will get run with that frequency.  I like these for two reasons: 1) it&#8217;s file-based, which I find a lot easier to manage and keep track of than each [...]]]></description>
			<content:encoded><![CDATA[<p>Debian-based distributions have a really useful series of directories to run cron scripts from.  Any executable you place in <em>/etc/cron.hourly</em>, <em>/etc/cron.daily</em>, <em>/etc/cron.weekly</em> or <em>/etc/cron.monthly</em> will get run with that frequency.  I like these for two reasons: 1) it&#8217;s file-based, which I find a lot easier to manage and keep track of than each user&#8217;s crontabs and 2) this eliminates one possible source of bugs in my work &#8211; namely, the scheduling of my cron tasks.</p>
<p>However, there is a downside to <em>/etc/cron.daily</em> and friends.  All scripts in there run as root.  It&#8217;s generally bad practice to run anything as root that doesn’t have to run as root&#8230; and this is especially true if your script has scary lines like &#8220;rm -rf $SOME_VAR&#8221; in it.  You&#8217;re asking for trouble.</p>
<p>Unfortunately, AFAIK there is no way to drop privilege within a script.  However, this can be done by spanning a whole new child process.  So, let&#8217;s add a short preamble to all the scripts we place in <em>/etc/cron.daily</em> and friends:</p>
<pre>#!/bin/sh

USER='some-low-privilege-user'
if [ `whoami` != "$USER" ]; then
  sudo -u $USER "$0"
  exit
fi

... rest of the script ...</pre>
<p>Now we have some extra assurance our cron job isn&#8217;t going to go haywire and screw the whole machine!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fogel.ca/2010/08/07/elegantly-dropping-priviledge-in-an-etccron-daily-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>T61p/Debian/Gnome/Gsynaptics HOWTO</title>
		<link>http://www.fogel.ca/2009/04/27/t61pdebiangnomegsynaptics-howto/</link>
		<comments>http://www.fogel.ca/2009/04/27/t61pdebiangnomegsynaptics-howto/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 18:46:13 +0000</pubDate>
		<dc:creator>Mike Fogel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[synaptics]]></category>
		<category><![CDATA[t61p]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://blog.fogel.ca/?p=516</guid>
		<description><![CDATA[gsynaptics gives you a nice little GUI in gnome to control the options on your synaptics touchpad, like the one my T61p came with.  It&#8217;s easy to set up on a default debian install, you just need to add a few stanazas to your xorg.conf

Here&#8217;s the edits I needed from a default install xorg.conf:

Make [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://gsynaptics.sourceforge.jp/">gsynaptics</a> gives you a nice little GUI in gnome to control the options on your synaptics touchpad, like the one my <a href="http://shop.lenovo.com/ISS_Static/merchandising/US/PDFs/T61p_Datasheet-USEN-00.pdf">T61p</a> came with.  It&#8217;s easy to set up on a default debian install, you just need to add a few stanazas to your <a href="http://www.x.org/archive/X11R6.8.0/doc/xorg.conf.5.html">xorg.conf<br />
</a></p>
<p>Here&#8217;s the edits I needed from a default install xorg.conf:</p>
<ol>
<li>Make a backup of your current xorg.conf</li>
<li>Remove the &#8220;Generic Mouse&#8221; section.  You don&#8217;t need it anymore.</li>
<li>Add a section for your touchpad like so:
<pre>
Section "InputDevice"
  Identifier  "Synaptics Touchpad"
  Driver      "synaptics"
  Option      "SendCoreEvents"  "true"
  Option      "Protocol"        "auto-dev"
  Option      "Device"          "/dev/psaux"
  Option      "SHMConfig"       "true"
EndSection
</pre>
</li>
<li>And add a line in your &#8220;ServerLayout&#8221; section referencing your new synaptics section.  I didn&#8217;t have a ServerLayout section so I had to add one, mine looks like this:
<pre>
Section "ServerLayout"
  Identifier  "Default Layout"
  Screen      "Default Screen"
  InputDevice "Generic Keyboard"
  InputDevice "Synaptics Touchpad"
EndSection
</pre>
</li>
</ol>
<p>Now save everything you&#8217;re doing and then restart X11 by hitting cntrl-alt-backspace.  If X won&#8217;t start back up, you can hit cntrl-alt-f1 and log in at a command prompt, restore your xorg.conf from the backup you made earlier, then run <code>/etc/init.d/gdm restart</code>.</p>
<p>In the event that things just aren&#8217;t working, your friend is /var/log/Xorg.0.log.  That log file contains the results of your x-server&#8217;s parsing of your xorg.conf.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fogel.ca/2009/04/27/t61pdebiangnomegsynaptics-howto/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Removing Splashy</title>
		<link>http://www.fogel.ca/2009/02/26/removing-splashy/</link>
		<comments>http://www.fogel.ca/2009/02/26/removing-splashy/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 08:27:13 +0000</pubDate>
		<dc:creator>Mike Fogel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://blog.fogel.ca/?p=434</guid>
		<description><![CDATA[Splashy is a linux-boot graphical boot screen thinger.  It aims to make your booting process into x11 more full of rounded corners and less of 1970&#8217;s terminal text streaking by.
Want to get rid of it?  Well, make sure to purge it when you remove it, or your system will fail partway through the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://splashy.alioth.debian.org/wiki/">Splashy</a> is a linux-boot graphical boot screen thinger.  It aims to make your booting process into x11 more full of rounded corners and less of 1970&#8217;s terminal text streaking by.</p>
<p>Want to get rid of it?  Well, make sure to <em>purge</em> it when you remove it, or your system will fail partway through the init scripts on the next boot.  You won&#8217;t have x11 or networking or dbus.  You will have a screen full of errors and a login prompt.  So make sure you do:</p>
<pre>
sudo apt-get --purge remove splashy
</pre>
<p>However, if you already did just a <em>apt-get remove splashy</em> just like you&#8217;d do for any other package, and now your system suddenly won&#8217;t boot past 1980, what should you do?  Kill the <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=512951">offending file</a>.</p>
<pre>
sudo rm -ffffffffffffffff /etc/lsb-base-logging.sh
</pre>
<p>And reboot.  Your system should come back up with networking and all.  At this point you probably want to re-install splashy then re-remove it using the &#8211;purge option to get rid of all its last traces.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fogel.ca/2009/02/26/removing-splashy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Getting Eclipse and Java working on Debian</title>
		<link>http://www.fogel.ca/2008/10/02/getting-eclipse-and-java-working-on-debian/</link>
		<comments>http://www.fogel.ca/2008/10/02/getting-eclipse-and-java-working-on-debian/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 19:50:27 +0000</pubDate>
		<dc:creator>Mike Fogel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://blog.fogel.ca/?p=174</guid>
		<description><![CDATA[Here are the steps I took to get Eclipse working with Java on my Debian Lenny more-or-less default install laptop.  I know zero (soon to be non-zero) Java, and I&#8217;ve never used Eclipse before.

sudo apt-get install eclipse
sudo apt-get install sun-java6-doc

You will then need to download a zipped file from sun&#8217;s servers to your /tmp dir, [...]]]></description>
			<content:encoded><![CDATA[<p>Here are the steps I took to get <a href="http://www.eclipse.org/">Eclipse</a> working with <a href="http://www.java.com/">Java</a> on my <a href="http://www.debian.org">Debian</a> Lenny more-or-less default install laptop.  I know <em>zero</em> (soon to be non-zero) Java, and I&#8217;ve never used Eclipse before.</p>
<pre>
sudo apt-get install eclipse
sudo apt-get install sun-java6-doc
</pre>
<p>You will then need to download a zipped file from sun&#8217;s servers to your /tmp dir, and then re-run the configuration scripts for that package.  AFAIK, that package just installs the help files in the appropriate places.  It doesn&#8217;t do the download for you because Sun makes you check a bunch of boxes off about licenses etc. before letting you download.</p>
<p>Increase your productivity about a billion percent for 15 Euro: <a href="http://satokar.com/viplugin/">viPlugin</a>.  It works as expected, so far recommended.  The only thing is I didn&#8217;t receive my license via email till about 4 hours after I bought it.  So get it set up now.  I, for one, do appreciate the reasonable pricing for viPlugin as apposed to some other <a href="http://www.viemu.com/">vi IDE plugins</a>.  Reasonable pricing makes the difference between me searching for a crack or just paying for the license&#8230; but that&#8217;s worthy of a whole rant (er, post) of it&#8217;s own.</p>
<p>And I think that&#8217;s it.  I&#8217;m now on my way to becoming yet another Java monk- er, programmer.</p>
<p><strong>Update:</strong></p>
<p>Hum, why is it never that easy?  So the GNU version of the Java complier <a href="http://ubuntuforums.org/showthread.php?t=874500">doesn&#8217;t like you using the Scanner class</a>. I have no idea why and right now, with this project 22 hours overdue, I don&#8217;t really care (so why am I writing this up now?).  Anyway:</p>
<pre>
sudo apt-get install sun-java6-jdk
sudo update-java-alternatives -s java-6-sun
sudo update-alternatives --config java
</pre>
<p>And you want to select /usr/lib/jvm/java-6-sun/jre/bin/java</p>
<pre>sudo update-alternatives --config javac</pre>
<p>And you want to select /usr/lib/jvm/java-6-sun/bin/javac</p>
<p>In Eclipse,  &#8220;Windows&#8221; &gt; &#8220;Preferences&#8221; &gt; &#8220;Java&#8221; &gt; &#8220;Installed JREs&#8221;.  You want to &#8216;Add&#8217; the JRE /usr/lib/jvm/java-6-sun-1.6.0.07  Then you want to make that the default by checking the box and clicking OK.</p>
<p>And now, Eclipse will find that Scanner class for you.</p>
<p><strong>Update #2:</strong></p>
<p>You probably want to use Sun&#8217;s javadoc:</p>
<pre>sudo update-alternatives --config javadoc</pre>
<p> and select /usr/lib/jvm/java-6-sun/bin/javadoc</p>
<p><strong>Update #3:</strong></p>
<p>If you want to use the JUnit4 package, you need to add it to the build path of your project.</p>
<pre>sudo apt-get install junit4</pre>
<p>In Eclipse, &#8220;Windows&#8221; &gt; &#8220;Preferences&#8221; &gt; &#8220;Java&#8221; &gt; &#8220;Installed JREs&#8221;.  Select &#8220;Edit&#8221; on the JRE you&#8217;re using &#8211; for me, this is java-6-sun-1.6.0.07.  Then &#8220;Add External JARs&#8230;&#8221; and add /usr/lib/eclipse/plugins/org.junit4_4.1.0.1/junit-4.1.jar.  I don&#8217;t know why this doesn&#8217;t all just happen automagically&#8230; I see <a href="http://groups.google.com/group/cmu-15-211-discuss/browse_thread/thread/257d990673ec6707/fe4998c96dccc30f">some hints</a> around that there&#8217;s a licensing issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fogel.ca/2008/10/02/getting-eclipse-and-java-working-on-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intel 4965AGN, T61p, and Debian</title>
		<link>http://www.fogel.ca/2008/09/10/intel-4965agn-t61p-and-debian/</link>
		<comments>http://www.fogel.ca/2008/09/10/intel-4965agn-t61p-and-debian/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 13:42:11 +0000</pubDate>
		<dc:creator>Mike Fogel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[t61p]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://blog.fogel.ca/?p=70</guid>
		<description><![CDATA[My new T61p has the standard built-in Intel 4965AGN wireless card for 802.11b/g/n goodness.  The kernel has had driver support for this hardware since 2.6.24.  But, after doing a default Debian Lenny install, the wireless just ain&#8217;t working&#8230;  what gives?
Well, this comes up in /var/log/syslog and others:

iwl4965: iwlwifi-4965-1.ucode firmware file req failed: [...]]]></description>
			<content:encoded><![CDATA[<p>My new <a href="http://shop.lenovo.com/ISS_Static/merchandising/US/PDFs/T61p_Datasheet-USEN-00.pdf">T61p</a> has the standard built-in Intel 4965AGN wireless card for 802.11b/g/n goodness.  The kernel has had driver support for this hardware <a href="http://intellinuxwireless.org/">since 2.6.24</a>.  But, after doing a default Debian Lenny install, the wireless just ain&#8217;t working&#8230;  what gives?</p>
<p>Well, this comes up in /var/log/syslog and others:</p>
<pre>
iwl4965: iwlwifi-4965-1.ucode firmware file req failed: Reason -2
iwl4965: Could not read microcode: -2
</pre>
<p>As is explained <a href="http://intellinuxwireless.org/?n=faq&amp;s=license">here</a>, the iwlwifi drivers require a binary firmware (aka microcode) image to function.  The drivers themselves are free, both as in beer and as in freedom.  However, the microcode images, in order to enforce end-user FCC compliance, are free as in beer but not freedom.  Thus a default Debian install, which <a href="http://en.wikipedia.org/wiki/IceApe#Origins_of_the_issue_and_of_the_Iceweasel_name">bends over backwards</a> to be free as in beer <em>and</em> free as in freedom, does not include the microcode images.</p>
<p>Two options:</p>
<ol>
<li>Install the firmware image yourself.  Find the image you need <a href="http://intellinuxwireless.org/?n=Downloads">here</a> (as of August 2008 the version you want was 1.21), download it, extract it, and copy it to /lib/firmware/iwlwifi-4965-1.ucode.</li>
<li>Or, <a href="http://www.debian.org/doc/manuals/apt-howto/ch-basico.en.html">add the non-free</a> repositories to your /etc/apt/sources.list, and do an
<pre>apt-get install <a href="http://packages.debian.org/lenny/firmware-iwlwifi">firmware-iwlwifi</a></pre>
</li>
</ol>
<p>Or, pretend you didn&#8217;t really want wireless if you can&#8217;t have it free as in freedom&#8230; and put it on your to-do list to reverse-engineer that binary firmware image.  Buena suerte! ;p</p>
<p>I can&#8217;t remember if a reboot was necessary after installing the microcode image.  But that should be it in terms of edits and installs&#8230; everything wifi, all the way out to the gnome GUI, should now just automagically work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fogel.ca/2008/09/10/intel-4965agn-t61p-and-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Built-In Verizon EVDO on a T61p with Debian</title>
		<link>http://www.fogel.ca/2008/08/29/built-in-verizon-evdo-on-a-t61p-with-debian/</link>
		<comments>http://www.fogel.ca/2008/08/29/built-in-verizon-evdo-on-a-t61p-with-debian/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 20:21:31 +0000</pubDate>
		<dc:creator>Mike Fogel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[t61p]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://blog.fogel.ca/?p=66</guid>
		<description><![CDATA[This is the first in what will be a short series of posts of what I&#8217;ve had to do to get Debian (Lenny &#8211; currently the &#8216;testing&#8217; distro) working fully and smoothly on my new T61p.
The key options in my T61p package:

39T4822 	VBB WWAN
42V9332 	SBB WAN:VERIZONSIERRACDMA2000
42V8603 	SBB INT.WWAN ANTENNA 15.4"
42V8659 	SBB CL.PLATE T61P WL WWAN
42W7002 [...]]]></description>
			<content:encoded><![CDATA[<p>This is the first in what will be a short series of posts of what I&#8217;ve had to do to get Debian (Lenny &#8211; currently the &#8216;testing&#8217; distro) working fully and smoothly on my new <a href="http://shop.lenovo.com/ISS_Static/merchandising/US/PDFs/T61p_Datasheet-USEN-00.pdf">T61p</a>.</p>
<p>The key options in my T61p package:</p>
<pre>
39T4822 	VBB WWAN
42V9332 	SBB WAN:VERIZONSIERRACDMA2000
42V8603 	SBB INT.WWAN ANTENNA 15.4"
42V8659 	SBB CL.PLATE T61P WL WWAN
42W7002 	SBB FCC-ID/LABEL FOR WWAN
42V8675 	SBB VERIZON OPTION
</pre>
<p>That all translates to a slickly built-in Verizon card and antenna:</p>
<pre>
$ sudo lsusb -v | grep Sierra
Bus 006 Device 002: ID 1199:0220 Sierra Wireless, Inc.
  idVendor           0x1199 Sierra Wireless, Inc.
  iManufacturer           1 Sierra Wireless, Incorporated
  iProduct                2 Sierra Wireless MC5725 Modem
</pre>
<p>Here is the only officially unofficial official public <a href="http://www.sierrawireless.com/faq/ShowFAQ.aspx?ID=601">documentation</a> I could find for that card on Linux.</p>
<p>Before setting this up with Debian, I&#8217;d recommend getting it working with Windows if you haven&#8217;t reformatted over it yet.  The card and connection pretty much &#8216;just works&#8217; on Lenovo&#8217;s preinstalled Windows.  This will mostly eliminate Verizon as the source of the problem if things don&#8217;t go right with Debian.</p>
<p>A default Debian install provides a number of tools you can use to configure and automate your connection.  I like gnome-ppp (essentially a GUI frontend on wvdial) best.  I&#8217;ve also set it up with gnome&#8217;s network-admin applet (System->Administration->Network), but it doesn&#8217;t provide good user feedback on the connection process or status.  And by &#8216;good&#8217;, I mean &#8216;any&#8217;.  Perhaps future versions will have better integration of dial-out connections, now that they&#8217;re coming back into style with EVDO and 3G networks.  In any case, I will provide instructions for both these two tools here.  (Note this is an either/or.  There is no reason to bother setting this up with both tools, other than to test out the GUI&#8217;s.)</p>
<p>First, GUI configuration.  Here&#8217;s your key points:</p>
<ul>
<li>Username: <strong>YOURPHONENUMBER@vzw3g.com</strong></li>
<li>Password: <strong>vzw</strong></li>
<li>Phone number to dial: <strong>#777</strong></li>
</ul>
<p>For gnome-ppp, you want to:</p>
<ul>
<li>Use the &#8216;Detect&#8217; mechanism.  It worked perfect for me.  Try it.</li>
<li>Under Options, enable &#8217;stupid mode&#8217; to speed up the connection process substantially.  You&#8217;re also calling Verizon stupid, in a extremely passive aggressive manner&#8230; ummm, feels so good&#8230;. stupid stupid stupid.</li>
</ul>
<p>For network-admin:</p>
<ul>
<li>Set the Modem port to /dev/ttyUSB0.</li>
<li>Check the &#8216;Set modem as default route to Internet&#8217; option or your machine will just drop your outbound packets on the floor.</li>
<li>No remote authentication.  In the file /etc/ppp/peers/ppp0, add a line &#8216;noauth&#8217; to disable your authentication of the verizon servers.  This means that if someone successfully hijacks Verizon&#8217;s &#8216;#777&#8242; number, you will have no way of knowing, and they will have complete control over your traffic. (gnome-ppp does this &#8216;noauth&#8217; for you automatically, for better or for worse.)</li>
<li>Do not set the modem volume.  In the file /etc/chatscripts/ppp0, comment out the line that has a command like &#8216;AT&#038;FH0XX&#8217; where XX are wildcards depending on your GUI settings.  Issuing this command causes the modem error out, reporting &#8216;NO CARRIER&#8217; on the ensuing ATDT (dial) command.</li>
</ul>
<p>And that&#8217;s it!  For debugging, your friends are tail, /var/log/syslog, /var/log/messages, gnome-ppp&#8217;s GUI log display, cat, echo, /dev/ttyUSB0, minicom and or course, good old google.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fogel.ca/2008/08/29/built-in-verizon-evdo-on-a-t61p-with-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOWTO: IPod Shuffle, Rhythmbox, Debian</title>
		<link>http://www.fogel.ca/2008/07/08/howto-ipod-shuffle-rhythmbox-debian/</link>
		<comments>http://www.fogel.ca/2008/07/08/howto-ipod-shuffle-rhythmbox-debian/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 03:37:58 +0000</pubDate>
		<dc:creator>Mike Fogel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[ipod]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://blog.fogel.ca/?p=52</guid>
		<description><![CDATA[Just plug it in.  It just works.  I can&#8217;t believe it.  Somebody wake me up&#8230; or wait, don&#8217;t.  My debian box is &#8216;just working&#8217;!
Still, I&#8217;m watching songbird&#8217;s development closely and eagerly&#8230;.
]]></description>
			<content:encoded><![CDATA[<p>Just plug it in.  It just works.  I can&#8217;t believe it.  Somebody wake me up&#8230; or wait, don&#8217;t.  My debian box is &#8216;just working&#8217;!</p>
<p>Still, I&#8217;m watching <a href="http://getsongbird.com/">songbird&#8217;s</a> development closely and eagerly&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fogel.ca/2008/07/08/howto-ipod-shuffle-rhythmbox-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOWTO: Pintos on QEMU on Debian</title>
		<link>http://www.fogel.ca/2008/06/29/howto-pintos-on-qemu-on-debian/</link>
		<comments>http://www.fogel.ca/2008/06/29/howto-pintos-on-qemu-on-debian/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 01:27:32 +0000</pubDate>
		<dc:creator>Mike Fogel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://blog.fogel.ca/?p=50</guid>
		<description><![CDATA[Pintos is a minimal operating system for x86 hardware used primarily for instructional purposes (eg.).  QEMU is an open-source hardware emulator typically used for operating system development.  Debian is a linux operating system, regular style.
Step #1 &#8211; Debian: Drop windows and install debian (or go dual-boot).
Step #2 &#8211; QEMU:
sudo apt-get install qemu
To test [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Pintos">Pintos</a> is a minimal operating system for x86 hardware used primarily for instructional purposes (<a href="http://cs140.stanford.edu/">eg</a>.).  <a href="http://bellard.org/qemu">QEMU</a> is an open-source hardware emulator typically used for operating system development.  <a href="http://www.debian.org/">Debian</a> is a linux operating system, regular style.</p>
<p><strong>Step #1 &#8211; Debian:</strong> Drop windows and <a href="http://www.debian.org/releases/stable/i386/">install debian</a> (or go <a href="http://apcmag.com/how_to_dualboot_vista_with_linux_linux_is_already_installed.htm">dual-boot</a>).</p>
<p><strong>Step #2 &#8211; QEMU:</strong></p>
<pre>sudo apt-get install qemu</pre>
<p>To test everything is working as it should at this point, you can download a small linux kernel image <a href="http://bellard.org/qemu/download.html">here</a> (Sec: disk images).  Then:</p>
<pre>
bzip2 -d linux-0.2.img.bz2
qemu linux-0.2.img
</pre>
<p>You are now running a minimal linux system on emulated x86 hardware, which is in turn running on a full-featured linux system (debian) on real (probably also x86) hardware.  Press ctrl-alt to get out of the minimal linux system if you get stuck with it stealing all your keystrokes.</p>
<p><strong>Step #3 &#8211; Pintos:</strong></p>
<ul>
<li>3.A &#8211; <a href="http://cs140.stanford.edu/pintos">Download</a> pintos.</li>
<li>3.B &#8211; Fix pintos to default to QEMU (rather than <a href="http://bochs.sourceforge.net/">bochs</a>) by applying the following diff:
<pre>
Index: threads/Make.vars
=======================================
@@ -4,4 +4,5 @@
-SIMULATOR = --bochs
+#SIMULATOR = --bochs
+SIMULATOR = --qemu

Index: utils/pintos
=======================================
@@ -85,7 +85,7 @@
-    $sim = "bochs" if !defined $sim;
+    $sim = "qemu" if !defined $sim;
@@ -107,8 +107,8 @@
-  --bochs                  (default) Use Bochs as simulator
-  --qemu                   Use QEMU as simulator
+  --qemu                   (default) Use QEMU as simulator
+  --bochs                  Use Bochs as simulator
</pre>
</li>
<li>3.C &#8211; Compile pintos:
<pre>
cd threads/
make
</pre>
</li>
<li>3.D &#8211; Run a test app with pintos:
<pre>
cd threads/build/
../../utils/pintos run alarm-multiple
</pre>
</li>
<li>3.E &#8211; You may wish to throw pintos in your default path (some of the scripts provided require it&#8217;s there).  There are many ways to do this, this is my favorite:
<pre>sudo ln -s `pwd`/utils/pintos /usr/local/bin/</pre>
</li>
</ul>
<p>And that&#8217;s it!  In step 3.D you finished up by running a little test app that created 5 threads that slept for varying predefined periods of time with some messaging to the console, thus testing pintos&#8217; scheduling/threading abilities.  You&#8217;re now ready to augment and enhance pintos&#8230; <a href="http://www.faqs.org/docs/Linux-mini/Coffee.html">coffee</a> anyone?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fogel.ca/2008/06/29/howto-pintos-on-qemu-on-debian/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

