Aztekera

January 15, 2010

Reading a USB Stamps.com scale

Filed under: Hardware, Linuxy, Programming, Standards — Administrator @ 8:18 pm

I got suckered into one of those hard-to-cancel Stamps.com trials. The upside is that they give you a $10 USB 5 lb. scale to use with their software. The downside is that they want you to only use it with their software, and the company that makes the scale has since taken down their free USB-scale program.

The good news, as Nicholas Piasecki and some Linux users figured out, is that the USB scale conforms to the USB HID specifications, which helpfully standardize how USB scales should work (no joke).

So, I hacked together a Perl script (what else?) to read from this scale by accessing the hidraw# interface that Linux provides. In my case, I have hidraw4 hard-coded into the script itself. Basically, it loops until it reads a good value from the scale, at which point it prints out the weight and exits.
(more…)

April 20, 2009

“EISA Configuration” partition won’t go away

Filed under: Uncategorized — Administrator @ 11:41 pm

The symptom is typical: you check out the partitions on your hard drive in Windows Disk Manager only to find out that there’s a weird, inaccessible partition that’s of the type “EISA Configuration.” What is it? Can I get rid of it?

What is it?

It has become standard practice for manufacturers to include recovery data or utilities on the hard drive to save them the costs of creating separate recovery disks for your computer. The benefit is that you can always restore your computer without worrying about losing your restory disks, but the downside is that it’s taking space on your hard drive, and if your hard drive died, you don’t have any restore disks at all.

The “EISA Configuration” partition is not really an EISA Configuration partition. EISA is an obsolote IBM bus architecture. What’s really going on is that this partition is a regular FAT32 or NTFS partition, except that its identifier in the partition has been changed to 0xDE, which codes for “EISA Configuration.” This way, Windows doesn’t try to mount it so you won’t accidentally mess with the files there.

How do I get rid of it?

Just delete it. You may be able to delete this partition and then expand your regular Windows partition to fill the gap using Windows Disk Management MMC snap-in. Just right-click on “My Computer” and select “Manage…” and find “Disk Management.”

Personally, I recommend using an Ubuntu live CD. With it, you can boot into Ubuntu, run GParted (a partition editor), delete the EISA Configuration partition and expand the Windows partition to fill in the remaining space. Just be careful with your data. Make a backup.

It won’t go away!

You may experience an issue where, after deleting your “EISA Configuration” partition, you boot your computer only to find out that another partition has magically turned into an “EISA Configuration” partition. What happened here was that the manufacturer (Acer has been known to do this) put a small program in the Master Boot Record (MBR), the first 512 bytes of your hard drive. Every time you boot that hard drive, their program runs and blindly changes the first (usually it’s the first one) partition on the hard drive to 0xDE, which codes for “EISA Configuration.” Bad.

What you need to do is write in a new MBR to get rid of this program. Be careful, because the MBR stores the partition table, without which your computer won’t know what partitions exist on your hard drive. There are several tools that can do this; I won’t go into detail on each one.

Now my computer won’t boot!

If Windows displays an error message saying that “hal.dll” could not be found (Windows XP) or that “rundll32.exe” could not be found, then what likely has happened is that your partition numbers have changed and Windows can’t find itself anymore. On XP, if you know what you’re doing, you can edit the “boot.ini” file to point to the new partition number. On Vista, you’re best off just running the automated recovery on the Vista Recovery Console disc until it’s fixed. It might take several tries.

My drive C: and D: got switched!

It’s a regrettable problem when Windows, which originally was on the C: drive, suddenly gets switched to the D: drive. You’ll find that a lot of things don’t work like this, but unfortunately, you can’t go into Disk Management and change the drive letters because you’re currently running Windows off that drive letter. Microsoft has a KB article detailing the procedure to switch them back, but the process is simple.

Fire up regedit.exe and navigate to HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices, and rename the \DosDevices\C: and \DosDevices\D: keys around. Or, you can delete all the keys in MountedDevices and Windows will automatically enumerate the partitions and reassign drive letters.

April 2, 2009

