Adams Bros Blog

20Dec/091

Intel WIFI 5300 AGN Unknown error 132

Author: Trenton

See comments for latest updates

Recently I started having problems with my Intel Corporation PRO/Wireless 5300 AGN card.  It simply quit working after I did a kernel upgrade.  It was giving errors like "Unknown error 132", and "deauthenticated (Reason: 9)".  The hardware switch did not seem to affect it, and the errors were the same whether I had the switch on, or off; so I'm assuming it had to do with the hardware not being initialized properly when the module loaded.

Filed under: Linux Continue reading
5Dec/090

Gentoo Portage Python Update issues

Author: Trenton

I have been having some gentoo portage problems due to my system being out of sync. When I finally updated a month or two later, it simply wasn't working. I was getting an error like the following...

Performing Global Updates: /usr/portage/profiles/updates/3Q-2009
(Could take a couple of minutes if you have a lot of binary packages.)
 .='update pass'  *='binary update'  #='/var/db update'  @='/var/db move'
 s='/var/db SLOT move'  %='binary move'  S='binary SLOT move'
 p='update /etc/portage/package.*'
......................................................                    

Performing Global Updates: /usr/portage/profiles/updates/4Q-2009
(Could take a couple of minutes if you have a lot of binary packages.)
 .='update pass'  *='binary update'  #='/var/db update'  @='/var/db move'
 s='/var/db SLOT move'  %='binary move'  S='binary SLOT move'
 p='update /etc/portage/package.*'
..................
Traceback (most recent call last):
 File "/usr/bin/emerge", line 40, in <module>
 retval = emerge_main()
 File "/usr/lib64/portage/pym/_emerge/main.py", line 1328, in emerge_main
 return action_sync(settings, trees, mtimedb, myopts, myaction)
 File "/usr/lib64/portage/pym/_emerge/actions.py", line 2173, in action_sync
 if portage._global_updates(trees, mtimedb["updates"]):
 File "/usr/lib64/portage/pym/portage/__init__.py", line 8572, in _global_updates
 moves = bindb.move_ent(update_cmd)
 File "/usr/lib64/portage/pym/portage/dbapi/bintree.py", line 273, in move_ent
 mytbz2.recompose_mem(portage.xpak.xpak_mem(mydata))
 File "/usr/lib64/portage/pym/portage/xpak.py", line 106, in xpak_mem
 indexglob=indexglob+encodeint(len(x))+x+encodeint(datapos)+encodeint(mydatasize)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb0 in position 49: ordinal not in range(128)
Filed under: Linux Continue reading
22Nov/090

XSL Break or Wrap String on Word Boundary

Author: Trenton

I've searched all over the Internet for this, and was unable to find anything reasonable.  I found an example somewhere, of how to break a string at a specific location, but it breaks whether there is a word there or not.  So, either you have to re-compose the XML elements without a space, and hope every system you interact with does the same thing as you,  or re-compose them with a space, and a word may then be broken up in the end result.

In my example below, I break a string on a word boundary, outputting to an XML element called "NoteMessage" from the PESC standard.  This is dependant on Java, but you could use any language that has a useful lastIndexOf function.  In the case of Java, with zero based string index, we need to compensate for the one based string index that XSL has.  So, we add one to the result of the lastIndexOf() call.

<!--
Example...
java -cp target/dependency/xml-util-0.1.3-SNAPSHOT.jar:/usr/share/xalan/lib/xalan.jar \
org.apache.xalan.xslt.Process -XSL target/classes/xsl/notemessage.xsl \
 -PARAM testString "This is a test to break a string into multiple note messages, \
automatically, without programming."
-->
<xsl:stylesheet version="1.0"
                xmlns:String="http://xml.apache.org/xalan/java/java.lang.String"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output indent="${xml.indent}" method="xml" omit-xml-declaration="yes"/>
  <xsl:param name="testString"/>
  <xsl:variable name="break-at" select="'76'"/>
 
  <xsl:template match="/">
    <xsl:call-template name="note-message">
      <xsl:with-param name="string" select="$testString"/>
    </xsl:call-template>
  </xsl:template>
 
  <xsl:template name="note-message">
    <xsl:param name="string"/>
    <xsl:choose>
      <xsl:when test="string-length($string) <= $break-at">
        <xsl:element name="NoteMessage">
        <xsl:value-of select="$string"/>
        </xsl:element>
      </xsl:when>
      <xsl:otherwise>
        <!-- call method to find word boundary index -->
        <xsl:variable name="truncString"
                      select="String:new(substring($string, 1, $break-at))"/>
        <xsl:variable name="lastSpaceIndex"
                      select="String:lastIndexOf($truncString, ' ') + 1"/>
        <xsl:element name="NoteMessage" namespace="">
          <xsl:value-of select="substring(string($truncString), 1, $lastSpaceIndex)"/>
        </xsl:element>
        <xsl:call-template name="note-message">
          <xsl:with-param name="string"
                          select="substring($string, $lastSpaceIndex + 1)"/>
        </xsl:call-template>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
</xsl:stylesheet>
Filed under: Java, Programming, XSL No Comments
23Aug/090

HDA Intel Alsa volume low

Author: Trenton

