First let's install Homebrew.
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
| #!/bin/bash | |
| export TERM=xterm-256color | |
| function tinkerwatch(){ | |
| clear; | |
| tail -n $(expr $(wc -l $1 | awk '{ print $1 }') - 1) $1 | php artisan tinker | |
| } | |
| tinkerwatch $1 |
| ------------------------------------------------------------------------------------------ | |
| #CLI shortcut keystrokes(linux&MAC) | |
| Ctrl+L: Clear the screen. This is similar to running the “clear” command. | |
| Ctrl+C: Interrupt (kill) the current foreground process running in in the terminal. This sends the SIGINT signal to the process | |
| Ctrl+Z: Suspend the current foreground process running in bash. This sends the SIGTSTP signal to the process. To return the process to the foreground later, use the fg process_name command. | |
| Ctrl+D: Close the bash shell.This is similar to running the exit command | |
| Ctrl+L: Clear the screen. This is similar to running the “clear” command. | |
| Ctrl+S: Stop all output to the screen. This is particularly useful when running commands with a lot of long, verbose output, but you don’t want to stop the command itself with Ctrl+C. | |
| Ctrl+Q: Resume output to the screen after stopping it with Ctrl+S. |
| var gulp = require('gulp'), | |
| gutil = require('gulp-util'), | |
| sass = require('gulp-ruby-sass'), | |
| minifyCSS = require('gulp-minify-css'), | |
| concat = require('gulp-concat'), | |
| webserver = require('gulp-webserver'), | |
| uglify = require('gulp-uglify'), | |
| rename = require('gulp-rename'), | |
| minifyHTML = require('gulp-minify-html'), | |
| imagemin = require('gulp-imagemin'), |
| # get total requests by status code | |
| awk '{print $9}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | |
| # get top requesters by IP | |
| awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head | awk -v OFS='\t' '{"host " $2 | getline ip; print $0, ip}' | |
| # get top requesters by user agent | |
| awk -F'"' '{print $6}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head | |
| # get top requests by URL |
| sudo rm -rfv /Library/Caches/com.apple.iconservices.store; sudo find /private/var/folders/ \( -name com.apple.dock.iconcache -or -name com.apple.iconservices \) -exec rm -rfv {} \; ; sleep 3;sudo touch /Applications/* ; killall Dock; killall Finder |
$ brew install dnsmasq
...
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
/usr/local/etc/dnsmasq.confaddress=/local/127.0.0.1
| Note for newcomers: | |
| In the shortcuts below, "C" stands for CTRL and "A" stands for "ALT". This is a convention | |
| used in the Midnight Commander documentation and was kept here. | |
| You can also use "ESC" instead of "ALT", which is useful on Macbooks. | |
| Main View | |
| --------------------------------------------------------------- | |
| - File/directory operations |