Google Summer of Code 2009: WordPress proposal

Filed under: Internets, Programming — Administrator @ 2:33 pm

Objective: Create a single-file PHP installer for WordPress that will automate the downloading, unpacking, and setup of a WordPress blog.

Reason: As of right now, setting up a WordPress blog involves a lot of fiddling with files. The user must download the archive, unzip it on their computer, open a ftp connection to their server, upload all of the contents, hope that all the permissions are right, and navigate to the right directory. Since WordPress is such a popular blogging software, many people (most of whom are not familiar with a Unix shell or do not have access to one) would benefit from a single-file installer.

Deliverable: One (1) PHP file. No other files can be included with this (unless embedded), since this would void much of the advantage of such a single-file installer.

Basic procedure (a rough plan):

  1. Instruct the user on the requirements of WordPress (needs hosting with PHP, etc.).
  2. Instruct the user on downloading and uploading this installer, and subsequently running it.
  3. Check the server environment for required components, correct permissions, etc.
  4. Give the user some options on name, location, etc. and solicit other options like database credentials.
  5. Download the latest WordPress distribution.
  6. Unpack the distribution to the right place.
  7. Proceed more-or-less with the “usual” install.

March 3, 2009

Quickly search Java documentation in Firefox

Filed under: Uncategorized — Administrator @ 9:24 pm

Firefox Quick Searches have become an ingrained habit for me after a lot of repeat searching. Recently I’ve been working on a Java project and I’ve found myself needing to look up classes in the Java online documentation quite often. To that end, I’ve set up a quick-search bookmark that will take me to the relevant documentation page by typing java [keyword] in the address bar. It uses Google’s I’m Feeling Lucky search:
The Javadoc quick search bookmark
Just add a bookmark with the string “http://www.google.com/search?btnI=I%27m+Feeling+Lucky&ie=UTF-8&oe=UTF-8&q=Java%206%20%s“.

January 10, 2009

Don’t buy from Musicnotes.com

Filed under: Internets — Administrator @ 1:08 pm

Let me list all the reasons why you might want to buy digital sheet music from Musicnotes.com:

  • It’s faster than having it shipped from Pepper’s.

and that’s pretty much it.

On the other hand, here’s some reasons to avoid Musicnotes.com:
(more…)

November 9, 2008

How to scan like a pro

Filed under: Graphics, Hardware — Administrator @ 5:04 pm

Scanners have been around for a long time, and today’s scanners are cheap, are fast, and produce high-quality output. Still, people haven’t figured how to make good scans—just take a look at scanned scores, manga, etc.—from their scanners.

This means the difference between:
Poorly scanned image (62.4 KiB)
and
Quality scan (30.3 KiB)

Guide follows:

(more…)

August 23, 2008

GParted stuck on “Scanning all devices”

Filed under: Linuxy — Administrator @ 3:09 pm

Ubuntu’s partition editor, GParted, usually scans all the hard drives when it starts. However, in some cases, it will get stuck on this “Scanning all devices” step indefinitely. By knowing what hard drive you want to edit, you can launch GParted specifically for that hard drive. Either go into run or a terminal, and run “gparted /dev/sda”, where “sda”, “sdb”, “sdc”, etc., is the identifier of your hard drive, and GParted will launch and immediately open that particular disk.

June 25, 2008

Linux support for Genius WizardPen, Mousepen, UGEE, UC-Logic, DigiPro tablets

Filed under: Hardware, Linuxy — Administrator @ 2:00 pm

I noticed that today’s Woot was a DigiPro UC-Logic drawing tablet.  I happen to own a UC-Logic tablet: a “WP4158U 快速龙” made by Taiwanese company UGEE.  UC-Logic makes tablet technology for many different companies, and their USB interface is relatively standard and straightforward. (I naively tried reverse-engineering the USB communication for my tablet a couple years ago, and then didn’t know what to do with the results.)  All of the UC-Logic tablets, as well as Genius Wizardpens and even Aiptek tablets can be used in Linux with the “wizardpen” driver.

