Top Nav

Archive | Scripting

nodejs Install Via NVM On Shared Hosting

Node can be installed on a shared hosting account if you have SSH but no root access. Using Node Version Manager (NVM) makes it easy to install and manage different node versions.

Here’s the NVM project page:

https://github.com/creationix/nvm

To install get the curl or wget command from here:

https://github.com/creationix/nvm#install-script

Will be something like:

The install may advise you to create or update your .bash_profile with something like:

Immediately after install you may need to run:

Now you can use NVM to:

List available node version:

Install node version:

List locally installed version:

Use node version:

Set the default version:

0

Get IP Address In A Script

Recently needed a good way to fetch the IP address of each interface within a script. Tried things like:

and

But this is fairly ugly. So I tried:

This gives a list of IP addresses but they are un-ordered so I can’t guarantee which address goes with which interface.  Here’s one using “ip addr”:

Still very messy.  Finally, found the “ifdata” command which is part of the “moreutils” package. First make sure “moreutils” is installed with:

Now you can query for a wide range of different information:

So here are some examples:

Overall this is much cleaner and more reliable then the earlier approaches.

0

Magento SUPEE-7405 Parse Error

Applying the new SUPEE-7405 patch to Magento 1.7.0.2 (and probably other versions) results in a parse error in the sales order view page (admin/sales_order/view/order_id) if the site is running under PHP5.3. Here’s the error message:

The offending line is:

it can be changed to:

PHP 5.3 does not support the “[]” syntax for array initialization. Of course you should not be running PHP 5.3!

0