<?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>Hotsolder &#187; Uncategorized</title>
	<atom:link href="http://www.hotsolder.com/category/uncategorized/feed" rel="self" type="application/rss+xml" />
	<link>http://www.hotsolder.com</link>
	<description>Electronics and other geeky pursuits!</description>
	<lastBuildDate>Sat, 31 Jul 2010 04:10:43 +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>PICP (Linux PICSTART Plus) for 16F883 and 16F886</title>
		<link>http://www.hotsolder.com/2010/07/picp-linux-picstart-plus-for-16f883-and-16f886.html</link>
		<comments>http://www.hotsolder.com/2010/07/picp-linux-picstart-plus-for-16f883-and-16f886.html#comments</comments>
		<pubDate>Sat, 31 Jul 2010 04:10:43 +0000</pubDate>
		<dc:creator>wd5gnr</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.hotsolder.com/?p=877</guid>
		<description><![CDATA[Just in case you want to use PICP with either the 16F883 or 16F886, add this to your picdevrc file:
[16F883]
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
PICSTART
[16F883:def]
10 00 3f ff 3f ff 00 7f
00 7f 3f ff 3f ff 00 ff
00 ff 00 00 00 00 00 00
0D [...]]]></description>
			<content:encoded><![CDATA[<p>Just in case you want to use <a href="http://home.pacbell.net/theposts/picmicro">PICP</a> with either the 16F883 or 16F886, add this to your picdevrc file:</p>
<p>[16F883]<br />
0 0 0 0 0 0 0 0<br />
0 0 0 0 0 0 0 0<br />
PICSTART</p>
<p>[16F883:def]<br />
10 00 3f ff 3f ff 00 7f<br />
00 7f 3f ff 3f ff 00 ff<br />
00 ff 00 00 00 00 00 00<br />
0D 10 20 00 04 20 07 02<br />
00 00 01 00 00 00 00 00<br />
00 01 22 0f</p>
<p>[16F883:defx]<br />
3f ff 07 00 00 00 00 00<br />
00 00 00 00 00 00 00 00<br />
3f ff 07 00 00 00 00 00<br />
00 00 00 00 00 00 00 00</p>
<p>[16F886]<br />
0 0 0 0 0 0 0 0<br />
0 0 0 0 0 0 0 0<br />
PICSTART</p>
<p>[16F886:def]<br />
20 00 3f ff 3f ff 00 7f<br />
00 7f 3f ff 3f ff 00 ff<br />
00 ff 00 00 00 00 00 00<br />
0D 10 20 00 04 20 07 02<br />
00 00 01 00 00 00 00 00<br />
00 01 22 0f</p>
<p>[16F886:defx]<br />
3f ff 07 00 00 00 00 00<br />
00 00 00 00 00 00 00 00<br />
3f ff 07 00 00 00 00 00<br />
00 00 00 00 00 00 00 00</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hotsolder.com/2010/07/picp-linux-picstart-plus-for-16f883-and-16f886.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cost Effective Digital I/O for LabView</title>
		<link>http://www.hotsolder.com/2010/06/cost-effective-digital-io-for-labview.html</link>
		<comments>http://www.hotsolder.com/2010/06/cost-effective-digital-io-for-labview.html#comments</comments>
		<pubDate>Tue, 08 Jun 2010 03:54:40 +0000</pubDate>
		<dc:creator>wd5gnr</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.hotsolder.com/?p=871</guid>
		<description><![CDATA[
LabView is great software, but it isn&#8217;t easy to find inexpensive hardware that works with it. Since the GP-3 is a serial device (RS232 or USB) LabView can use it, but it does take a bit of hoop jumping to match the GP-3&#8217;s efficient binary protocol with LabView&#8217;s string-oriented I/O.
Because so many people have asked [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.awce.com/gp3-labview.htm"><img class="alignleft" title="Example GP3 VI" src="http://www.awce.com/gp3-vi3.png" alt="Example GP3 VI" width="250" height="162" /></a></p>
<p>LabView is great software, but it isn&#8217;t easy to find inexpensive hardware that works with it. Since the GP-3 is a serial device (RS232 or USB) LabView can use it, but it does take a bit of hoop jumping to match the GP-3&#8217;s efficient binary protocol with LabView&#8217;s string-oriented I/O.</p>
<p>Because so many people have asked me about how to use LabView with the GP-3, I&#8217;ve started posting blocks that do the GP-3 functions. I don&#8217;t have them all yet, but I&#8217;m steadily adding to them, and the example they provide would make it pretty easy to do any of them you want (in fact, I just copy, paste, and modify to get most of them myself).</p>
<p>Read the whole article at <a href="http://www.awce.com/gp3-labview.htm">http://www.awce.com/gp3-labview.htm</a> and look for the download files at the bottom.</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/TJDJft1nR-k&#038;hl=en_US&#038;fs=1&#038;color1=0x006699&#038;color2=0x54abd6"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/TJDJft1nR-k&#038;hl=en_US&#038;fs=1&#038;color1=0x006699&#038;color2=0x54abd6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hotsolder.com/2010/06/cost-effective-digital-io-for-labview.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New GP-3X Boards Available</title>
		<link>http://www.hotsolder.com/2010/05/new-gp-3x-boards-available.html</link>
		<comments>http://www.hotsolder.com/2010/05/new-gp-3x-boards-available.html#comments</comments>
		<pubDate>Sun, 30 May 2010 15:44:10 +0000</pubDate>
		<dc:creator>wd5gnr</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.hotsolder.com/?p=866</guid>
		<description><![CDATA[Here&#8217;s a chance to pick one up at a promotional auction price.
http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&#38;item=230481553652
The firmware on these boards is the normal GP-3. You can use it as a PC A/D interface for data acquisition or control You can also create a program with GP3EZ and then &#8220;download&#8221; it to the board so the board will function without a PC.
The [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a chance to pick one up at a promotional auction price.</p>
<p><a href="http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&amp;item=230481553652">http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&amp;item=230481553652</a></p>
<p>The firmware on these boards is the normal GP-3. You can use it as a PC A/D interface for data acquisition or control You can also create a program with GP3EZ and then &#8220;download&#8221; it to the board so the board will function without a PC.</p>
<p>The differences in this board from the regular board:</p>
<p>1) All I/O is out to the edge and marked. Screw terminals are optional (included in the auction).</p>
<p>2) Dedicated jumper for GP3EZ run/program mode</p>
<p>3) USB daughterboard available</p>
<p>4) Room for a &#8220;regular&#8221; LED or a 2nd 5V LED.</p>
<p>5) Large ground lands for the analog converters to decrease noise pickup</p>
<p>6) Spare area for op-amps or other devices (if not using USB daughterboard); flexible I/O lets you &#8220;interrupt&#8221; the analog and digital I/O to reroute.</p>
<p>7) Slot for resonator OR crystal.</p>
<p>8 ) Switchable DTE or DCE serial port (and connections for TTL serial)</p>
<p>There is also a new manual for ALL GP-3s. Unlike the old &#8220;two part&#8221; manual, this is one manual for all GP-3 boards and should not require any other manual regardless of which kit you have. http://www.awce.com/gp3.pdf</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hotsolder.com/2010/05/new-gp-3x-boards-available.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrade to Ubuntu (Kbuntu) 10.04 Fails</title>
		<link>http://www.hotsolder.com/2010/04/upgrade-to-ubuntu-kbuntu-10-04-fails.html</link>
		<comments>http://www.hotsolder.com/2010/04/upgrade-to-ubuntu-kbuntu-10-04-fails.html#comments</comments>
		<pubDate>Fri, 30 Apr 2010 06:17:34 +0000</pubDate>
		<dc:creator>wd5gnr</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.hotsolder.com/?p=852</guid>
		<description><![CDATA[
Like an idiot I always upgrade stuff. Can&#8217;t help it. I know better. Really. I do.
I ran the install and got an error that apt&#8217;s post install script failed. Then it kept going for some time. And then it decided it had failed and my system was in an unstable state. Have a nice day.
I [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>Like an idiot I always upgrade stuff. Can&#8217;t help it. I know better. Really. I do.</p>
<p>I ran the install and got an error that apt&#8217;s post install script failed. Then it kept going for some time. And then it decided it had failed and my system was in an unstable state. Have a nice day.</p>
<p>I could still boot to the old kernel (the new kernel worked but the system was too trashed to rebuild the Nvidia drivers).</p>
<p>Turns out in /var/lib/dpkg/info/apt.postinst there is a function called:</p>
<pre dir="ltr">set_apt_proxy_from_gconf</pre>
<p>What&#8217;s more is down a ways in the script it calls this line and that is what makes it fail. Three hash signs later and the system is happily configuring away!</p>
<p>Hope that is useful info for you.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.hotsolder.com/2010/04/upgrade-to-ubuntu-kbuntu-10-04-fails.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rigol DS1052E or DS1102E Linux Software (link)</title>
		<link>http://www.hotsolder.com/2010/04/rigol-ds1052e-or-ds1102e-linux-software-link.html</link>
		<comments>http://www.hotsolder.com/2010/04/rigol-ds1052e-or-ds1102e-linux-software-link.html#comments</comments>
		<pubDate>Wed, 28 Apr 2010 13:40:50 +0000</pubDate>
		<dc:creator>wd5gnr</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.hotsolder.com/?p=850</guid>
		<description><![CDATA[I haven&#8217;t tried it yet, but http://www.cibomahto.com/2010/04/controlling-a-rigol-oscilloscope-using-linux-and-python/ has a simple Python object and a demo that lets you access the Rigol scopes via the usbtmc interface. Looks cool.
]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t tried it yet, but <a href="http://www.cibomahto.com/2010/04/controlling-a-rigol-oscilloscope-using-linux-and-python/">http://www.cibomahto.com/2010/04/controlling-a-rigol-oscilloscope-using-linux-and-python/</a> has a simple Python object and a demo that lets you access the Rigol scopes via the usbtmc interface. Looks cool.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hotsolder.com/2010/04/rigol-ds1052e-or-ds1102e-linux-software-link.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remote Access</title>
		<link>http://www.hotsolder.com/2010/04/remote-access-2.html</link>
		<comments>http://www.hotsolder.com/2010/04/remote-access-2.html#comments</comments>
		<pubDate>Sat, 03 Apr 2010 14:48:36 +0000</pubDate>
		<dc:creator>wd5gnr</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.hotsolder.com/?p=816</guid>
		<description><![CDATA[Recently I wanted my wife&#8217;s machine to be able to run a particular  program (kmymoney) from my computer. I trust my security more than hers,  plus she runs Windows 7 and I couldn&#8217;t find a good way to run kmymoney  on 64-bit Windows without running VirtualBox or something similar.
I tried x2go, and [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I wanted my wife&#8217;s machine to be able to run a particular  program (kmymoney) from my computer. I trust my security more than hers,  plus she runs Windows 7 and I couldn&#8217;t find a good way to run kmymoney  on 64-bit Windows without running VirtualBox or something similar.</p>
<p>I tried x2go, and it is very cool, but seemed to have a lot of  stability problems and very poor documentation. I&#8217;ve used nx before too,  but it is hard to set up. So instead, I loaded good old cygwin onto the  Windows machine. I used cygrunsvc to setup sshd on the Windows machine  (you&#8217;ll see why in a minute) and made sure the X server runs on startup.  I also modified the X startup so that it does not launch an xterm or  anything on startup. Finally, I set both machines up so you can log into  the right account (pat on the Windows box or money on the Linux box)  using RSA certificates so no password is needed (google ssh with no  password if you need to know how to do that). I set up the Windows ssh  client to automatically do X forwarding to the Linux box (in  .ssh/config).</p>
<p>So when my wife&#8217;s machine boots there&#8217;s nothing different from her  point of view. Windows 7 hides the rarely used X icon down in the task  bar. However, I made a batch file for her and there&#8217;s an icon for it on  the start menu. It is very simple:</p>
<pre>@echo off
c:\cygwin\bin\ssh moneypc /home/money/start pat patpc /cygdrive/c
</pre>
<p>There are 5 arguments to the ssh command. The moneypc name is the  name of the Linux box in the .ssh/config file. That&#8217;s where the real IP  address and all the options are (including the passwordless certificate  names). Then /home/money/start is the name of a script on the Linux box  (I&#8217;ll show you that in a minute).</p>
<p>The next three tokens are arguments to the start script. They  identify the remote user&#8217;s name, the remote user&#8217;s machine name (by IP  address, hostname, or entry into the .ssh/config file) and the user&#8217;s  local file system.</p>
<p>Why does start need all that? Here&#8217;s the start script:</p>
<pre>#!/bin/bash
USER=$1
IP=$2
ROOT=$3
sshfs $USER@$IP:$ROOT /home/money/media/drivec &amp;
kmymoney
fusermount -u -z /home/money/media/drivec
</pre>
<p>So the script actually uses sshfs to mount the user&#8217;s local file system on /home/money/media/local (similar to what x2go does). That&#8217;s why I needed sshd on the Windows box. Of course, this would work just as well on, say, my Linux laptop.</p>
<p>The x2go software also makes printing work &#8212; not an issue for me since my intent is this is all local and it forwards sound. I didn&#8217;t put a pulseaudio server on the Windows box, but if I did it would be easy enough to set the default server to the user&#8217;s IP address in the start script.</p>
<p>This is nowhere near as handy as using x2go. But it seems to be way more robust and its workable. I don&#8217;t intend to use this remotely, but it would be reasonable to do so since my firewall is open for ssh and ssh provides good encryption.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hotsolder.com/2010/04/remote-access-2.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Blogilo</title>
		<link>http://www.hotsolder.com/2010/03/blogilo.html</link>
		<comments>http://www.hotsolder.com/2010/03/blogilo.html#comments</comments>
		<pubDate>Wed, 17 Mar 2010 21:34:26 +0000</pubDate>
		<dc:creator>wd5gnr</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.hotsolder.com/2010/03/blogilo.html</guid>
		<description><![CDATA[I&#8217;ve been enjoying KDE 4.4. The new Window management features are really nice &#8212; grouping windows as tab (check the system menu or middle click and drag a window title onto another one) is cool. I also like being able to tile or maximize windows by dragging them to a screen edge (even the edge [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been enjoying KDE 4.4. The new Window management features are really nice &#8212; grouping windows as tab (check the system menu or middle click and drag a window title onto another one) is cool. I also like being able to tile or maximize windows by dragging them to a screen edge (even the edge of one of my multiple monitors &#8212; hooray).</p>
<p>There is a Blog tool included in the latest KDE call Blogilo. I&#8217;m using it to write this. Very nice editor interface and easy enough to set up. </p>
<p>Now if I could just get it to interface with one of my other Blogs that I don&#8217;t control&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hotsolder.com/2010/03/blogilo.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Server Change</title>
		<link>http://www.hotsolder.com/2010/01/server-change.html</link>
		<comments>http://www.hotsolder.com/2010/01/server-change.html#comments</comments>
		<pubDate>Mon, 04 Jan 2010 18:06:52 +0000</pubDate>
		<dc:creator>wd5gnr</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.hotsolder.com/?p=799</guid>
		<description><![CDATA[The server that hosts Hotsolder (and AWCE and several other related sites) was due for a major overhaul and it got it. May still be some glitches here and there so either bear with us or report any problems you are having.
Happy New Year!
]]></description>
			<content:encoded><![CDATA[<p>The server that hosts Hotsolder (and AWCE and several other related sites) was due for a major overhaul and it got it. May still be some glitches here and there so either bear with us or report any problems you are having.</p>
<p>Happy New Year!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hotsolder.com/2010/01/server-change.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Multimonitor Madness</title>
		<link>http://www.hotsolder.com/2009/11/linux-multimonitor-madness.html</link>
		<comments>http://www.hotsolder.com/2009/11/linux-multimonitor-madness.html#comments</comments>
		<pubDate>Sun, 29 Nov 2009 08:09:44 +0000</pubDate>
		<dc:creator>wd5gnr</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.hotsolder.com/?p=643</guid>
		<description><![CDATA[I&#8217;m addicted to having two monitors. It drives me crazy to go back to just one. Well yesterday one of my 19&#8243; panels went white and stayed that way. Luckily with black Friday sales going on I was able to replace it on the cheap. However, most monitors these days are widescreen, so it takes [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m addicted to having two monitors. It drives me crazy to go back to just one. Well yesterday one of my 19&#8243; panels went white and stayed that way. Luckily with black Friday sales going on I was able to replace it on the cheap. However, most monitors these days are widescreen, so it takes a little getting used to. I replaced both monitors so they&#8217;d match (they were cheap) so my X screen is effectively 3200&#215;900 now.</p>
<p>With all that real estate, I wanted some way to manage windows so they could be tiled effectively on one monitor (which is basically how I use two monitors; one app on one screen and another on the other screen). I&#8217;ve talked before about using wmctrl to script windows so I dusted off my shell programming skills and wrote &#8220;place&#8221;.It assumes your monitors are sitting next to each other (not stacked).</p>
<p>Place chops your screen up into 8 zones:</p>
<p>ABCD<br />
EFGH</p>
<p>So your left screen is ABEF and your right screen is CDGH. You can also use 1 for the left screen and 2 for the right screen</p>
<p>How to use it: Run the script (hint: assign it a global shortcut key). It will prompt you to press OK and then click on a window. Click on the window you want to adjust, and the script  will prompt you to enter the grid letters. Enter them in order.</p>
<p>So you might enter A to get it at the top left or GH to get a double wide window at the bottom right. Or DH to get a double high window (the acronym is coincidental).If you enter CDGH or 2 the app will jump to the 2nd screen</p>
<p>What you need:</p>
<p>Stuff you can get out of the repos:  Bash (duh), zenity, xwininfo, gawk, and wmctrl. You also need to use a window manager that works with wmctrl (most do). The script picks up the reported size of your screens automatically. This could be a problem if you have two mismatched screens since I know at least TwinView (NVidia) reports a bigger size (so if your screens are 1600&#215;900 and 1600&#215;1024, TwinView reports 3200&#215;1024.</p>
<p>Options (all optional):</p>
<p>-w 10 &#8211; Set width trim to 10 (adjusts the width down to account for decor)</p>
<p>-t 40 &#8211; Set height trim to 40</p>
<p>-i 0&#215;4942 &#8211; Use window ID instead of prompting for window</p>
<p>-n &#8216;mywin&#8217; &#8211; Identify window by title instead of prompting</p>
<p>Note: -n doesn&#8217;t work well when 2 windows have same title! Also, use -i -n or nothing but do not use -i and -n together</p>
<p>-x 1600 &#8211; Override screen width to 1600</p>
<p>-y 900 &#8211; Override screen height to 900</p>
<p>-s ABEF &#8211; Use placer string and don&#8217;t prompt</p>
<p>-r &#8211; Do not raise window</p>
<p>-q &#8211; Quiet (do not show intro dialog)</p>
<p>Here&#8217;s the script (or download it from <a href="http://www.awce.com/place" target="_self">here</a>.</p>
<pre>#!/bin/bash
# Dual Monitor Window placement script -- Williams alw@al-williams.com
# Version Beta 1, November 28 2009 - http://www.hotsolder.com

## This little script chops your screen up into 8 zones:
#  ABCD
#  EFGH
# (Obviously I'm assuming you have two monitors horizontally)
# So your left screen is ABEF and your right screen is CDGH
# You can also use 1 for the left screen and 2 for the right screen
#
# How to use it: Run this script (hint: assign it a global shortcut key)
# It will prompt you to press OK and then click on a window
# Then it will prompt you to enter the grid letters. Enter them in order.
# So you might enter A to get it at the top left or GH to get a double
# wide window at the bottom right. Or DH to get a double high window.
# if you enter CDGH or 2 the app will jump to the 2nd screen
#
# What you need:
# Stuff you can get out of the repos:
# Bash (duh), zenity, xwininfo, gawk, wmctrl
# You also need to use a window manager that works with wmctrl (most do)
#
# The script picks up the reported size of your screens automatically
# This could be a problem if you have two mismatched screens since
#  know at least TwinView (NVidia) reports a bigger size (so if your
#  screens are 1600x900 and 1600x1024, TwinView reports 3200x1024
# So you may want to override
# Also, you will want to trim down the exact values so the window edges
# and all fit. You can adjust WTRIM and HTRIM below or use the options

# Options (all optional)
# -w 10 - Set width trim to 10
# -t 40 - Set height trim to 40
# -i 0x4942 - Use window ID instead of prompting for window
# -n 'mywin' - Identify window by title instead of prompting
# Note: -n doesn't work well when 2 windows have same title!
# Note: Use -i -n or nothing but do not use -i and -n together
# -x 1600 - Override screen width to 1600
# -y 900 - Override screen height to 900
# -s ABEF - Use placer string and don't prompt
# -r - Do not raise window
# -q - Quiet (do not show intro dialog)

# TODO: Custom grid dialog to pick on a 4x2 grid
# I may do this with kdialog and/or pick zenity or kdialog depending on
# which is available

# max width and height trim down (adjust to suit)
WTRIM=40
HTRIM=40
PROMPTCMD=zenity
XWIOPT=
XWIARG=
CELLS=
NORAISE=0

# Max Width and Height
MW=`xwininfo -root | awk ' /^[ \\t]*Width:/ { print $2 }' `
MH=`xwininfo -root | awk ' /^[ \\t]*Height:/ { print $2 }' `

# process options
while getopts hw:t:i:n:qx:y:s:r o
do
	case "$o" in
	r) NORAISE=1 ;;
	w) WTRIM="$OPTARG" ;;
	t) HTRIM="$OPTARG" ;;
	i) XWIOPT="-i" ; XWIARG="$OPTARG"  ;;
	n) XWIOPT="-name" ; XWIARG="$OPTARG" ;;
	x) MW="$OPTARG" ;;
	y) MH="$OPTARG" ;;
	s) CELLS="$OPTARG" ;;
	q) PROMPTCMD=false ;;
	[?]|h) echo "Usage $0 [-x screen_width] [-y screen_height] [-w width_trim] [-h height_trim] [-i window_id] [-n window_name] -q" 1&gt;&amp;2
	exit 1 ;;
    esac
done

# Calculate Trimmed sizes
MWT=`expr $MW - $WTRIM`
MHT=`expr $MH - $HTRIM`

# Calculate 1 cell width and height and their trimmed versions
W1=`expr $MW / 4`
H1=`expr $MH / 2`
W1T=`expr $MWT / 4`
H1T=`expr $MHT / 2`

# prompt user so as not to confuse
if [ "$XWIOPT" == "" ]
then $PROMPTCMD --info --text 'Press OK and then select a window' --title 'Window Placer'
fi

# find out ID of window selected
if [ "$XWIOPT" != "" ]
then WID=`xwininfo $XWIOPT "$XWIARG" | awk '/xwininfo: Window id:/ { print $4 } ' `
else WID=`xwininfo | awk '/xwininfo: Window id:/ { print $4 } ' `
fi
if [ "$WID" == "" ]
then
	echo  "Unknown window" 1&gt;&amp;2
	exit 2
fi

# get position requested
if [ "$CELLS" == "" ]
then CELLS=`zenity --title 'Window Placer' --entry --text 'Your screens are divided into a 4x2 grid.
The top 4 cells are ABCD and the
bottom cells are EFGH. Or pick a screen (1 or 2).
Pick which cells you wouldd like for this window to occupy.

ABCD    -or-   12
EFGH' `
  if [ $? -ne 0 ]
  then
    echo Cancelled
    exit 3
  fi
fi

# Do the processing
case $CELLS in
[aA])
	X=0
	Y=0
	W=$W1T
	H=$H1T
;;
[bB])
	X=$W1
	Y=0
	W=$W1T
	H=$H1T
;;

[cC])
	X=`expr 2 \* $W1`
	Y=0
	W=$W1T
	H=$H1T

;;
[dD])
	X=`expr 3 \* $W1`
	Y=0
	W=$W1T
	H=$H1T

