Skip to content


Remote Desktop hangs on ‘Configuring remote session’?

Recently I’ve experienced some problems with RDP when connection from Windows 7 machine to Windows XP. As I googled around I found that not only I was stuck at ‘Configuring remote session’ message. I’ve found few solutions but none of them worked for me. Finally I managed to solve my problem and decided to create this post for anyone that has similar problems.

Possible solutions

As far as I know there are three reasons why RDP client might not be able to connect to other machine and hang on ‘Configuring remote session’:

  • disable sound – there’s some glitch with sound card drivers and default RDP client in Windows (more on it here). Just disable sound in Show Options -> Local Resources -> Remote Audio -> Settings
  • disable local drives – sometimes local CD / DVD drive might cause the same thing (mentioned here). To disable it go to Show Options -> Local Resources -> Local devices and resources -> More -> disable anything You don’t need
  • constant bitmap caching setting – it was what prevented me from connecting to some (not all!) machines. To disable it go to Show Options -> Experience and deselect Persistent Bitmap Caching.

If You know any other solution share it in comments!

Posted in Uncategorized.

Tagged with , , .


How to download legit Windows XP iso

Disclaimer: I bought original Windows XP Professional and have rights to use it. I don’t encourage anyone to use illegal copies of Windows.  If You’re like me and can’t recover installation disk – read on.

Today I found out that it’s impossible to download legit-ish (i.e. hosted by Microsoft)  installation disks of Windows XP. Some time ago they were available for download from Microsoft.com, but not anymore. Unfortunately I can’t upgrade to Windows 7 and I have to re-install Windows XP 64 bit due to hard drive failure. Needles to say I don’t have installation disk (again, I do own license for Windows XP Profesional).

After some research I came to conclusion that You can get legit disk from:

  • Your friend (if he has one),
  • torrents/rapidshares and like.

Unfortunately for me neither of my colleagues had original 64 bit disk. Therefore I had to revert to torrent.

Malware, spyware and all other nasty *ware

The problem with ISOs downloaded from torrents is that You’re not sure if it hasn’t been altered by hacker who wish to know Your credit card number or email account password. Fortunately You can compare MD5/SHA1 of legit installation disks with the ones You’ve downloaded from torrent. If they match You may safely use them.

MD5/SHA1 checksums of legit Windows XP installation disks

Volume Label: ARMPXFPP_EN
File: en_win_xp_pro_x64bit.iso (Original Retail with SP1)
CRC-32: ffffffff
MD4: 70349c6d260588cbbe0be3cbcdab3b43
MD5: dd0e2bee5cfa064650a01bed663253ed
SHA-1: 11db0fd0dce5fb9295150f2f4e50ff5c99e670ae

Volume Label: ARMPXOEM_EN
File: ARMPXOEM_EN.ISO (Original OEM with SP1)
CRC-32: ffffffff
MD4: 31993981a3471344f0851a4c0e4c946f
MD5: 2d6100c15d3b7527592bdf0c1642c5ed
SHA-1: 0eb0b448ed96960ad2151f84dd548877e4e10f76

Volume Label: ARMPXVOL_EN
File: en_win_xp_pro_x64_vl.iso (Original VOL with SP1)
CRC-32: ffffffff
MD4: dc8eaddc69f15200fd798bf65511457f
MD5: 5bbaf6c26b558a8f70de8150be4f6f22
SHA-1: 2486edd2cf307a451d02e76fbf6f42a3cd2d698f

Volume Label: AX2PXVOL_EN
File: EnglishWindowsXPProfessional64bit.iso (Original VOL with SP1 & KB911164)
CRC-32: ffffffff
MD4: b9205e34b32dbcfb7f1ff2f3b51f315b
MD5: a2fd5aee7719466bcf091c5adb8a65b3
SHA-1: a70b118316a9a451b966a082e7c1dd0e8018718d

Volume Label: CRMPXVOL_EN
File: en_win_xp_pro_x64_with_sp2_vl_X13-41611.iso (VOL with SP2)
CRC-32: ffffffff
MD4: ddc705c6a7a253e1b170c08f3b0553f9
MD5: 33a35e7544201ea47fee6cac6a52153b
SHA-1: cd9479e1dbad7f26b8bdcf97e4aa71cbb8de932b

At least those I came across.

Posted in Uncategorized.


Free trial fail or why I haven’t registered for SEOmoz account yet

