Wednesday, August 25, 2010

Magento On The Move

I like to keep my personal development environments on a USB drive, because i spend a lot of time on computers other than my own (mostly because of business trips).

So I felt the need to try to create a Magento portable environment.

This is as simple as using EasyPHP. It contains Apache, PHP, MySQL and phpMyAdmin.
It is by itself portable, so all you need to do is copy the root folder to your USB drive. When run, it detects that it was launched in a different directory and updates all configuration.

If you want to develop as well as having a running copy, all you need to do is to download Eclipse for PHP. It can be run on the USB drive as well.

Tuesday, August 24, 2010

On The Move

I like to keep my personal development environments on a USB drive, because i spend a lot of time on computers other than my own (mostly because of business trips).

Also you never know when you'll need some tools on a computer with no internet connection, or where you can't install software.

So I use Portable Apps ().

To be even more portable, I download only the applications and extract the the USB drive, so no PortableApps executable necessary.

But I also carry installations to some of the applications I consider essential in case I need to share them (as with family asking to the IT guy to fix something).

Here are some of my toolkit apps:

- ARDC Data Recovery Tools (Data Recovery Tools);
- AVG (Anti-virus);
- Combined Community Codec Pack (Codec Pack);
- daemon408-x86 (ISO reader, but can't install on Win7 :( );

- KeePass (Password Database) ;
- GIMP (Image Editor);
- Notepad++ (Text Editor);
- PeaZip (Archive Manager);
- SumatraPDF (PDF Viewer);
- VLC Video (Video Player);

[Runs without Installation]
- ExamDiff;
- Reflector (.NET);

Android On The Move

I like to keep my personal development environments on a USB drive, because i spend a lot of time on computers other than my own (mostly because of business trips).

So I felt the need to create an Android portable environment.
You can't build this environment on-the-fly, that is, without an initial installation. Most software will be 'stolen' from their original locations.

Sadly, i still only work on Windows (to lazy to spend more time on Linux), so i probably won't be able to help if you need to do the same on Linux (but probably it's not that different from what I did).

So here are the steps I managed so far:

1 - JDK
I'm using jdk1.6.0_20 (the latest at the time). I've downloaded and copied the jdk1.6.0_20 folder to my USB drive. A copy will be enough, after a little configuration.

2 - Eclipse
I'm using 3.5 (Galileo). Also just needed a simply copy of the root folder to the USB drive.

3 - Android SDK
I'm using revisions 6 (for Eclair) and 7 (for Froyo). You should download all the targets necessary before copying the folders. Then, you'll need to copy the root folder (android-sdk-windows) to your USB drive.

4 - AVD (Emulators)
To debug we need an emulator that will run our app. Unfortunately, it needs to be created beforehand on a fixed environment. So, all we have do is to copy the *.avd folder to our .android/avd folder.
AVD uses .ini files to configure target platform and installation path. As this has to be a full path and can't have shell variables, I chose to reconfigure that path in the batch file used to start-up eclipse.

5 - Batch file
To boot the environment we need to indicate to eclipse where to find the virtual machine and the sdk tools. So I start my environment with this script:

REM Updates AVD path config
type "%CD%\.android\avd\[sample].ini" | find /v "path=" > "%CD%\.android\avd\[sample].tmp"
copy /y "%CD%\.android\avd\[sample].tmp" "%CD%\.android\avd\[sample].ini"
echo path=%CD%\.android\avd\[sample].avd>>"%CD%\.android\avd\[sample].ini"
del "%CD%\.android\avd\[sample].tmp"