;;
[eE])
	X=0
	Y=$H1
	W=$W1T
	H=$H1T
;;
[fF])
	X=$W1
	Y=$H1
	W=$W1T
	H=$H1T
;;

[gG])
	X=`expr 2 \* $W1`
	Y=$H1
	W=$W1T
	H=$H1T

;;
[hH])
	X=`expr 3 \* $W1`
	Y=$H1
	W=$W1T
	H=$H1T

;;

[aA][bB])
	X=0
	Y=0
	W=`expr 2 \* $W1T`
	H=$H1T
;;

[bB][cC])
	X=$W1
	Y=0
	W=`expr 2 \* $W1T`
	H=$H1T
;;
[cC][dD])
	X=`expr 2 \* $W1`
	Y=0
	W=`expr 2 \* $W1T`
	H=$H1T
;;
[eE][fF])
	X=0
	Y=$H1
	W=`expr 2 \* $W1T`
	H=$H1T
;;

[fF][gG])
	X=$W1
	Y=$H1
	W=`expr 2 \* $W1T`
	H=$H1T
;;
[gG][hH])
	X=`expr 2 \* $W1`
	Y=$H1
	W=`expr 2 \* $W1T`
	H=$H1T
;;
[aA][bB][cC])
	X=0
	Y=0
	W=`expr 3 \* $W1T`
	H=$H1T