I just started to learn about SEO and I’ve been visiting SEOmoz site for a month or so. I’ve read beginners guide and other articles and I want to learn more!  SEOmoz 30 day free trial that gives access to all neat tools seemed at first great deal to me. Free trial period should (in theory) convince me to register with them and after my trial is over subscribe to $99/month plan. That’s what SEOmoz hopes for (probably;) ).

However, I have to say that free trial prevents me from signing up for full package and I haven’t even used it! Why? Because the free trial period seems too valuable!

Since I’m just starting in SEO I suspect that within 30 days I won’t be able to use 10% of SEOmoz tools appropriately. $99 seems much to me and I want to use this free trial as effectively as possible, thus I delay moment of registration further and further. I just don’t want to loose something I perceive valuable before I can make full use of it. It’s like loosing $99 to me.

I think that if there was free account with very limited set of tools or very basic pricing plan (like $19.99/month) I would register long time ago and maybe signed up for $99 plan already.

It’s ridiculous situation – SEOmoz gives something useful for free but I won’t take it because it seems too valuable. When I thought about it for a while I realized that it’s not the first time I was in this kind of situation. Sometimes I postpone use of discount coupons because I save them for big shopping. In the end however I never use them.

Have You ever resigned from something free because  it seemed to be worth too much to use it?

Posted in SEO.

Tagged with , , , .


Java: When executing null.method() does not throw NullPointerException

What will happen when following code is executed in Java?:

((A)null).x();

The obvious answer is that java.lang.NullPointerException will be thrown. But amazingly it’s not always true! if x() is static method on class A then null is ignored and method x() is invoked. You don’t believe it? Try it Yourself:

public class A {
    public static void main(String[] args) {
        ((A)null).x();
    }

    public static void x() {
        System.out.println("Hello World!");
    }
}

Personally I was sure that NPE will be thrown but after a while it seems reasonable – after all You don’t need actual instance of class to invoke its static method.

And yes, it’s actually useful! When? Imagine static class with Your custom toolset:

public class Tools {
    public static void a() { System.out.println("a()"); }
    public static void b() { System.out.println("b()"); }
    public static void c() { System.out.println("c()"); }
    public static void d() { System.out.println("d()"); }
}

Tools.a();
Tools.b();
Tools.c();
Tools.d();

Almost every program has that kind of class (frequent examples are: String and Collection manipulation). Unfortunately it’s not very pretty code, it’s much more convenient to write and maintain:

public class Tools {
    public static Tools a() { System.out.println("a()"); return(null); }
    public static Tools b() { System.out.println("b()"); return(null); }
    public static Tools c() { System.out.println("c()"); return(null); }
    public static Tools d() { System.out.println("d()"); return(null); }
}
// ....
Tools.a().b().c().d();

Check if Your friends know that trick.

Posted in Java.

Tagged with , , , , , .


Installing Zen Cart 1.5.0 on MemSQL

There’s a lot of fuzz about MemSQL lately – it promises great performance compared to MySQL and sensible compatibility. So, I decided to give it a try and install newest Zen Cart on it. Okey, I admit – this post is rather simple statement that “Yes, You can install Zen Cart on MemSQL” rather then lengthy guide on how to do it. Why? Because installation on MemSQL is just as simple as regular installation on any other MySQL. In fact the user that installs Zen Cart on MemSQL does not see any difference from installing it on MySQL. So let’s tart:

Get MemSQL

Go to http://memsql.com/#download and fill out download form. MemSQL is free for testing purposes and as far as I know for databases smaller than 10Gb (but I might be wrong so read their license). After You submit the form You should receive instructions on Your email with download link like:

Part of email from MemSQL

Follow the instructions and get binary package with MemSQL, extract it and  run:

cd memsqlbin
./check_system

to verify that Your server is capable of running MemSQL (requires 64 bit version of linux, 8GB of memory is advised but not required). After that You can start MemSQL deamon:

./memsqld --port 3307

It starts memsqld process on port 3307 as 3306 is taken by MySQL. Congratulations, Your MemSQL server is up and running!

Install Zen Cart

I won’t go into too much detail about installing Zen Cart as whole process does not differ at all from regular Zen Cart installation. Just change port number on database configuration screen from 3306 (Your MySQL server is probably running there) to 3307. That’s really, really it!

I played with stock installation of Zen Cart 1.5.0 for a while and haven’t encountered any errors or odd behavior. It seems that MemSQL is compatible with MySQL but it is also too soon to rush and throw away Your old MySQL installation and move to MemSQL. Further testing is required to use it on production server.

