Saturday, May 19, 2012

Android - adb devices error device not found

I've been developing some basic android applications.  

After carrying out some testing using the emulator within eclipse I wanted to deploy the app to my phone so I could show to some customers.

You'd think it would be fairly straight forward, not so.  

Anyway  a little problem I came across was when I ran the command 

adb devices

From the platform-tools folder it was showing no devices attached even though I'd connected my phone and I'd set USB debug mode according to the android SDK how-tos.

I also tried to reboot the adb daemon with

adb reboot recovery

Again no joy

Finally I tried the following and it worked

adb kill-server
adb start-server

And finally adb devices listed my phone correctly


Monday, May 7, 2012

Different Domains For Same X-CART Admin Site

Recently I came across a problem where I needed to give users both internal and remote access to the admin features of an x-cart ecommerce site.

Basically in this instance we host the admin portion of the site on an internal server and the actual online store is hosted in two data centres one in Ireland and the other in the UK.

The problem I had, I wanted to use two different domains e.g.



http://intheoffice/admin
http://workingremote.yourdomain.com/admin


The problem with earlier versions of x-cart is that you can only assign a single domain name to the one installation.

To do this you change
$xcart_http_host to point to the domain you wish to use

I was using WAMP on a Windows Server 2003 system

So to get around this, because I was using only the admin portion of the site

I knew the source code for the admin features would not change that often (if at all)

so I created two working directories


c:\webfolder\internal    // this is the directory that will contain code which will be executed from internal browser requests with http://intheoffice/admin



c:\webfolder\external    // this is the directory that will contain code which will be executed from external browser requests with http://workingremote.yourdomain.com/admin


I change the config.php in each code base to reflect the domain I'm serving


c:\webfolder\internal\config.php
$xcart_http_host = "http://intheoffice/admin";

c:\webfolder\external\config.php
$xcart_http_host = "http://workingremote.yourdomain.com/admin";

Then I configure httpd.conf in Apache under WAMP to serve content for different virtual hosts

Something like the following needs to be added

In my instance I was listening on port 8080 but you can use what ever you wish once its not already bound to another services on the windows system.

NameVirtualHost 192.168.0.33:8080


<VirtualHost 192.168.0.33:8080>
ServerName intheoffice

DocumentRoot "c:/webfolder/internal"
<Directory "c:/webfolder/internal">

allow from all
order allow,deny
AllowOverride All
</Directory>
</VirtualHost>

<VirtualHost 192.168.0.33:8080>
ServerName workingremote.yourdomain.com
DocumentRoot "c:/webfolder/external"
<Directory "c:/webfolder/external">
allow from all
order allow,deny
AllowOverride All
</Directory>
</VirtualHost>

Thursday, May 3, 2012

VMWARE Converter to create DR for Workstations In Remote Locations

Recently I've been working on a project that involves creating an easy to use, quick way to rebuild a workstation in the event of a hardware failure.

The environment is very different to your typical network environment in that the following characteristics hold true

1. There is no internet connection on this workstation.
2. The workstations work in a harsh environment on a network segment of their up
3. There is a manual procedure in place to allow you connect the workstation to a central company network where you can access central file shares etc.
4. This environment is replicated throughout the business at several locations each location been isolated as above.

You can use tools like Ghost or Symantec System Recovery however I came up with this easy to use option that meets with the requirements of my client.

Because each machine is an identical build, we have a central computer in head office which hosts all the pre-installed software i.e. Windows 7, business applications, business database etc.

From this we create a VM Image using VMWARE Converter and we save this image to a shared location.

From this shared location we copy this image to a USB drive or other portable storage device.

At each remote location we run Linux as the host operating system on each workstation, with VM Workstation on top

Simply connect in the USB storage device and locate the VM Image already created.

You may need to change configuration details in the VM Image configuration file. For example in our instance software on the system was  bound to specific MAC addresses. You can set these to a manual setting in the VM Image configuration file.

Below is a basic diagram of what it looks like