;;

[bB][cC][dD])
	X=$W1
	Y=0
	W=`expr 3 \* $W1T`
	H=$H1T
;;
[eE][fF][gG])
	X=0
	Y=$H1
	W=`expr 3 \* $W1T`
	H=$H1T

;;

[fF][gG][hH])
	X=$W1
	Y=$H1
	W=`expr 3 \* $W1T`
	H=$H1T
;;
[aA][bB][cC][dD])
	X=0
	Y=0
	W=$MWT
	H=$H1T
;;
[eE][fF][gG][hH])
	X=0
	Y=$H1
	W=$MWT
	H=$H1T
;;

[aA][eE])
	X=0
	Y=0
	W=$W1T
	H=$MHT
;;
[bB][fF])
	X=$W1
	Y=0
	W=$W1T
	H=$MHT
;;
[cC][gG])
	X=`expr 2 \* $W1`
	Y=0
	W=$W1T
	H=$MHT
;;
[dD][hH])
	X=`expr 3 \* $W1`
	Y=0
	W=$W1T
	H=$MHT
;;

[aA][bB][eE][fF]|1)
	X=0
	Y=0
	W=`expr 2 \* $W1T`
	H=$MHT
;;
[bB][cC][fF][gG])
	X=$W1
	Y=0
	W=`expr 2 \* $W1T`
	H=$MHT
