# Ubuntu Setup with Nodejs and related packages ## Newer laptops wifi problem ``` In BIOS, disabled secure boot and enable legacy mode. ``` ## Install curl ``` sudo apt intall curl ``` ## Install snapcraft packages ### This will install following : - docker : sudo snap install docker - datagrip : sudo snap install datagrip --classic - webstorm : sudo snap install webstorm --classic - postman : sudo snap install postman - slack : sudo snap install slack --classic Install at once : ``` sudo snap install docker && sudo snap install datagrip --classic && sudo snap install webstorm --classic && sudo snap install postman && sudo snap install slack ``` ## Install CopyQ ``` sudo add-apt-repository ppa:hluk/copyq sudo apt update sudo apt install copyq ``` ## How to better install NVM - This needs curl to be installed as pre-requisite, After curl is installed : ``` goto : https://github.com/nvm-sh/nvm // install latest version from there using curl, curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash // Install LTS version of node nvm install --lts // in case you want to install latest version of nodejs nvm install node ``` ## Install yarn ``` curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list sudo apt update && sudo apt install yarn ``` ## Install Github Desktop ``` // Install AppImage/deb from https://github.com/shiftkey/desktop/releases/tag/release-2.0.4-linux1 ref : https://github.com/shiftkey/desktop/issues/163#issuecomment-508461320 ``` ## Install other IDEs : VS Code and Sublime Text ``` sudo snap install code --classic sudo snap install sublime-text --classic ``` ## Install Typora for markdown ``` wget -qO - https://typora.io/linux/public-key.asc | sudo apt-key add - # add Typora's repository sudo add-apt-repository 'deb https://typora.io/linux ./' sudo apt-get update # install typora sudo apt-get install typora ``` ## Redis and Postgres ``` REDIS sudo docker pull redis sudo docker run --name redis -p 6379:6379 -d redis sudo docker start redis -- to run second instance of redis : sudo docker run --name redis2 -p 6380:6380 -d redis PSQL // use version 10 this is the most stable one. sudo docker pull postgres:10 sudo docker run --name psql -e POSTGRES_PASSWORD=asdf -p 5432:5432 -d postgres sudo docker start psql enter command line for psql : sudo docker exec -it psql psql -U postgres ``` ## Problems with limiting the size of logrotate ``` https://gist.github.com/copsbehindme/662870957b1a301798df241a35bd2121 ``` ## Increasing watch size for ubuntu ``` fs.inotify.max_user_watches=524288 fs.inotify.max_user_watches = 524288 make it permanent ----------------------------------- sudo sysctl fs.inotify.max_user_watches=524288 sudo sysctl -p echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf sudo sysctl -p ``` ## Solution to error installing yarn ``` // if you find this error : ERROR: There are no scenarios; must have at least one. sudo npm install -g yarn ``` src : https://github.com/yarnpkg/yarn/issues/2821 also furhermore : https://github.com/yarnpkg/yarn/issues/2821#issuecomment-284181365 ### See System details in an html ``` sudo lshw -html > system_info.html ``` ### Stable versions of docker and psql on ubuntu 18.04 ``` sudo snap remove docker sudo snap install --channel=17.06 docker sudo docker pull postgres:10 sudo docker run --name psql -e POSTGRES_PASSWORD=asdf -p 5432:5432 -d postgres:10 ``` ### node-sass fix for node 12 ``` https://github.com/nodejs/docker-node/issues/1149#issuecomment-552705885 gist : use node LTS for version 12 using nvm and in dev dependencies : use "node-sass": "^4.12.0", ```