The basic instructions for setting up the wizardpen driver in Ubuntu can be found on the Ubuntu wiki. If you use Ubuntu, use the instructions on there to install the driver; otherwise, do what your distribution needs.  However, the instructions on there for configuring udev and X.org are a bit overcomplicated and unnecessary.  You don’t need to create udev rules.  Instead, in your xorg.conf, add something like

Section "InputDevice"
Identifier      "MyGenericTablet"
Option          "SendCoreEvents"        "true"
Driver          "wizardpen"
Option          "Name"        "Tablet WP5540U"
Option          "TopX"          "2199"    #Replace these numbers with
Option          "TopY"          "3598"    #numbers correct for your
Option          "BottomX"       "30325"   #own unique tablet by using
Option          "BottomY"       "29278"   #wizardpen-calibrate
Option          "MaxX"          "30325"
Option          "MaxY"          "29278"
EndSection 

Where the “Name” option is the name of your tablet.  You can find out the proper name of your tablet by running

$ cat /sys/bus/usb/devices/*/product

and looking for the line that would be your tablet.  Mine was simply called “TABLET DEVICE”, so that’s what I put in my config.  That way, X will now to use the wizardpen driver for the device that has that name, saving you the trouble of creating udev rules.

Next, don’t forget to add

InputDevice "MyGenericTablet" "AlwaysCore"

to your ServerLayout section.  Forgetting this little step will leave the configuration incomplete, and your tablet broken. After you restart X, start the GIMP, Inkscape, Krita, or whatever paint program you use.  Go into the configuration, into Extended Input Devices, and you should see a new entry that bears the name “MyGenericTablet” or whatever you called it.  You should be able to draw with pressure sensitivity with your fully-functional tablet.  However, one problem that might occur is that you get two separate cursors—your paint cursor and a regular mouse cursor—whose positions are not matched. This is because your tablet is being reported twice: once in /dev/input/mice, and once with the tablet driver.

To fix this, you need to replace “/dev/input/mice” with “/dev/input/mouse#” where “mouse#” is the entry for your mouse.  The way I found out which one was the right one was by running “$ sudo cat /dev/mouse1″, moving my mouse, and seeing if any gibberish appeared on the screen.  I did the same for mouse2, etc. until I found the right one.  However, if you do this, be aware that you may need to change this entry when you change to a new mouse, because X.org is not longer set up to use aggregated mouses.

June 16, 2008

Autodesk licensing issues?

Filed under: Windows — Administrator @ 10:20 pm

Are you having problems with your 3ds Max or other Autodesk license?  Need to change your serial number to a new one?  Does the program keep giving you a license error when you try to activate?
To reset your serial number so that the program asks you for a new one, start up regedit.  Look in HKLM\SOFWARE\Autodesk\[program name]\[version number] and you’ll see two keys, an “h_register” and l_register.”  If you delete both and restart your program, it will ask you for a new serial number.
If it still fails, look in C:\Documents and Settings\All Users\Application Data\Autodesk\Software Licenses, and the *.dat file inside is your license file.  If you delete it or rename it to something safe (I would just add an underscore to the end), the program will restart the registration process without any erroneous information.  You might have to try this a couple times.

May 25, 2008

Working Wi-Fi on Macbooks with Ubuntu Linux

Filed under: Hardware, Linuxy — Administrator @ 9:27 pm

To use a MacBook’s Atheros wireless chipset on Linux, you need to use Ndiswrapper with the provided Boot Camp drivers.

  1. Get the wi-fi driver at makel.org. The one you’re looking for is drivers/Atheros/AtherosXPInstaller.exe.
  2. Install ndiswrapper from apt.
  3. Install unrar from apt.
  4. Extract the drivers with “$ unrar x AtherosXPInstaller.exe
  5. Install the drivers with “$ ndiswrapper -i net5416.inf
  6. $ sudo modprobe ndiswrapper
  7. $ sudo echo >> /etc/modules “ndiswrapper”
  8. Delete the temporary files
  9. The wireless should start working immediately.
Older Posts »

Powered by WordPress