ror, scala, jetty, erlang, thrift, mongrel, comet server, my-sql, memchached, varnish, kestrel(mq), starling, gizzard, cassandra, hadoop, vertica, munin, nagios, awstats
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| upstream tornadoFrontends { | |
| server 127.0.0.1:8000; | |
| server 127.0.0.1:8001; | |
| server 127.0.0.1:8002; | |
| server 127.0.0.1:8003; | |
| } | |
| server { | |
| listen 80; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [unix_http_server] | |
| file=/tmp/supervisor.sock ; path to your socket file | |
| [supervisord] | |
| logfile=/var/log/supervisord/supervisord.log ; supervisord log file | |
| logfile_maxbytes=50MB ; maximum size of logfile before rotation | |
| logfile_backups=10 ; number of backed up logfiles | |
| loglevel=error ; info, debug, warn, trace | |
| pidfile=/var/run/supervisord.pid ; pidfile location | |
| nodaemon=false ; run supervisord as a daemon |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| # PythonTidy.py | |
| # 2006 Oct 27 . ccr | |
| '''PythonTidy.py cleans up, regularizes, and reformats the text of | |
| Python scripts. | |
| =========================================== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| def get_memory(sajith): | |
| start = time.time() | |
| f = open(sajith) | |
| for line in f.readlines(): | |
| a = line.split(':') | |
| a[1] = a[1].strip() | |
| if(a[0] == 'VmData'): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| def get_memory(sajith): | |
| start = time.time() | |
| f = open(sajith) | |
| for line in f.readlines(): | |
| a = line.split(':') | |
| a[1] = a[1].strip() | |
| if(a[0] == 'VmData'): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| '''Problem Statement | |
| You are given a square matrix of size N×N. Calculate the absolute difference of the sums across the two main diagonals. | |
| Input Format | |
| The first line contains a single integer N. The next N lines contain N integers (each) describing the matrix. | |
| Constraints | |
| 1≤N≤100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import csv | |
| data = open('data.txt', 'r') | |
| for line in data.readlines(): | |
| tokens = line.split() | |
| # iterate througt the list | |
| # count the existence | |
| d = {} | |
| for word in tokens: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # To run this command: | |
| # curl https://gist.githubusercontent.com/tianhuil/0aa9b265f55413dc7198/raw > setup_digitalocean.sh | |
| # . setup_digitalocean.sh | |
| # Update sudo apt-get | |
| sudo apt-get update | |
| # Installing scientific Python | |
| sudo apt-get -y install --fix-missing build-essential python-dev python-numpy python-setuptools python-scipy libatlas-dev | |
| sudo apt-get -y install --fix-missing build-essential python-sklearn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import torndb | |
| mysql_settings = { | |
| 'host': 'localhost:3306', | |
| 'user': 'user', | |
| 'password': 'password', | |
| 'database': 'database', | |
| 'time_zone': '-8:00', | |
| 'charset': 'utf8' |