WoWHead client for Linux

This is highly unofficial, but if you want to upload your World of Warcraft statistics to WoWHead in Linux, then you might be able to do so by using the following script. You will need curl and wget installed.

(Continued)

Popularity: 18% [?]


Sneaky blacklisting of WiFi in HP laptops?

I’ve been there before, but somehow I hoped that HP has come to its senses, so when my girlfriend got a HP Compaq 6715b laptop with a Broadcom wifi card that does not work with the open source driver and randomly crashes under load with ndiswrapper driver, I said - “well, I’ll just get an Intel mini-PCIe wifi card and plug it in”. I should have know better.

While there is no obvious impenetrable error message like on NX6110, the 6715b simply ignores any non-HP wireless cards. They do not show up in lspci and don’t even appear in Vista. I have all the latest drivers and latest BIOS.

I will look a bit for a workaround, possibly along the same lines as before (make a non-HP wifi card look like a HP wifi card), but I really must say - despite all the support for Debian HP has on the server side, I will have to recommend everyone I know to never, ever buy any HP laptops! By having an easy access latch to the WiFi slot they seem to embrace user choice, but in the confines of their BIOS they just cut through the heart of it by only allowing their own cards to be installed and used.

Note: it is possible that the card itself is non-functional, but given the previous experience and some similar messages on the forums about all kinds of other HP laptops .. I wouldn’t bet on that.

I would love to be proven wrong on this or shown a way to either make the non-HP IPW3945 card work or how to make the original Broadcom wifi card work in a stable manner. Currently it causes 4-8 hard lockups a day if the laptop is left acting as a bittorrent seed for a few thousand clients. Now i am just too tired to deal with this reasonably and should rather head for bed.

Popularity: 29% [?]


Slow starting USB storage in Linux

I have this USB hard drive enclosure that can also share the files on the local network (LAN DRIVE HD9-U2LA, vendor id - 05e3:0702). Due to that it has an operating system and some other software inside. Unfortunately this software is rather slow to start and that cause the following kernel error when trying to mount this enclosure:

[90459.236000] usb 5-5: new high speed USB device using ehci_hcd and address 9
[90459.368000] usb 5-5: configuration #1 chosen from 1 choice
[90459.368000] scsi4 : SCSI emulation for USB Mass Storage devices
[90459.368000] usb-storage: device found at 9
[90459.368000] usb-storage: waiting for device to settle before scanning
[90464.368000] usb-storage: device scan complete
[90470.148000] usb 5-5: USB disconnect, address 9
[90470.148000] scsi 4:0:0:0: scsi: Device offlined - not ready after error recovery

The device is fine, it is just slow to start. To work around this bug you can change /sys/module/usb_storage/parameters/delay_use from a default 5 second delay to something larger. 15 seconds worked fine in my case.


echo 15 | sudo tee /sys/module/usb_storage/parameters/delay_use

Update:
To do that permanently, create a file in /etc/modprobe.d (with a name slow_storage for example) that contains such line:


options usb_storage delay_use=15

Popularity: 23% [?]


Terrorist Airlines

I can’t believe I have not bogged about this before. With all that terrorism threat bullshit, wouldn’t it be nice if there was an airline that would declare itself to be ‘terrorist friendly’ - i.e. all passangers are welcome to come on board with just a simple identity check, no security check, no baggage security check, no delays. You can arrive 10 minutes before departure and just fly away. Wouldn’t that be nice?

A budget company could do that to spare on airport security fees and high-end airline could do it just to spare your time. All flights could be marked private charter for legal reasons.

Can we please return to a world when I can take a bottle of mineral water and a nail clipper on board with me?

Popularity: 20% [?]


Wow 2.1.3 on Wine 0.9.40

If you are playing World of Warcraft on a Debian or Ubuntu system with newest Wine packages from WineHQ, then you might run into a problem - WoW-2.1.2.6803-to-2.1.3.6898-enUS-patch.exe files will crash on Wine 0.9.40 with some nastygrams sent in the direction of its mshtml implementation. Downgrade to 0.9.33 (like the version in feisty) and the patching will work just fine.

