Leeladharan Achar - alias - leelu ~ blogging...hola mi amigos.. The Blog

Leeladharan Achar - leelu Blog. Hola mi amigos!

Processing Nginx Logs

Below are list of few commands that can be used in linux to process nginx logs

Processing log file group by HTTP Status Code

awk '{print $11}' access.log | sort | uniq -c | sort -rn 

The $11 is the field in log line, where each field is delimited by a delimiter like (space). In my log files $11 ...

More ...

Python grequests Asynchronous Post Method Example

def get_async_web_response(url, method='GET', params=None, headers=None, encode=False, verify=None, use_verify=False, callback=None): import grequests # make a string with the request type in it: response = None request = None try: if 'POST' == method: if use_verify: request = grequests.post(url, data=params, headers=headers, verify=verify, callback=callback) else: request = grequests.post(url, data=params, headers=headers, callback=callback) else: request = requests.get(url, data=params, headers=headers, callback=callback) if request: response = grequests.send(request, ... 

More ...

CentOS7 Updating OpenSSH To OpenSSH7.5p1

Below are instructions on upgrading openssh6 to openssh7.5p1 on centOS7

Login to RemoteMachine

ssh to the remote machine, where we need to update. Login as root.

Now open another terminal and connect to same remote machine and login as root.

This is to make sure while upgrading if by mistake you get logged out/quit u have another session.

Steps To ...

More ...

Installing PHP 7 with nginx on mac OS X

Install Commandline Tools

xcode-select --install

Install Homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Check Installation

brew doctor

Install brew services

brew tap homebrew/services

Install bash completion (Optional)

brew install bash-completion

Update Brew and Packages if allready installed

brew update && brew upgrade

Setup Environment

sudo nano ~/.bash_profile

Add following lines

 ## # Homebrew ## export PATH="/usr/local/bin:$PATH" export PATH="/usr/local/sbin:$PATH" ## # ... 

More ...