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…)

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.

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.

November 4, 2006

Using the P3120 and other Lexmark printers in Linux

Filed under: Linuxy — Administrator @ 9:03 pm

I have the Lexmark P3120 AIO, and for the longest time I could never get it working in Linux. Well, I finally figured it out (printing only), when I saw that the P3150 was confirmed working and I was only 30 model numbers behind. I used the Z600 drivers for Linux that were provided by Lexmark. Lexmark’s Linux driver support is halfhearted and incompleted, but the Z600 driver works for a wide range of Lexmark printers.

To check if your printer will work either with the Z600 or Z700 drivers, consult Gentoo’s Lexmark Printers guide.
If you’re using Gentoo, well lucky you. Just follow the instructions on the Z600/Z700 ebuilds there.
If you’re using RedHat, it’s even easier. Get the Z600 RPM provided by Lexmark.
If you’re using Ubuntu, there are guides for Breezy users on the Ubuntu website:
http://ubuntuforums.org/showthread.php?t=215657
http://www.ubuntuforums.org/showthread.php?t=159704
Ubuntu Wiki guide
However, I prefer the Honey Badger IT guide. Keep trying until one of them works for you. I think using alien to convert the RPM to a .deb is the best way (look on the guides!).
Edgy users will need to copy the PPD from the driver (after following one of the above guides, that is!) to /usr/shared/ppd, because that’s where CUPS looks for the PPD in Edgy.

April 15, 2006

Linux TCG

Filed under: Linuxy — Administrator @ 3:01 pm

I am serious. Somebody needs to make a Linux trading card game. Heck, I’ll try making one when I have time. I think the objective should be like…

Assemble a complete OS from your deck. You need certain peripherals (monitor, keyboard, processor), some extra peripherals (joystick, WiFi), a kernel (Linux/Hurd), OS (GNU), X-Window, desktop environment (KDE, GNOME, Xfce, Enlightenment, etc.), core utilities (bash, ftp, sed, etc.), etc.

Opponent will try to do the same, while at the same time attacking you and destroying your components with stuff like /dev/null, segmentation fault, broken dependency, apt-get remove, lmao. Everything, like compiling, using attacks, uses your cpu’s energy.

Each component gets a compile time (shortened if you have apt-get or yum), stability (HP, basically), and other cool stats. This has the potential to really grow because there are bajillions of different Linux stuff. Plus, it teaches about how GNU/Linux OSes work.

Of course, all the artwork has to be done in the GIMP or Inkscape, with proceeds funding stuff like the FSF, GNU, KDE, etc. Is www.linuxtcg.com taken?

March 15, 2006

Mozilla’s Cash Cow

Filed under: Linuxy — Administrator @ 7:34 am

It’s been reported that Mozilla Corp. makes tens of millions of dollars from Google, because Firefox users use the little Google search in the search bar. And they’re still giving us the “donate to us so we can feed our starving developers” when they have Google to watch over them.

February 8, 2006

X-Window Compositing

Filed under: Linuxy — Administrator @ 7:32 pm

I tried using compositing on X-Window (with Kompmgr, of course), and it is amazing. However, it is still in the developmental stages and isn’t very well-known.

It features window transparency, shadows, fading in/out for everything, and more. I’m beginning to see why Windows Vista has nothing innovative. Microsoft showed off how the little icons would reflect the file’s contents – KDE and GNOME have had this for forever for text files. Vista will have fancy see-through windows and stuff – compositing in X does this just fine (kinda slow without a good GFX card though). It seems the only new thing Vista will have is the nice little start button.

January 17, 2006

Linux isn’t what all it seems

Filed under: Linuxy — Administrator @ 9:30 pm

Today, I managed to get an old computer working. I even had to manually test RAM because there was a bad stick. Finally, it booted up into Ubuntu Live. This guy I knew came over and said, “Ooh, I’ll get to see what a Linux computer looks like!”

People just don’t get that Linux is only a small part of an operating system. Linux just refers to the kernel, which manages writing to disks, memory, etc. The rest of the operating system includes GNU, X Window, and GNOME. This is why there are different distros – there are different ways of packing all the relevant components, and Ubuntu just packs it a certain way with its own little features. There is no one Linux OS, unlike Windows, which all looks the same.

January 2, 2006

SOLVED: GRUB Error 17

Filed under: Linuxy — Administrator @ 12:24 pm

I recently changed my system to a dual-boot setup with Ubuntu GNU/Linux, and it worked magically for awhile. However, I was using Windows XP to make a FAT32 partition (seems like I had to make it in Windows for it to be recognized), when my GRUB boot loader messed up. I couldn’t boot my computer. Luckily, I had Ubuntu Live handy, and I booted into a live session.

I made a rescue floppy by going into GRUB’s folder (with stage1 and stage2), and running the following commands:

dd if=stage1 of=/dev/fd0 bs=512 count=1
dd if=stage2 of=/dev/fd0 bs=512 seek=1

I now had a bootable floppy. With the floppy, I can boot into the GRUB prompt. From there, I could either type in some commands to boot Linux, or I could install GRUB. I installed it by:

grub> root (hd1,0) or whatever partition Linux is on
grub> setup (hd0)

I now had GRUB back again!

Powered by WordPress