VirtualBox – Copy Paste Not working (Debian)

Even though you have set bidirectional for the option Shared Clipboard in settings ( under General –>Advanced ) some times it will not work. The following steps fixed this issue for me.

In the guest OS do the following :

  1. update source.list file
  • enable the contrib repositories; e.g. for Debian 8, make sure your /etc/apt/sources.list contains something like
    deb http://ftp.debian.org/debian jessie main contrib

2.  Install guest addition software.


apt-get update
apt-get install virtualbox-guest-dkms

Error processing package nginx

During the installation of nginx using apt repository ie when we use the following command :
apt-get install nginx we may come across some error messages like this,

Job for nginx.service failed. See ‘systemctl status nginx.service’ and ‘journalctl -xn’ for details.
invoke-rc.d: initscript nginx, action “start” failed.
dpkg: error processing package nginx-full (–configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of nginx:
nginx depends on nginx-full (>= 1.6.2-5+deb8u4) | nginx-light (>= 1.6.2-5+deb8u4) | nginx-extras (>= 1.6.2-5+deb8u4); however:
Package nginx-full is not configured yet.
Package nginx-light is not installed.
Package nginx-extras is not installed.
nginx depends on nginx-full (<< 1.6.2-5+deb8u4.1~) | nginx-light (<< 1.6.2-5+deb8u4.1~) | nginx-extras (<< 1.6.2-5+deb8u4.1~); however:
Package nginx-full is not configured yet.
Package nginx-light is not installed.
Package nginx-extras is not installed.

dpkg: error processing package nginx (–configure):
dependency problems – leaving unconfigured
Errors were encountered while processing:
nginx-full
nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)

Fix

Stopping the apache service (or current webserver) before we try to install nginx, would solve this issue. Once we get nginx installed, we can start apache service again.

Hence the following steps are supposed to solve this issue.

1. sudo systemctl stop apache2.service
2. sudo apt-get install nginx
3. sudo systemctl start apache2.service

Install errors with node v4 and v5 #776

While building  a nodejs application (npm install) I came across some weird issues which are in a nutshell as follows.
v8.h:336:1: error: expected unqualified-id before ‘using’,  node-gyp

The nodejs version I was using was v5.10.1 and the reason for this issue was incompatible gcc. and upadating gcc to correct version solved the problems. Following steps are what I did to fix the issue.


sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-5 g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 80 --slave /usr/bin/g++ g++ /usr/bin/g++-5
sudo update-alternatives --config gcc (choose gcc-5 from the list)

Check that the correct versions of gcc and g++ are being used by default by running gcc -v; g++ -v

Oozie – Connection Refused Error on creating sharelib directory on hdfs

Please refer http://anggao.js.org/apache-oozie-installation-on-ubuntu.html

After preparing oozie  war file, we need to create sharelib directory on HDFS file system using the command  (we need to be in oozie home directory)

./bin/oozie-setup.sh sharelib create -fs hdfs://localhost:9000

The above command will internally issue a HDFS create directory command to the Name node running at hdfs://localhost:9000 and then copy the shared library to that directory.

Though we expect everything to be normal, sometimes errors may popup. The error I got was added below.

oozie-error

From the connection error shown on  screen, it is clear that name node at localhost:9000 is not  working. This can be confirmed by typing in terminal :

telnet localhost 9000 

Now I need to confirm the if that was the specified port for name node. This can be done using the command

# first get HDFS info
hdfs getconf -confKey fs.defaultFS

the above command gives the the output hdfs://localhost:9000.                                                              So we  are using correct path and port number

Now into the details of the issue.

The problem is name-node has not been started. So we need to ensure that all hadoop services are running.  Then we need to run the following command from hadoop user home (/home/hadoop for me) jps

This command is expected to give the following result if everything is normal,

2583 DataNode
2970 ResourceManager
3461 Jps
3177 NodeManager
2361 NameNode
2840 SecondaryNameNode
But when I executed the command, NameNode was missing from the result. That is the reason why we are not able to create sharelib on hdfs, Our real problem. So fixing this is the key to our problem.
This can be done as follows:
1. Move to hadoop user home (for me  /home/hadoop)
stop all hadoop services using  stop-all.sh
2. Then reformat name node using
   hdfs namenode -format
3. then restart hadoop all services using start-all.sh(or by specifically runningthe commands  start-dfs.sh and start-yarn.sh)
4.Then issue the command jps
5. If everything is normal will be getting earlier mentioned expected result. If that the case, we can resume with oozie installation. and run the command,
 ./bin/oozie-setup.sh sharelib create -fs hdfs://localhost:9000
But unfortunately, for me data node was missing in jps output. Fixing this issue is a bit tricky.
Before that stop all hadoop services using stop-all.sh
1. First we need to get the hdfs data node path. This will be specified in hdfs-site.xml of hadoop. (for me it was in /usr/local/hadoop/etc/hadoop)
2. for me data-node was in /home/hadoop/mydata/hdfs/datanode
3. cd to above path and remove all its contents by issuing rm command
   hadoop@space-Vostro-3800:/home/hadoop/mydata/hdfs/datanode$ rm -r *
4. Then go to hadoop user home folder and reformat name node .
   hadoop@space-Vostro-3800:/home/hadoop$ hdfs namenode -format
Then start all hadoop services using start-all.sh or by running the commands separately.
5. The run the command jps. Then I got the expected result
2583DataNode
2970ResourceManager
3461Jps
3177NodeManager
2361NameNode
2840SecondaryNameNode
So here name node service is running and this can be verified by
                      telnet  localhost 9000
So everything is under control now . Now we can resume with oozie installation.  We can move to oozi folder in hadioop user home and run
hadoop@space-Vostro-3800:/home/hadoop/oozie$./bin/oozie-setup.sh sharelib create -fs hdfs://localhost:9000
success……………………..
Now we can create database using
hadoop@space-Vostro-3800:/home/hadoop/oozie$ ./bin/ooziedb.sh create -sqlfile oozie.sql -run
ok. with this database is created.
Now start oozie service using
hadoop@space-Vostro-3800:/home/hadoop/oozie$ ./bin/oozied.sh start
The same can be verified from web interface. Please type the following url in your browser.
# Web UI
http://localhost:11000/oozie/
****************
Now we are done with so called oozie installation.

 

 

Installing Latest Version of Node.js and NPM

The easiest way to upgrade node.js and npm, in my opinion is to uninstall existing node.js and npm and which can be done with this single command

                                  sudo apt-get remove nodejs

Now we need to install latest version of nodejs and npm and both can be achieved with single command as in the previous case. But  before that we need to update the repossitory. For that try running the following terminal command

curl -sL https://deb.nodesource.com/setup | sudo bash -

If you don’t have “curl” installed in your system, you will have to do that with the following command

sudo apt-get install curl

Now  finally it is time to run the command  sudo apt-get install nodejs      to install nodejs and npm in a single go (installing nodejs will install npm also).

Now check the node js and npm versions using the command
                            node -v
                            npm -v

You can see that both are of the latest versions

Ref :https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#debian-and-ubuntu-based-linux-distributions
https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager