NerdTree command cheatsheet

Install NerdTree : http://chrisstrelioff.ws/sandbox/2014/05/29/install_and_setup_vim_on_ubuntu_14_04.html ctrl+ww move cursor back to list directory gt next tab gT previous tab Enable html syntax: au BufReadPost *.ezt set syntax=html Nerdtree setup alike: let g:netrw_banner = 0 let g:netrw_liststyle = 3 let g:netrw_browse_split = 4 let g:netrw_altv = 1 let g:netrw_winsize = 25 augroup ProjectDrawer autocmd! autocmd VimEnter * :Vexplore augroup … Read more

Alembic set autogenerate model

Alembic create revision autogenerate with comment: $ alembic -c dev.ini revision –autogenerate -m “adding some tables” Check upgrade script: $ cat alembic/versions/123xxx_xxx.py Alembic upgrade metadata with version $ alembic -c dev.ini upgrade 123xxx Alembic upgrade metadata with latest version $ alembic -c dev.ini upgrade head  

Setup Systemd Service on Ubuntu 16.04

$ sudo vim /etc/systemd/system/myservice.service [Unit] Description=Run the service [Service] User=ubuntu # change the workspace WorkingDirectory=/usr/local/src #path to executable. #executable is a bash script which calls jar file ExecStart=/usr/local/src/somescript SuccessExitStatus=143 TimeoutStopSec=10 Restart=on-failure RestartSec=5 [Install] WantedBy=multi-user.target $ sudo vim /usr/local/src/somescript #!/bin/sh java -jar /some/file.jar sudo systemctl daemon-reload sudo systemctl enable myservice.service sudo systemctl start myservice sudo systemctl … Read more

Setup Simple Ruby on Rails App On Ubuntu 16.04 From Scratch

Rails is one of the most popular ruby framework out there. And now, I want to try to run the simple app on Ubuntu 16.04 machine. it’s for testing purpose. First, update the system and install essential dependencies: $ sudo apt-get update $ sudo apt-get build-essential curl sudo vim Install nodejs: $ curl -sL https://deb.nodesource.com/setup_9.x … Read more

Linux machine Failed to hibernate, “system via logind: Sleep verb not supported”

So after using fedora 28 for a while. I tried to configure my power management using xfce power management system. Looking at these power management settings, are very simple explanation. I set my machine to hibernate or sleep mode when inactive for 16 minutes. Saved the settings. then I closed the laptop lid, so it … Read more

Setup ftp that works with local user with vsftpd on ubuntu

This is the step-by-step installation of vsftpd that actually works. If you have website that runs wordpress, you might want to enable this to be able install/update your wordpress plugin. Install vsftpd and start the service: $ sudo apt-get install vsftpd -y $ sudo systemctl start vsftpd.service $ sudo systemctl enable vsftpd.service Open vsftpd.conf file, and … Read more