Popularity: 44% [?]


Wrong partition ordering

If you have a hard drive with two or more logical partitions in one extended partition and then proceed to erase the first of those logical partitions (in GParted), then you will soon discover that the number of the second logical partition changed (from sda6 to sda5 in my case). If you then try to create a partition in the free space and launch cfdisk, you will notice that there is no free space where it should have been. If you then manage to get to GParted and create a partition there, then do not relax, as your perils are not yet over. Upon reboot you will find that the logical partition that is in the beginning of the logical partition got a new number (sda7 in my case) and the your valuable second logical partition is still numbered wrongly (it was sda5 instead of expected sda6). Even more so, if you try to fix it with cfdisk, it bails out with a fatal error of overlapping extended partitions.

The fix is to start fdisk, press “x” for advanced operations and press “f” to reorder the partitions according to the order on disk (do not forget to enter “w” to write the changes). That fixed the problem. But I have no idea who to bug for this wonderful Mongolian Clusterf*ck of Partition Numbering.

And that is only a tiny preview of the immense fun I am having right now by trying out installations of Debian etch and Ubuntu edgy on my Dell M1710. If you want a stable desktop on this computer right now - use Ubuntu Dapper (with nvidia binary drivers). You will have much unneeded fun with IPW3945 wifi and the NVidia video card drivers otherwise.

Edit: fixed fstab -> fdisk. How silly of me :)

Popularity: 34% [?]


Why? Oh Gods! Why?


