Code Monkey home page Code Monkey logo

linux-survivor-kit's Introduction

Linux survivor kit

2016-10-17

minimal alias kit for a linux machine.

When investigating a new machine, if you are not a pro administrator, you will probably have no shortcuts (assuming pros have better ways to do things).

I figured it took me 10 minutes or more to create basic shortcuts that allow me decent navigation.

So, without further ado, here it is.

Copy paste in your root's .bashrc and continue what you were doing...

Ubuntu14

alias ll='ls -lArth'

alias aa='vim ~/.bashrc'
alias aas='source ~/.bashrc'
alias aconf='vim /etc/apache2/sites-available/000-default.conf'
alias alog='tail -f /var/log/apache2/error.log'
alias alogg='tail -f /var/log/apache2/access.log'
alias ar='service apache2 restart'


alias nstart='service nginx start'
alias nstop='service nginx stop'
alias nr='service nginx reload'
alias nconf='vim /etc/nginx/nginx.conf'
alias nsite='cd /etc/nginx/conf.d'
alias nlog='tail -f /var/log/nginx/error.log'
alias nlogg='tail -f /var/log/nginx/access.log'


alias pini='vim /etc/php5/fpm/php.ini'
alias pconf='vim /etc/php5/fpm/php-fpm.conf'
alias pconff='vim /etc/php5/fpm/pool.d/www.conf'
alias pstart='service php5-fpm restart'
alias pstop='service php5-fpm stop'
alias psite='cd /etc/php5/fpm/pool.d'
alias plog='tail -f /var/log/php5-fpm.log'


alias vimrc='vim ~/.vimrc'
alias vimt='vim -c "NERDTree" $1'

Ubuntu16

alias ll='ls -lArth'

alias aa='vim ~/.bashrc'
alias aas='source ~/.bashrc'
alias aconf='vim /etc/apache2/sites-available/000-default.conf'
alias alog='tail -f /var/log/apache2/error.log'
alias alogg='tail -f /var/log/apache2/access.log'
alias ar='service apache2 restart'


alias nstart='service nginx start'
alias nstop='service nginx stop'
alias nr='service nginx reload'
alias nconf='vim /etc/nginx/nginx.conf'
alias nsite='cd /etc/nginx/conf.d'
alias nlog='tail -f /var/log/nginx/error.log'
alias nlogg='tail -f /var/log/nginx/access.log'


alias pini='vim /etc/php/7.0/fpm/php.ini'
alias pconf='vim /etc/php/7.0/fpm/php-fpm.conf'
alias pconff='vim /etc/php/7.0/fpm/pool.d/www.conf'
alias pstart='service php7.0-fpm restart'
alias pstop='service php7.0-fpm stop'
alias psite='cd /etc/php/7.0/fpm/pool.d'
alias plog='tail -f /var/log/php7.0-fpm.log'


alias vimrc='vim ~/.vimrc'
alias vimt='vim -c "NERDTree" $1'

Quick start

Also to create a nginx php server rapidly on a fresh linux, you can do this:

apt-get update
apt-get install -y tree
apt-get install -y vim # already installed on ubuntu16
apt-get install -y nginx
apt-get install -y php5-fpm # on ubuntu16, you can use php7.0-fpm instead
apt-get install -y git # already installed on ubuntu16
apt-get install -y tmux # already installed on ubuntu16

# then for security it's recommended that you add this line in your php.ini:  cgi.fix_pathinfo=1 (it will prevent php from
# trying to get a close match to the exact request from the client, which could lead to security issues )

# then, you should configure your vim: https://github.com/lingtalfi/vim-survivor-kit

# add vim syntax highlighting for nginx conf: https://arian.io/vim-syntax-highlighting-for-nginx/
cd
wget -O nginx.vim http://www.vim.org/scripts/download_script.php\?src_id\=19394
mkdir -p ~/.vim/syntax  
mv nginx.vim ~/.vim/syntax/  
vim ~/.vim/filetype.vim  

# (paste the following line in ~/.vim/filetype.vim)
au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/conf/* if &ft == '' | setfiletype nginx | endif   

linux-survivor-kit's People

Contributors

lingtalfi avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.