Monday, March 19, 2018

Installing nodejs


curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs




updated:
I just installed nodejs and npm in a newly created vm.
sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm
https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-16-04



update: 7/30/2018
Alternatively, for Node.js 10:
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - 
sudo apt-get install -y nodejs

Wednesday, March 14, 2018

Setup a vagrant with gui

I have experimented to launch a vagrant using existing VMbox like ubuntu but I was failed to do it. I found this tutorial below.

https://relativkreativ.at/articles/how-to-build-a-vagrant-base-box-from-a-virtualbox-vm

Although, this example is based on centos I'm hoping to manage it in Ubuntu. I got an error in its really frustrating.

So I stop and goes right away to vagrant cloud to find any existing predefined vagrant box.
this one looks promising and will give it a try.

https://app.vagrantup.com/igorbrites/boxes/ubuntu-trusty64-gui
vagrant init igorbrites/ubuntu-trusty64-gui --box-version 0

Linux command

To set new password for root in Ubuntu
> sudo passwd root


To locate a file
find / -name 'pg_hba.conf' 2>/dev/null


To add new user
> sudo adduser --home /home/demo --shell /bin/bash demo


Wednesday, February 28, 2018

Sublime shortcut keys

I really like sublime, especially in my development. It is very lightweight and many features.
Today I learned something nice related to shortcut keys.

http://docs.sublimetext.info/en/latest/reference/keyboard_shortcuts_win.html


Keep on subliming... :)


Sunday, February 25, 2018

Setup vagrant but cannot ping other network ip address “Destination Host Unreachable”

I spend many days to figure it out my problem in Vagrant. After I posted my question in stackoverflow, nobody is helping me instead they downvoted my post.

https://stackoverflow.com/questions/48899409/setup-vagrant-but-cannot-ping-other-network-ip-address-destination-host-unreach

Sad! really sad. :( curse you!!!


But anyway, I solved it in my own way. I found this article below
https://github.com/moby/moby/issues/27818

It's simply my docker IP address clashed with my company IP address because when you create the container by default it will create 172.18.xx.xx IP address. Boom! Destination unreachable.... blah blah.

So, I just create a custom docker network and when I checked it created IP address that start 172.19.xx.xx

$ docker network create --driver=bridge --subnet=172.20.0.0/16 --gateway=172.20.0.0 vbroker-network-v1

updated 2018-0720:
docker network create --driver=bridge --subnet=172.28.0.0/16 --gateway=172.28.5.254 vbroker-network

then in the docker-compose.yml, just added
networks:
  default:
    external:
      name: vbroker-network



Eureka!



Monday, February 19, 2018

Install VirtualBox guest additions in CentOS

Open up the virtualbox centos gui

type:
su -
yum update kernel*
yum -y install kernel-devel kernel-headers dkms gcc gcc-c++
reboot

insert virtual optical disk in settings
mount /dev/cdrom /mnt
cd /mnt
./VBoxLinuxAdditions.run

Merci!

References:
http://nanxiao.me/en/install-virtualbox-guest-additions/

Monday, February 12, 2018

Improve command prompt console

In Linux when you open a terminal, you can also open a new tab out of it but in Windows you can't using the native command prompt. Even Powershell has no capability of opening new tab.

So I call my friend google and found out this 2 amazing tools.

1. Console - pretty simple and nice but the problem is that I don't know how to properly maximize without losing the focus of the command prompt.


2. ConEmu - this is the finest that I found so far. Pretty slick and have a lot of function. you can choose what console you liked.  Recommended!!!

free online comma separating tool

https://delim.co/#