$ mv .ssh/ .ssh.old/
$ python
>>>import gnomevfs
>>> gnomevfs.get_file_info( "ssh://aigarius:password@aigarius.com/home/aigarius" )
Traceback (most recent call last):
File "<stdin>", line 1, in ?
gnomevfs.AccessDeniedError: Access denied
>>>
$ ssh aigarius.com
The authenticity of host 'aigarius.com (85.254.216.40)' can't be established.
RSA key fingerprint is 6d:29:c0:f3:d0:84:c9:a9:d9:4c:7e:e3:1a:18:a2:e2.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'aigarius.com,85.254.216.40' (RSA) to the list of known hosts.
aigarius@aigarius.com's password: *******
[...]
aigarius.com$ exit
$ python
>>>import gnomevfs
>>> gnomevfs.get_file_info( “ssh://aigarius:password@aigarius.com/home/aigarius” )
<gnomevfs .FileInfo ‘aigarius’>
>>>

Of course, this is mentioned nowhere in the sparse documentation. Please keep me away from the person who wrote GnomeVFS and its Python bindings. Bloodshed might ensue. Bug reported

Why can’t someone write a nice, light, working network file transfer protocol abstraction library that would be independent of any desktop environment (bonus) and a working X server (I am looking at you, GnomeVFS). Something that would simply provided all file and folder manipulation operations in sync and async ways in such way that those operations work completely uniformly across all supported protocols. Support for at least ssh and ftp is essential, webdav, nfs, rsync and other protocols that allow writing files to remote locations and http, https and other protocols that only allow read only access to remote files would be very welcome. The library should be in C with bindings in C++, Python, Perl, Ruby, PHP and also a command line processor that would allow all commands to be used in a shell script.
Why something like this can not be written and obsolete the GnomeVFS and those KIOslaves. Freedesktop.org, I am looking at you, please!

Update: Apparently I only need to “import gnome.ui” and execute “gnome.ui.authentication_manager_init()” and my application will automagically get a proper authentication dialog in this case. Unfortunately it is not documented anywhere that I could find. :P

Popularity: 46% [?]


Bit horizon

A small idea for increasing the performance of peer-to-peer communications for highly popular files.

Imagine a BitTorrent file that becomes popular overnight. There are thousands of clients trying to download it, so for each client there are thousands of possible source to get the file from. However, one client can only connect to a small number of source at any one time (50-100). Due to randominess of that connection, such sources could be from the house next doors or could be from China or Australia. This creates excessive stress on the whole Internet as the parts of the file fly all around the world over and over.

I suggest to introduce a horizon effect in clients when the number of peers is much higher then the max number of connections the client can make at one time.

The easiest would be to make the decisions based on ping speed, but other criteria could also be useful.

For an example implementation consider this: a new client joins in downloading a very popular file on a P2P network, he discovers enough peers to enable the horizon feature, the client connects to 100 random peers and takes their ping times, a distribution is calculated and a horizon is established - all peers with ping higher then the horizon value are deemed to be too far and are disconnected, freeing the resources for finding closer peers. The algorithm would continue to update horizon calculations and eventually would converge down to a set of closest peers and that would give both optimum performance to the client and less stress for the global Internet backbones.

Separate horizons could be set up for seeders (clients with fully downloaded file) and lechers (clients with only partially downloaded file), so that we do not have a whole section of the network stagnating with no seeds in the area.

Anyone up to make this work in, for example, Azureus?

Popularity: 19% [?]


Middle-clicking files

A though came to my mind just now - the method of copying text around by just selecting it to copy and using middle-click to paste it. So I wonder, why could one not apply the same for file operations in Nautilus? I would love to just select and middle click to copy files and maybe a Ctrl or Alt key could be used at the paste stage to switch to moving files instead of copying.

Anyone up to the challenge of writing this functionality? Should not be too hard.

Popularity: 30% [?]


IPW2200 on HP nx6110

If you thought that sticking a supported miniPCI wireless card into a HP nx6110 notebook and getting it to work is trivial or fast or well documented, then you are quite wrong! Let me walk people trough the misery here…


So you have you great HP nx6110 notebook with some kind of Linux installed. For this exercise we will assume that we have Ubuntu Dapper Drake here, but similar problems will happen anywhere else too. You have you shiny new Intel PRO/Wireless 2200 card (or newer IPW2915 that has even more problems) in miniPCI form factor. You open the back of your notebook, stick the card into the slot, attach leads from the antennae and … the fun begins …

The first problem is that you were cheap and instead of buying HP branded IPW2200 card for 100$, you bought an OEM version for 20$. HP will not like that, so right on the boot up you will be greeted by: “104 unsuported wirless network device detected, system halted, remove device and restart”. Friendly, ne? The best workaround to this problem can be found on a HP forum and it is to edit EEPROM of the miniPCI card so that it contains the PCI ID that the HP laptop BIOS expects it to contain. Neat :)

WARNING: EEPROM contains lots of important data. Anything could happen if wrong values are put there.

So, how will we do that? It is quite simple, really. First remove the card and boot your Ubuntu. We will use the new Linux 2.6.16 kernel. To add support to writing to EEPROM we will need Martin Stachon’s patch, but we will have to modify it a bit so that it fits 2.6.16 kernel, so here is the updated patch:


