Run bash terminal inside VIM with Conque-Shell

This is one of the coolest trick I’ve ever seen when working with VIM. This plugin allows you to run the bash terminal inside the VIM. And you can actually make it a spitted pane within your VIM work space. Check out this plugin: How to install conque-shell: Open vim config: vim ~/.vimrc call plug#begin(‘~/.vim/plugged’) … Read more

Nginx: set the server_name as wildcard without hostname

Simple trick to run the nginx with no server_name. server { listen 80 default_server; server_name _; location / { root /path/to/app; index index.php; try_files $uri $uri/ /index.php?q=$uri&$args; location ~* \.php { try_files $uri =404; include fastcgi_params; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass 127.0.0.1:9000; } } }

Install TeamViewer On Fedora 28, Easy setup

Installing rpm package can be tricky, sometimes dependecies that required are not met. I’ve experienced this when installing TeamViewer for fedora 28. Here’s just another snippet to installing the TeamViewer on fedora 28 with nice and easy. Download teamviewer from the source: $ wget https://download.teamviewer.com/download/linux/teamviewer.x86_64.rpm Install the dependencies and the rpm target: $ sudo dnf … Read more

Setup scrot on Ubuntu

Simple trick to setup simple command to spawn screenshot utility using scrot: $ sudo apt-get install scrot $ sudo touch /usr/bin/sel $ sudo chmod +x /usr/bin/sel $ vim /usr/bin/sel #!/bin/bash scrot -s -e ‘mv $f ~/Pictures/’

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