init script for mongodb 4 on WSL in ubuntu 18.04

If you try to start mongodb on WSL using systemd you will be getting this error.

System has not been booted with systemd as init system (PID 1). Can’t operate.

There seems to be no init script for mongodb 4 on ubuntu 18.04(may be other versions too). This makes it complicated for starting mongodb in WSL as systemctl is not supported on WSL. Inorder to have a init script so that you can start using service mongodb start we need to have the init file.

Thankfully init file is already provivided by mongodb here

https://raw.githubusercontent.com/mongodb/mongo/master/debian/intt.d

Follow the below steps to get the mongodb running on WSL

  • sudo curl -o /etc/init.d/mongodb https://raw.githubusercontent.com/mongodb/mongo/master/debian/init.d
  • sudo chmod +x mongodb
  • sudo service mongodb start

This should successfully start mongodb.

Njoy smile

Fix ubuntu 16.04 macbook brightness issue after lid close

Note: All tests are being done on 2013 macbook air

Ubuntu on MacBook almost works perfectly like any other laptops out there. There are some issues though. One the most annoying one is the brightness issue. Once the lid is closed, it goes to sleep state. After waking up, only 2 options for the brightness 0 or 100.

To solve the issue we need to install mba6x_bl

Follow the following steps

╰─○ git clone git://github.com/patjak/mba6x_bl 
╰─○ cd mba6x_bl 
╰─○ make
╰─○ checkinstall
╰─○ sudo dpkg -i mba6x-bl_xxxxxx_amd64.deb (check your folder for the exact name of deb file generated from check install)
╰─○ sudo depmod -a 
╰─○ sudo modprobe mba6x_bl 
╰─○ sudo reboot

That’s it folks. You have successfully squashed the bug

Enjoy smile