Install NodeJS on Mac OS

To install NodeJS on a Mac the first thing you have to do is download Brew package manager for mac. Though you can install NodeJS via other methods but doing it with Brew is the easiest and least error prone method

1. Install Brew on your mac if you dont have it already. Open the terminal app and paste the below command (make sure you have the password for the user)

ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

2. Now the Brew package manager is installed. Open terminal and type below command

brew install node

3. Check Versions of Node and NPM

node -v

npm -v

 

4. Create a Demo Web server and Check. Open terminal and type below

vim demo_server.js

— Paste below Code in the file —

var http = require(‘http’);
http.createServer(function (req, res) {
res.writeHead(200, {‘Content-Type’: ‘text/plain’});
res.end(‘Welcome To EasyOraDBA’);
}).listen(3005, “127.0.0.1”);
console.log(‘Server is running at http://127.0.0.1:3005/’);

 

node demo_server.js

— Now open a Web browser and paste the URL http://127.0.0.1:3005/ And voila you have a NodeJS Web Server running —

 

Add a Disk and Extend FileSystem on RHEL7 on VMware Fusion 8 for Mac (El- Capitan)

Below is the Filesystem on our VM

Filesystem           Size  Used Avail Use% Mounted on

/dev/mapper/ol-root   18G   11G  7.0G  61% /

devtmpfs             476M     0  476M   0% /dev

tmpfs                491M  144K  491M   1% /dev/shm

tmpfs                491M  7.2M  484M   2% /run

tmpfs                491M     0  491M   0% /sys/fs/cgroup

/dev/sda1            497M  177M  320M  36% /boot

tmpfs                 99M   12K   99M   1% /run/user/0

Our aim is to grow the Filesystem /dev/mapper/ol-root

Filesystems in Linux are extended using the following steps

  1. Add a Physical Disk —> Needs a Shutdown
  2. Create a Physical Volume, using pvcreate —> Online
  3. Grow the Volume Group, using vgextend —> Online
  4. Grow the Logical Volume, using extend—> Online
  5. Extend the Filesystem(XFS) , using xfs_growfs—> Online

Let us continue and see each step in details now…

  1. Shutdown your VM and ddd the disk from option Virtual Machine—> Hard Disk (SCSI)
  2. Check from Disk Utility if the new Disk AppearsScreen Shot 2016-05-14 at 5.27.55 PM

$ pvdisplay

3. Create Physical Volume

root@localhost ~]# pvcreate /dev/sdc

WARNING: xfs signature detected on /dev/sdc at offset 0. Wipe it? [y/n]: y

  Wiping xfs signature on /dev/sdc.

  Physical volume “/dev/sdc” successfully created

4. Extend the Volume Group

$ vgdisplay

[root@localhost ~]# vgextend ol /dev/sdc

  Volume group “ol” successfully extended

5. Extend the Logical Volume

[root@localhost ~]# lvdisplay

  — Logical volume —

  LV Path                /dev/ol/root

  LV Name                root

  VG Name                ol

  LV UUID                nfBnYo-iJhh-fC0y-dWqD-A5Nf-SVHX-lBwioW

  LV Write Access        read/write

  LV Creation host, time localhost.localdomain, 2016-05-13 14:49:36 +0300

  LV Status              available

  # open                 1

  LV Size                17.47 GiB

  Current LE             4472

  Segments               1

  Allocation             inherit

  Read ahead sectors     auto

  – currently set to     8192

  Block device           252:0

[root@localhost ~]# lvextend –size 35G /dev/ol/root

  Size of logical volume ol/root changed from 17.47 GiB (4472 extents) to 35.00 GiB (8960 extents).

  Logical volume root successfully resized.

[root@localhost ~]# lvdisplay

  — Logical volume —

  LV Path                /dev/ol/root

  LV Name                root

  VG Name                ol

  LV UUID                nfBnYo-iJhh-fC0y-dWqD-A5Nf-SVHX-lBwioW

  LV Write Access        read/write

  LV Creation host, time localhost.localdomain, 2016-05-13 14:49:36 +0300

  LV Status              available

  # open                 1

  LV Size                35.00 GiB

  Current LE             8960

  Segments               2

  Allocation             inherit

  Read ahead sectors     auto

  – currently set to     8192

  Block device           252:0

Now the logical volume is extended

6. Resize the Filesystem

Since this is RHEL7 and the default FS for root is XFS, if we try to grow the FS using resize2fs like we did earlier on ext3 and ext4, it will give below error

[root@localhost ~]# resize2fs /dev/ol/root 35G

resize2fs 1.42.9 (28-Dec-2013)

resize2fs: Bad magic number in super-block while trying to open /dev/ol/root

Couldn’t find valid filesystem superblock

If you were using RHEL6 and ext4, you could use resize2fs, but we will continue with xfs_growfs

To grow the XFS filesystem we have to use command xfs_growfs

[root@localhost ~]# xfs_growfs /dev/ol/root

meta-data=/dev/mapper/ol-root    isize=256    agcount=4, agsize=1144832 blks

         =                       sectsz=512   attr=2, projid32bit=1

         =                       crc=0        finobt=0

data     =                       bsize=4096   blocks=4579328, imaxpct=25

         =                       sunit=0      swidth=0 blks

naming   =version 2              bsize=4096   ascii-ci=0 ftype=0

log      =internal               bsize=4096   blocks=2560, version=2

         =                       sectsz=512   sunit=0 blks, lazy-count=1

realtime =none                   extsz=4096   blocks=0, rtextents=0

data blocks changed from 4579328 to 9175040

Check to confirm

Filesystem           Size  Used Avail Use% Mounted on

/dev/mapper/ol-root   35G   11G   25G  31% /

devtmpfs             476M     0  476M   0% /dev

tmpfs                491M  144K  491M   1% /dev/shm

tmpfs                491M  7.2M  484M   2% /run

tmpfs                491M     0  491M   0% /sys/fs/cgroup

/dev/sda1            497M  177M  320M  36% /boot

tmpfs                 99M   16K   99M   1% /run/user/0

Uninstall mysql from Mac OS X 10.11.2 El Capitan

Take a backup of the databases before removing mysql

[code language=”bash”]

rm /usr/local/mysql

rm -rf /usr/local/mysql*

rm -rf /Library/StartupItems/MySQLCOM

rm -rf /Library/PreferencePanes/My*

rm -rf ~/Library/PreferencePanes/My*

rm -rf /Library/Receipts/mysql*

rm -rf /Library/Receipts/MySQL*

rm -rf  /private/var/db/receipts/*mysql*

rm -rf /var/db/receipts/com.mysql.*

[/code]