Tuesday, December 27, 2011

Installing nodeJS on debian lenny.

This article describes what I did to compile and install nodejs on debian lenny running at linode.

The following is not directly related to node.js but happened while I was working on this installation so here, maybe it will help someone:

For some reason, apt-get did not properly work for me,
the first thing was that I did not have curl installed but tring to install it did not work.

to make a long (very long) story short, turns out I was unable to install curl because I had a problem with the PGP keys for the debian archives.

This comment was the one that led my to:
aptitude install debian-keyring debian-archive-keyring.
following this fix and a successful apt-get update I was able to run
apt-get install curl

so, to get build and install node.js you run the following commands:

apt-get install python
apt-get install curl build-essential openssl libssl-dev

cd /usr/local/src
wget http://nodejs.org/dist/v0.6.6/node-v0.6.6.tar.gz
tar -xzvf node-v0.6.6.tar.gz
cd node-v0.6.6
sudo make install

There, you should now have node.js installed.
create yourself a folder for the scripts you plan to write.

if you need access to mysql from your scripts I recommend you use npm (node package manager) :

npm find mysql
npm install mysql

please note that this will install the mysql modules under node_modules folder under the current directory so that you can use mysql=require('mysql') in your scripts.

good luck and enjoy.

Wednesday, November 16, 2011

Reserved share names on ReadyNAS

Did you happen to try and create a share on your readNAS and get the following error:

Invalid name or illegal characters detected in name. Name is limited to alpha-numeric, underscore _, dash -, dollar sign $, and period characters, andmust start with an alpha character. Name cannot contain ''-snap'' and name cannot be used by an existing user account.

Turns out the reason is that some names are just "reserved"
from the post here:

it seems to be the case with "sys" and from personal experience its also the same with "mysql".


says that "images" is also reserved.

Monday, October 10, 2011

Lock, Lock - Who is there? ...

I have been trying to rename a table on a mysql DB and kept getting:

Error Code: 1192
Can't execute the given command because you have active locked tables or an active transaction

I used

and was able to reduce it to only 2 lines (one of which is the one trying to run the rename).

then I used kill with the id of the other connection and now I have only my own connection.
but still

Error Code: 1192
Can't execute the given command because you have active locked tables or an active transaction

show open tables returns an empty results set.

Finally I gave up.
restarted the mysql service and the rename worked just fine.

Wednesday, July 20, 2011

The function parameter for javascript Array.Sort

I guess If you are reading this you already know that javascript's Array.sort function can take a function parameter.

Did yo ever wander what exactly should this function return ?

well its simple:
This function (which should take two elements from your array) f(e1,e2) should return:
  • any negative number to indicate that its first parameter should appear before (have a smaller index) the second parameter in the sorted array .
  • zero if you are indifferent to the order in which those two elements will appear in the sorted Array
  • any positive number to indicate that its first parameter should appear after (have a larger index) the second parameter in the sorted array .
Using this info you could even sort mixed type arrays and do multilevel sorting (e.g. sort by date and alphabetically within the date).

Sunday, June 05, 2011

CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 4.3'

I have been getting this error myself and found this helpful post:

but since I am using xcode 4 I wanted to add the guidelines for doing the same on xcode 4 so here goes:
1. on the project navigator (left most gray icon that looks like a folder) click your app
2. on the main pane that opens click "build Settings" at the top
3. scroll down the main pane until you reach "Code Signing Identity" and go on and
select the right code signing identity.


Monday, May 16, 2011

solved:Hardware virtualization activated in bios but still does not work

If you happen to need hardware virtualization you might encounter what I have.

I went to the BIOS, changed the settings of Intel-VT to enabled, rebooted and VMWare still insisted that hardware virtualization is disabled.

turns out that a reboot is not enough...

you must POWER DOWN your computer after making this change in the bios,
only then will it recognize that hardware virtualization is active.

I hope this will help some one some time.
feel free to say I if it helps you anytime in the future.Publish Post


Monday, March 21, 2011

7-zip and archives that contains files with non-English file names

after reading this in the 7-Zip revision history:

- Unicode (UTF-8) support for filenames in .ZIP archives. Now there are 3 modes:
1) Default mode: 7-Zip uses UTF-8, if the local code page doesn't contain required symbols.
2) -mcu switch: 7-Zip uses UTF-8, if there are non-ASCII symbols.
3) -mcl switch: 7-Zip uses local code page.

I change the link 7-Zip File Manager to use -mcu.

Things now work much better.

Wednesday, March 09, 2011

Hebrew (utf8) characters in mysql console over putty


I have a mysql server running on a debian linux hosted at linode.com some of my data has hebrew characters (utf8) in it.

I am connecting to the server via putty ssh on windows 7.

But when I run the sql admin console (mysql) and execute a select query all hebrew characters are displayed as '?'.

The data itself wass o.k. (I know this because it is also accessed via a web page where it displays just fine).


Step 1. Start mysql with the --defautl-character-set=utf8

If you will now run a query it will properly display the hebrew (and even show it right to left). Only problem is that because of this tables get poorly formated and columns switch places when hebrew is displayed in some of them.


Step 2. Go to the session settings of putty and check "Disable Bidirectional text display" under Terminal-Features.

This will now cause Hebrew to be displayed using Hebrew characters but from left to right. But at least to formatting of the results is readable.

I guess a fix for this could be to render the Unicode Character 'LEFT-TO-RIGHT MARK' (U+200E) before each " |" (Pipe) character that separates column results. I wander if this can be customized...

Monday, March 07, 2011

Sunday, February 13, 2011

Steps in installing a smaple Magento

This is a list of steps needed in the process of installing a sample magento site.

I will be assuming that you have WAMP / LAMP already installed.

  1. go to http://www.magentocommerce.com/download and download magento and the magento smaple data. (versions don't need to match - actually the sample data is from 2008 at the time of writing).
  2. deploy the content of the magento installation to a magentoVirtualRoot directory on you web server
  3. create an empty database (e.g. magento_db)
  4. add the files in the media folder from the sample data to those from the magento installation
  5. make sure you set up and required new hosts / DNS entries if such are needed.
  6. copy the sql text from the sample data into the sql tab of your mysql's phpadmin for the database you created on step 2 and execute it.
  7. ONLY AFTER STEP 5 IS DONE - go to your browser and surf to http://www.yourdomain.com/magentoVirtualRoot and complete the installation proccess.
  8. go to http://www.yourdomain.com/magentoVirtualRoot/admin or whatever url you assigned for the backend and go to system-index management and reindex all your data.
  9. go to the front end of you new smaple shop at http://www.yourdomain.com/magentoVirtualRoot and enjoy.
please not that some steps are not mandatory and some details might have been left out, if you think I left out something really important, feel free to comment.

Clicky Web Analytics