--- linux-2.6.16/drivers/net/wireless/ipw2200.c 2006-03-20 07:53:29.000000000 +0200
+++ linux-2.6.16.new/drivers/net/wireless/ipw2200.c 2006-03-24 22:07:12.000000000 +0200
@@ -2345,6 +2345,8 @@
* NOTE: To better understand how these functions work (i.e what is a chip
* select and why do have to keep driving the eeprom clock?), read
* just about any data sheet for a Microwire compatible EEPROM.
+ *
+ * The chip is 93C66 in 16x256 mode. */
/* write a 32 bit value into the indirect accessor register */
@@ -2425,6 +2427,37 @@
return r; }
+/* write 16 bits to the eeprom */
+static void eeprom_write_u16(struct ipw_priv* priv, u8 addr, u16 data)
+{
+ int i;
+
+ printk(KERN_INFO DRV_NAME " eeprom_write_u16(%02x, %04x) ", addr, data);
+
+ /* write/erase enable */
+ eeprom_op(priv, EEPROM_CMD_EWEN, EEPROM_CMD_EWEN_ADDR);
+ eeprom_disable_cs(priv);
+
+ eeprom_op(priv, EEPROM_CMD_WRITE, addr);
+
+ /* now the data bits follow */
+ for ( i=15; i>=0; i-- ) {
+ eeprom_write_bit(priv, ( (data&(1<<i)) != 0 ) ? 1 : 0 );
+ }
+
+ /* CS needs to be taken low before next clock */
+ eeprom_write_reg(priv,0);
+ eeprom_write_reg(priv,EEPROM_BIT_SK);
+
+ msleep(10); /* wait for the write to complete */
+
+ eeprom_write_reg(priv,0);
+
+ /* write/erase disable */
+ eeprom_op(priv,EEPROM_CMD_EWDS,EEPROM_CMD_EWDS_ADDR);
+ eeprom_disable_cs(priv);
+}
+ /* helper function for pulling the mac address out of the private */
/* data's copy of the eeprom data */
static void eeprom_parse_mac(struct ipw_priv *priv, u8 * mac)
@@ -9946,19 +9979,45 @@
return 0; }
+#define IPW2200_EEPROM_MAGIC 0x2200
+#define CX2_CHECKSUM 0x0040
static int ipw_ethtool_set_eeprom(struct net_device *dev,
struct ethtool_eeprom *eeprom, u8 * bytes)
{
struct ipw_priv *p = ieee80211_priv(dev);
- int i;
+ u8 wordoffset;
+ u16 w;
+ int i;
+
+ if(eeprom->magic != IPW2200_EEPROM_MAGIC)
+ return -EINVAL;
if (eeprom->offset + eeprom->len > IPW_EEPROM_IMAGE_SIZE)
return -EINVAL;
+
+ wordoffset = eeprom->offset / 2;
+
+ /* TODO ethtool currently supports writing only 1 byte,
+ * take eeprom->len into account */
+
+ if (eeprom->offset % 2 == 0) /* LSB */
+ w = (p->eeprom[(eeprom->offset)+1] << 8 ) | *bytes;
+ else /* MSB */
+ w = p->eeprom[(eeprom->offset)-1] | (*bytes << 8 ); down(&p->sem);
+ eeprom_write_u16(p, wordoffset, w); memcpy(&p->eeprom[eeprom->offset], bytes, eeprom->len);
- for (i = IPW_EEPROM_DATA;
- i < IPW_EEPROM_DATA + IPW_EEPROM_IMAGE_SIZE; i++)
- ipw_write8(p, i, p->eeprom[i]);
+ if (wordoffset > CX2_CHECKSUM / 2) {
+ p->eeprom[CX2_CHECKSUM] = 0;
+ p->eeprom[CX2_CHECKSUM+1] = 0;
+ for (i = CX2_CHECKSUM+2; i < IPW_EEPROM_IMAGE_SIZE; i+=2) {
+ p->eeprom[CX2_CHECKSUM] ^= p->eeprom[i];
+ p->eeprom[CX2_CHECKSUM+1] ^= p->eeprom[i+1];
+ }
+ eeprom_write_u16(p, CX2_CHECKSUM/2, (p->eeprom[CX2_CHECKSUM+1] << 8 ) | p->eeprom[CX2_CHECKSUM]);
+ IPW_ERROR(”New EEPROM Checksum %04x “, (p->eeprom[CX2_CHECKSUM+1] << 8 ) | p->eeprom[CX2_CHECKSUM]);
+ }
up(&p->sem);
return 0;
}

