Friday, October 23, 2015

Setup VM Image on BLUEMIX: Create LAMP Server & Nodered

Setup guide series... very little shot... useful as reference...


Step to install LAMP:

sudo apt-get install apache2
sudo apt-get install mysql-server
sudo apt-get install phpmyadmin
sudo php5enmod mcrypt 

sudo apt-get install php5 libapache2-mod-php5
sudo /etc/init.d/apache2 restart




NodeRed Installation:

curl --silent --location https://deb.nodesource.com/setup_0.12 | sudo bash -
apt-get install --yes nodejs 


[FROM THE NODE root INSTALLATION]
npm install require-all
npm install bignumber.js
npm install isarray process-nextick-args inherits util-deprecate string_decoder  core-util-is
npm install readable-stream
npm install  mysql 
npm install node-red-node-mysql 
 
 
 
npm install -g pm2 

pm2 start /prod/node-v0.10.36-linux-x64/bin/node-red --node-args="--max-old-space-size=128" -- -v
pm2 save
pm2 startup


Bye Bye
 


Thursday, October 22, 2015

Setup VM Image on BLUEMIX : Add user

Procedure to add user to VM ....

ADD USER

 
adduser xxxx
 
Adding user `xxxx' ...
Adding new group `xxxx' (1001) ...
Adding new user `xxxx' (1001) with group `xxxx' ...
Creating home directory `/home/xxxx' ...
Copying files from `/etc/skel' ...
New password:
Retype new password:
passwd: password updated successfully
Changing the user information for xxxx
Enter the new value, or press ENTER for the default
        Full Name []: User 
        Room Number []: 1
        Work Phone []: +39
        Home Phone []:
        Other []:
Is the information correct? [Y/n]

vi /etc/ssh/sshd_config
 
 
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
PermitRootLogin no
PasswordAuthentication yes
AllowUsers user
UsePAM yes


add user to sudoers
sudo gpasswd -a xxxx sudo
Adding user xxxx to group sudo


vi /etc/sudoers
xxxx        ALL=(ALL)       NOPASSWD: ALL
 

service ssh restart
 
ssh stop/waiting
ssh start/running, process 6107
 
 

Friday, October 16, 2015

Raspberry PI Setup - Operations

This post aims to record the setup workflow action applied to the lastest ( Sept 2015 ) weezy RPI image setup:

After restore image weezy to SD card....

RECONFIGURE KEYBOARD LAYPUT
dpkg-reconfigure keyboard-configuration

apt-get update

INSTALL TELNETD
apt-get install telnetd
/etc/init.d/openbsd-inetd restart

TIMEZONE
dpkg-reconfigure tzdata

LAMP
apt-get install apache2 php5 mysql-client mysql-server vsftpd

JAVA7 
apt-get install oracle-java7-jdk
>>> apt-get install openjdk-7-jdk

X11-APPS
apt-get install x11-apps

apt-get install xorg xutils xserver-xorg xterm xserver-xorg-video-fbdev xserver-xorg-video-vesa


HDMI
Switch on
/opt/vc/bin/tvservice -p

Switch off
/opt/vc/bin/tvservice -o


/opt/vc/bin/tvservice --sdtvon="PAL 16:9"


MYSQL

create database xxxx;
create user user@localhost identified by 'xxxx';

vi /etc/mysql/my.cnf
bind-address 0.0.0.0
service mysql restart

GRANT ALL PRIVILEGES ON xxxx.* TO 'user'@'%' IDENTIFIED BY 'xxxx';
flush privileges;


FFMPEG
apt-get install ffmpeg

MYSQL LIB C Client
apt-get install libmysqlclient-dev

apt-get install libboost-dev
apt-get install libpcre3-dev libavfilter-dev libavformat-dev libavcodec-dev

OMXPLAYER 
git clone https://github.com/popcornmix/omxplayer.git