;;
[cC][dD][gG][hH]|2)

	X=`expr 2 \* $W1`
	Y=0
	W=`expr 2 \* $W1T`
	H=$MHT
;;

*)
	zenity  --title 'Window Placer' --error --text 'Unknown position command'
	exit 5
;;  

esac

if [ $NORAISE -eq 0 ]
then wmctrl -i -R $WID
fi
wmctrl -i -r $WID -e 0,$X,$Y,$W,$H
exit $?</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.hotsolder.com/2009/11/linux-multimonitor-madness.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>I/O Scheduling Eleveator and Gambas</title>
		<link>http://www.hotsolder.com/2009/01/io-scheduling-eleveator-and-gambas.html</link>
		<comments>http://www.hotsolder.com/2009/01/io-scheduling-eleveator-and-gambas.html#comments</comments>
		<pubDate>Fri, 02 Jan 2009 18:13:45 +0000</pubDate>
		<dc:creator>wd5gnr</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.hotsolder.com/?p=180</guid>
		<description><![CDATA[
I recently had to work with some very large files under Kubuntu 8.10 and found that when I was decompressing or copying these large files the system would become sluggish. Keep in mind this is with dual 3Ghz AMD cores and 4GB of RAM. The CPU load was almost nothing, but for some reason the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.hotsolder.com/wp-content/uploads/2009/01/ios-ss.png"><img class="size-medium wp-image-181 alignleft" title="ios-ss" src="http://www.hotsolder.com/wp-content/uploads/2009/01/ios-ss.png" alt="Gambas Program" width="300" height="272" /></a></p>
<p>I recently had to work with some very large files under Kubuntu 8.10 and found that when I was decompressing or copying these large files the system would become sluggish. Keep in mind this is with dual 3Ghz AMD cores and 4GB of RAM. The CPU load was almost nothing, but for some reason the disks were blocking the whole system.</p>
<p>Looking around, I wasn&#8217;t the only one to have this problem. It turns out Linux can use several I/O schedulers or &#8220;elevators&#8221;. The idea is to try to service disk requests as the heads go by instead of moving the heads back and forth for each request. There are 4 schedulers:</p>
<ul>
<ul style="display:none">
<li></li>
</ul>
<p> <em style="display:none"><a href="http://www.ecbooks.ca/?i_capture_the_castle">I Capture the Castle movie</a></em>  </p>
<li>noop &#8211; Don&#8217;t schedule</li>
<li>anticipatory &#8211; Try to anticipate disk usage patterns</li>
<li>deadline &#8211; Service requests if they haven&#8217;t been serviced by a deadline already</li>
<li>cfq &#8211; Completely fair; this is the default in recent kernels</li>
</ul>
<ul style="display:none">
<li></li>
</ul>
<p> <strong style="display:none"></strong> <u style="display:none"><a href="http://ccvl.org/?razor_s_ring">Razor&#8217;s Ring</a></u><br />
Turns out the cfq scheduler is what was doing it &#8212; not sure if it is a bug per se or just some interaction with my hardware. Anticipatory worked best for me. There are two ways you might change the schedule policy. At run time you can send the right string to /sys/block/XXX/queue/scheduler (where XXX is the device name). So if your main disk is /dev/sda you might say:</p>
<p>echo deadline&gt;/sys/block/sda/queue/scheduler</p>
<p>You can cat the same file to find out which one is current (it will be in square brackets). You can also edit your bootloader line to include the option elevator=XXX to set the system-wide default (XXX can be noop, as, deadline, or cfq &#8212; as is anticipatory).</p>
<p>I wrote a simple Gambas program using Gambas 2.9 to view and set the scheduler. It uses either kdesudo or gksudo to give you root privleges to write to the system file. I haven&#8217;t tried to distribute a Gambas program before &#8212; I know it depends on having Gambas in the system repositories and of the same version, so I&#8217;m not sure how useful it will be to others unless they are Gambas developers. None the less, I have a <a href="http://www.hotsolder.com/iosched_0.0.4-1_all.deb">.deb file</a>
<div style="display:none"><a href="http://londongirlgeekdinners.co.uk/?new_jack_city">New Jack City movie</a></div>
<p>  <em style="display:none"></em>  and a <a href="http://www.hotsolder.com/iosched-0.0.4.tar.gz">source archive</a> available.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hotsolder.com/2009/01/io-scheduling-eleveator-and-gambas.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