diff -u linux-2.6.16/drivers/net/wireless/ipw2200.h linux-2.6.16.new/drivers/net/wireless/ipw2200.h
— linux-2.6.16/drivers/net/wireless/ipw2200.h 2006-03-20 07:53:29.000000000 +0200
+++ linux-2.6.16.new/drivers/net/wireless/ipw2200.h 2006-03-24 21:15:47.000000000 +0200
@@ -1583,6 +1583,13 @@
#define EEPROM_BIT_DO (1<<4)
#define EEPROM_CMD_READ 0×2
+#define EEPROM_CMD_WRITE 0×1
+#define EEPROM_CMD_EWEN 0×0 /* write/erase enable */
+#define EEPROM_CMD_EWDS 0×0 /* write/erase disable */
+
+/* these latter two are distinguished by two upper bits in address */
+#define EEPROM_CMD_EWEN_ADDR 0xC0
+#define EEPROM_CMD_EWDS_ADDR 0×00 /* Interrupts masks */
#define IPW_INTA_NONE 0×00000000

Now that the kernel is patched with this patch, configure it, but be very careful to configure both ipw2200 and ieee80211 as modules and _not_ compiled into the kernel. Compile and install the kernel as usual. Also download IPW2200 firmware and place it into /lib/firmware/.

Turn off your computer and prepare for hot insertion of the card - remove the miniPCI slots cover, insert your IPW2200 card into the slot, attach the antennae and then eject it from the slot, but leave it just there. Turn on the computer and press “Esc” to get into GRUB bootup menu. At this point turn over your computer and insert the IPW2200 card into the slot while the computer is still running. Be very careful about static electricity and try not to touch any contacts - you can easily fry your notebook if you do something stupid here. When the card is inserted, boot your new kernel.

The card should come up normally. The main check at this point is running “iwconfig” (all commands as root) to see which interface is your wireless card (it was “eth1″ for me, substitute “eth1″ for your interface name further on if you have a different one) and then running “ethtool -e eth1″ to see a hex dump of the EEPROM of the WiFi card. If you get only bunch of zeros, then something is wrong there - maybe your firmware does not match with your driver version. Save the hex dump to a file - you might need it if you do something wrong with it later.

Now it is the time to actually change the data in EEPROM. The commands to get a HP approved European version of IPW2200 card


ethtool -E eth1 magic 0x2200 offset 0x8 value 0xf6
ethtool -E eth1 magic 0x2200 offset 0x9 value 0x12
ethtool -E eth1 magic 0x2200 offset 0xa value 0x3c
ethtool -E eth1 magic 0x2200 offset 0xb value 0x10

To get HP approved USA version of IPW2200


ethtool -E eth1 magic 0x2200 offset 0x8 value 0xf5
ethtool -E eth1 magic 0x2200 offset 0x9 value 0x12
ethtool -E eth1 magic 0x2200 offset 0xa value 0x3c
ethtool -E eth1 magic 0x2200 offset 0xb value 0x10

At this point it should be safe to reboot your system with the card inside and the BIOS error should be no problem for you any more. Once a card has been altered this way it can be used in any HP notebook in any OS.

However if you are like me then another stumbling block will be in your way: Kill switch. HP nx6110 has a switch in BIOS that permanently switches off miniPCI WiFi. The drives sees that as hardware kill switch. And of course I had to spend an hour until I figured that I had disabled that option in the BIOS “to save a bit of power” several months ago.

To gain some extra geekness points you should also download and compile the newest versions of ieee80211 and ipw2200 driver with the newest firmware, but remember that you will need to erase the modules that you built from your kernel tree and also comment out some options in few kernel config files. The installation docs of ipw2200 have all the details on that. And also do not forget to get a newer version of the firmware to go with those drivers.

After I had done all those manipulations and also enabled ipw2200 drivers led option I gained fully functional WiFi card with fully functional LED indication and working software kill switch - I press the WiFi button and the radio goes off (along with the indicator LED), I press it again and the LED starts blinking and when the card associates with an access point the LED lights up fully in its great wireless glory.

If your IPW2200 minPCI card still does not work, then check again if you have the firmware in place and then see what “dmesg” says to you after you tried to load the drivers.

HP, this is really not nice at all!

Popularity: 53% [?]