I've been having a problem where the volume level of my Dell Studio 17 notebook is just not loud enough when I'm running Linux.  I went to windows, to see if the problem was the same there, and I found that the volume in Windows Vista was way higher.  So, I booted back into Linux, and started googling.

I quickly found a few places that talked about setting the model to 3stack, and various other options.  But, none of that worked for me.  So, I decided to search for the problem on my own.  I ended up checking out the alsamixer again, from the command line.  Last time I checked, I saw that the "Speaker" volume was set to about two thirds, but I had thought that was referring to the volume of the PC Speaker, as on many sound cards, it is actually an option.  As it is, that is actually the volume of the external speaker.  Once you pump that puppy up to 100% the volume level is good.  From there, you can simply adjust the master or PCM volumes as you choose.

Filed under: Linux No Comments
12Aug/090

Java, Xalan, JAXP, xml transformations from Java String

Author: Trenton

I racked my head against the wall over and over again for several hours, unable to determine why I was getting a prolog error, when I knew dang well my XML was well formed.

I'm using JAXP, which is detecting and using xalan as my transformation implementation.  I'm not sure who's fault it is, but when I create a new StreamSource for my transformation, and I ask it to load the xml-stylesheet from the processing instruction, it simply doesn't work. I keep getting one of two errors, depending on the format of the java String.

The first error I was getting was "javax.xml.transform.TransformerException: Content is not allowed in prolog". The other error I was getting, once I put my xml declaration at the beginning of the string, was "javax.xml.transform.TransformerException: The markup in the document following the root element must be well-formed". Of course, none of these are meaningful in any way. Neither one tells me that I'm not allowed to ask xalan to resolve my xml-stylesheet automatically, while using XML from a Java String object.

11Aug/090

MMC/SDHC Card Readers and Gentoo Linux

Author: Trenton

So, I had a need to use my SDHC card in my Dell Studio 17 (1737) notebook.  So, I set out to find out why it wasn't working.  I ended up finding out that I needed to load mmc_block and sdhci-pci in order to get it to work.  Here's what I did.

16Jun/091

Quick Guide to LUKS Encrypted Home Volumes

Author: Trenton

If you search for information on how to do LUKS encrypted home volumes, you're likely to get these big fluffy documents on how to do it.  Well, if you're like me, you'd like to skip all that fluff, and get straight to the point.  That's what I try to do here.  If you like, you can completely ignore what I'm saying here, and just use the commands; it really isn't complex.

Keep in mind that this will only work for a maximum of 8 users per system.  Anything more than that, and you will have to resort to either full disk encryption, or some other method of encrypting your /home files.

I would try this out on a 1G volume or something just for fooling around.  Then once you've got that working, do it to your actual home directory.  I use LVM with mine, but it could also be a raw partition if you prefer that.  If it is a removable drive, I HIGHLY recommend using LVM, because you will be able to reference it by lvm "name".  Using a partition for external drives becomes difficult, because you cannot name an encrypted volume.

Filed under: Crypto, Linux Continue reading
15Jun/091

arduino interfacing with the HD44780 LCD

Author: Troy

It became time for me to interface an LCD with my Arduino.  I need to generate a handy report of what my various sensors are picking up.  The following is an account of my notes on twisting up my HD44780 compatible LCD on the Arduino. Please enjoy.

I'm staring at my LCD module.  I can hear it saying, "hook me up!", but I'll have to read a bit first.

14Jun/090

Linux Macbook Function Key Mode – fnmode

Author: Trenton

So, I couldn't figure out how to get my Macbook function keys to default to function keys under Linux, rather than media keys such as brightness, volume control, etc.  I searched all over the net for information on this feature, and could only find stuff about pb_fnmode (which doesn't appear in the latest kernels).  So, I finally resorted to grepping "fnmode" out of the sources, and found the location that sets this.  Then, I noticed that the kernel module that handles Mac key mappings had a parameter that could be changed, called "fnmode".  Well, that gave me a clue that it may be in /sys/ somehwere.  So, I searched, and sure enough, it was there.  The following command will set the function keys to be the default action, rather than media keys.

echo 2 > /sys/module/hid_apple/parameters/fnmode

The valid values are (0 = disabled, [1] = fkeyslast, 2 = fkeysfirst)

This effectively reverses the function key/media key mappings.

Filed under: Hardware, Linux No Comments
12Jun/091

Kingston Rocks

Author: Trenton

If you plan on buying memory, it most certainly MUST be Kingston memory.  I bought 4G of Kingston memory from CDW Canada, for my Macbook, and it was DOA.  I tried it in my Macbook; Linux was freezing up, and Mac OS X was telling me I had to restart my computer.

CDW doesn't do returns, so I called up Kingston.  I told them the situation, about how I put the memory in my computer, and my computer quit working, but works with my other RAM.  They immediately issued me an RMA number, and told me that they would be emailing me instructions on how to send it back through fedex; the fedex charges would be billed to them.  I'm like "WHAT"????  You guys are paying the shipping charges?  I was totally expecting to have to pay shipping myself.  So, I proceeded to ask if they were paying shipping charges because I had just purchased it, or if this was the case for the life of the product.  She told me that it was included with the lifetime warranty.

Now that is what I call a lifetime warranty.  So, suffice it to say, I will only buy Kingston memory.  KINGSTON ROCKS!!!

Filed under: Hardware 1 Comment