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 string | |
| # number_letter_map = {0: 'A', 1: 'B', ... , 51: 'z'} | |
| number_letter_map = dict(zip(range(52), string.letters)) | |
| def get_unique_string(number): | |
| """ | |
| Take a number as input and return a unique string corresponding to that number. | |
| """ |
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
| # I am trying from the server 54.85.216.40 | |
| # Index Server | |
| # ========= | |
| root@ip-10-0-0-11:/home/ubuntu# telnet -d 54.169.89.119 27017 | |
| Trying 54.169.89.119... | |
| telnet: Unable to connect to remote host: Connection timed out | |
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
| # Local | |
| ======== | |
| ~ cd /mongo/installation/directory/ | |
| ~ cd ~/opt/mongodb-linux-x86_64-ubuntu1404-3.0.1/ | |
| # Start Mongodb server | |
| # ==================== | |
| - bin/mongod --config bin/mongodb.config |
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
| DESC INFORMATION_SCHEMA.PROCESSLIST; | |
| select id, time, user, host, command from INFORMATION_SCHEMA.PROCESSLIST order by time desc; |
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
| # refer http://www.huyng.com/posts/python-performance-analysis/ | |
| $ pip install line_profiler | |
| # To use this tool, first modify your source code by decorating the function you want | |
| # to measure with the @profile decorator. | |
| $ kernprof -l scripts/cronfiles/run_random_reports.py | |
| $ python -m line_profiler run_random_reports.py.lprof |
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
| ./manage.py test -v3 manifest.tests.views.ManifestViewsTestCase |
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
| rm -r /usr/local/lib/python2.7/site-packages/django/ | |
| rm -r /usr/local/lib/python2.7/site-packages/Django-1.7.1-py2.7.egg-info/ | |
| install older version from source |
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
| # install ipython line_profiler |
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
| # setup for virtualenv wrapper | |
| export WORKON_HOME=~/Envs | |
| source /usr/local/bin/virtualenvwrapper.sh | |
| # cleanup command | |
| alias cleanup='echo "Cleaning Up" && sudo apt-get -f install && sudo apt-get autoremove && sudo apt-get -y autoclean && sudo apt-get -y clean' |
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
| #standard python libs | |
| import logging | |
| import time | |
| #third party libs | |
| from daemon import runner | |
| from utils process_shipment_queue | |