Few things to keep in mind

Not all features of MySQL are supported. However when it comes to Zen Cart there’s only one obstacle: MemSQL runs only on UTF-8 character set so You might need to convert to it.

Here’s list of yet unsupported features (taken from http://developers.memsql.com/docs/1b/unsupported.html):

  • Views
  • Prepared Queries
  • Stored procedures
  • User Defined Functions
  • Triggers
  • Foreign keys
  • Charsets other than utf8

Zen Cart does not use any of above features by default so there shouldn’t be any problems with installation of it.

Please let me know in comments if You tested ZC on MemSQL.

Posted in Uncategorized.


Speed up Zen Cart: Using MEMORY storage engine to cut I/O load on MySQL database server

Memory storage engine (as its name suggests) stores data in database server memory rather than on disk. Disks are slow, memory is fast. So advantages of MEMORY storege engine over any other disk based storage engine are clear:

  • reads (SELECT statements) are much faster
  • writes are faster too (thanks to InnoDB log buffers not as much as You might think though)
  • because writes and reads are done to and from memory there’s no I/O access
  • hash indexes are supported (primary key lookups are fast!)

There are some disadvanteges too:

  • data stored in MEMORY table is lost on server shutdown
  • currently MEMORY storage engine supports only table level locking
  • unless You’re using Percona Server 5.5 only fixed row format is supported
  • due to above only Percona Server 5.5 supports BLOB and TEXT fields on MEMORY storage engine.

On server shutdown or crash all data in MEMORY table is lost. Wy would anyone need to store data that.. uhm.. does not need to be stored? As it turns out there are situations in which data needs to be saved for a while and it’s not a big thing if it suddenly vanishes. One such application is handlig of visitors sessions – We certainly need to store them somewhere but if our database server crashes nothing bad will happen (without database server Your site most probably is offline anyway). Sessions and various counters are responsible for a lot of database I/O load – each request most probably reads at least one sessions record and writes one session record. So let’s switch to MEMORY storage engine!

Switching to MEMORY storage engine

Zen Cart uses two tables that are ideal candidates for using MEMORY engine: whos_online and sessions. Switching whos_online to MEMORY is very easy and can be done with one line of code:

ALTER TABLE whos_online ENGINE = MEMORY;

Voila! You just offloaded Your database server quite a bit. Unfortunately with whos_online situation is bit more complicated due to fact that it uses BLOB column to store session data and BLOBs are not supported in MEMORY engine in current MySQL release (5.5). To switch sessions to MEMORY engine You will need Percona Server >=5.5. (which I recommend to use anyway as it’s much better than regular MySQL server). Assuming You do have Percona Server 5.5 You can change sessions table as easily as whos_online:

ALTER TABLE sessions ENGINE = MEMORY;

Well, You can use MEMORY on sessions table with one little trick: change type of column sessions.value from MEDIUMBLOB to VARBINARY(65535) to get rid of BLOB type column. Unfortunately it has major consequences: ZenCart does not guarantee that 65kb of binary data for session will be enough (though it’s unlikely that session related data will exceed 4kb), and MEMORY will use whole 65kb of data to store each row in the sessions table. If You have 100 visitors at any given time it’ll take 100*65kb = 6,5Mb of memory instead of optimal 100*2kb = 200kb (assuming average session data size of 2kb). That’s a lot of wasted memory!

If for some reason You can’t use MEMORY storage engine and You still use MyISAM for whos_online or sessions tables switch them to InnoDB now!

Caveats

You should be aware of few things. First of all amount of memory dedicated to MEMORY storage engine is limited by MySQL variable max_heap_table_size. By default it’s set to 16MB and those 16MB are divided among all MEMORY based tables. You must keep in mind that total size of all of Your MEMORY tables must be well below max_heap_table_size to take into account possible spikes in amount of data stored in them, for example due to website traffic spikes. Fortunately You can change max_heap_table_size in Your my.cnf configuration file.

Second, if You constantly insert rows into MEMORY table You must also remember to purge it from time to time. Fortunately Zen Cart does that for us when it comes to sessions and whos_online tables. As alternative You can also use either cron script or MySQL CREATE EVENT to purge MEMORY table from time to time. Here’s example of such event:

DROP EVENT IF EXISTS PURGE_MEMORY_TABLES;

DELIMITER $$

CREATE EVENT PURGE_MEMORY_TABLES 
ON SCHEDULE 
EVERY 1 MINUTE
ON COMPLETION PRESERVE
DO BEGIN
    DELETE FROM whos_online WHERE time_last_click < (UNIX_TIMESTAMP() - 15 * 60);
    DELETE FROM sessions WHERE expiry < (UNIX_TIMESTAMP() - 15 * 60);
END$$

DELIMITER ;

Make sure that MySQL event scheduler is running:

SHOW variables;

Search for `event_scheduler`(it should be ON). If it’s OFF You’ll need to add

event_scheduler = ON

in Your my.ini (usually /etc/my.ini) file. You can also turn it on (until server shutdown) by:

SET GLOBAL event_scheduler = ON;

There are some other things You might want to know about MEMORY engine. I recommend reading MySQL documentation: http://dev.mysql.com/doc/refman/5.0/en/memory-storage-engine.html

Posted in Performance, Zen Cart.

Tagged with , , , , .


Links to Query Cache, Query Log, UTI and others

Unfortunately it seems that backup of my site is gone. Here’s quick list of links to my modules:

 

Posted in Change Storage Engine, Query Cache, Query Log, Randomized Tests, UTI, Zen Cart.


Useful Zen Cart initsystem breakpoints

 

Here’s list of useful Zen Cart breakpoints found in includes/auto_loaders/config.core.php:

  • breakpoint [0]:
    • $zco_notifier is created
  • breakpoing [10]:
    • database connection is made
    • $db object is created (You can access database now)
  • breakpoint [40]:
    • configuration table is read
    • configuration constants are defined
  • breakpoint [70]:
    • sessions are initiated
  • breakpoint [80]:
    • $shoppingCart is created
    • $navigation is created
  • breakpoint [90]:
    • $currencies is created (but init_currencies are not yet executed until breakpoing 120!)
  • breakpoint [110]:
    • init_languages script is executed
  • breakpoint [120]:
    • $messageStack is created
    • init_currencies is executed

What’s that for? If You use breakpoint system to init Your own script (if You’re a Zen Cart developer You most probably are) You have to make sure that You don’t use for example $messageStack before it’s created. So calling $messageStack at breakpoint level 40 has no sense.

Posted in Zen Cart.


Advanced Zen Cart performance tips

Here’s list of not so obvious tips for Zen Cart/osCommerce and probably most osCommerce clones:

  1. Get rid of products_viewed stats gathered in products_description table,
  2. Change storage engine of whos_online, counter and sessions tables to MEMORY,
  3. If You have thousands of images take a closer look on time needed to open folder with those images. Zen Cart open directory with images quite often and it’s quite probable that it takes considerable amount of time. Opening directory with few thousand images may even take few seconds. Solution: use tree structure of directories (more on that soon… or someday ;)

Get rid of products_viewed stats to enable query cache

Zen Cart updates products_description table EACH time any product is viewed. It causes native MySQL query cache to NOT cache ANY queries regarding products (well, almost). Also it causes a lot of writes to database and it may slow down Your database server as much as 10-30% (real life scenario!). Just edit

/includes/modules/pages/product_info/main_template_vars.php

and remove the line with the update ( it should be line 39-42)

$sql = "update " . TABLE_PRODUCTS_DESCRIPTION . "
            set        products_viewed = products_viewed+1
            where      products_id = '" . (int)$_GET['products_id'] . "'
            and        language_id = '" . (int)$_SESSION['languages_id'] . "'";

Change engine of whos_online, counter, sessions tables to MEMORY

Change storage engine of whos_online, counter tables and sessions (requires Percona MySQL due to MEDIUMBLOB field in sessions table) tables to MEMORY storage engine. Again, it can save You up to 30% of database server load. Yeah, data is lost on server shutdown but who cares? You won’t loose anything important or anything that is not lost anyway (customers will leave Your site anyway if Your database server is gone).

Posted in Performance, Zen Cart.


And I’m back! Sort of…

Old posts are gone, at least for now. I have backup of the blog somewhere but due to “not enough time” issue it’ll take a while to recover old posts. Meanwhile… I have some ideas I want to share with You so stay tuned.

Oh, and If You’re looking for Query Cache for new ZenCart – it’s not yet done, sorry! If You really, really, really need it please contact me at data-diggers@data-diggers.com.

Posted in Uncategorized.