REM Defines Android home directory (defaults to the users' home directory)

REM Defines path to swt.jar (not sure if necessary)
SET ANDROID_SWT=%CD%\android-sdk-windows\tools\lib\x86

REM -data "." defines the workspace path to load
REM -vm defines the path to the virtual machine
.\eclipseJava\eclipse.exe -data "." -vm".\jdk1.6.0_20\bin\javaw"

This should be enough to allow you to take your Android developments everywere.

RIP to the laptop

Recently my laptop died of accute graphicus boardatis burnum.

After 2 and a half years (just after the end of the warranty - thank you Mr. Murphy!) my ASUS A7Sv stopped working.
For some time I could observe that it could get extremely hot, and the fan was always at full speed.
My suspicions fell on the graphics board, so I dig up a little.

Seems like lots of people have been complaining of burned NVIDIA 8600m (my graphics board). Apparently it is a chipset error extending to some models (

Now I have a very big brick (17" Wide to show how big), just because of a single component. How i miss a good desktop board swapping...

As a temporary solution I'm using another laptop that is missing a monitor (I still don't know how my brother managed to break it!), connected by VGA to my old (old, old, old) 14" CRT with very dark images (it can make eyes hurt...).

Now what to do for a new machine?
A new top-of-the-line laptop that might suffer the same fate (as another reference to Mr. Murphy)?
A notebook that can barely run any of the software I use?
A desktop that I can't carry around (yes, I have a lot spare time away from home where i could use a computer)?

When to come a laptop with swappable graphics board?

After toying with my ASUS (I tried to evaluate the possibility of swapping graphics board), I lost the use of the monitor (it's filled with stripes of several colors, but it's better than the black screen I had before), but i can use an external monitor.
I don't know much about electronics, but it seemed like the board had two cores for graphics. Maybe that other core is responsible for the output to the external monitor...

Didn't try for much time, but maybe I could end up having two 'half' laptops.
First it's better to buy a cooling pad.

Friday, August 20, 2010

My Arduino Hello World!

I finally got to try out my Arduino.
I decided to follow the 'Array' sample, on which Arduino lights up some LEDs in a sequence.

So, I altered the source a bit to make my 'Hello World' as a 'KITT Sequence'.


I know it's not much but it's a start...

Friday, August 13, 2010

Configure Multiple Magento 1.4.x Websites on same server

It took a while to do this, as I know too little about Magento or Apache, but here is what I did:

- Create websites in Magento Admin (remember the codenames as they will be used later);
- Create Stores and Store Views to each website (you will need them for the final test);
- Configure {{Base_Url}} for each website ([will complement with images])
- Create hosts to your servers' IP address on your DNS Server (ex.:,;
- Access httpd.conf to create a VirtualHost for each Website (ex.:
#IP:PORT as in 'NameVirtualHost'
DocumentRoot "c:\wamp\www" #Location to www or alias folder
ServerName #Server's Domain Name for the WebSite
SetEnv MAGE_RUN_CODE "base" #Website/store codename
SetEnv MAGE_RUN_TYPE "website" #website/store


Now you should be able to access each frontend on each address.

Wednesday, August 4, 2010

HTC Desire Android 2.2 OTA

I finally received Android 2.2 for my HTC Desire.

As no upgrade will run perfectly (must be a Murphy's Law), here are the problems i've encountered:

- Google Contacts updated automatically, removing all data saved to phone only (a.k.a. private). Should have saved that data as merged contacts;
- Google Market seems slower (probably just to much users at the time because of the upgrade, or slow wi-fi).
- Google Market no longer shows list of apps installed before the upgrade (but they still work, and can be updated/removed if you search for the app) (after installing new app, the full list was restored);
- My Calendar (offline) was removed. Couldn't find a way to create another;

Generally i haven't noticed any differences, besides a few new apps (Flashlight, Location Picker, Hotspot Wi-Fi) and improved UI (Application Manager).

A Saga

Como estava tão entusiasmado quando escrevi o post anterior sobre o Android...

Entretanto surgiram as férias e outros possíveis projectos e lá se foi para último plano.
Para além disso o portátil queimou, por isso as condições de trabalho agora não são as melhores

Há que arranjar um tempinho para voltar a 'subir ao cavalo'!


Surgiu-me a oportunidade de comprar uns LEDs de alto rendimento a baixo preço.

Com 12€, lá vêm 500 azuis... O que fazer agora com tanto material?
O que gostava era de construir uma matriz para programar um jogo, como se vê em tanto tutoriais.

O que falta? Tempo e paciência...

Primeiro Teste

Já chegou o Arduino.

Andei a ver o kit, e tentei fazer um simples circuito com um LED, um potenciómetro e um transformador ligados na breadboard.
Depois de algumas dificuldades lá consegui que funcionasse.

O LED tinha mais ou menos brilho de acordo com o potenciómetro (nível 1 superado).

Agora há que passar para algo mais complexo, até queimar componentes ou vir uma ideia brilhante que me faça programar o Arduino.