This file contains 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
call plug#begin('~/.vim/plugged') | |
Plug 'Valloric/YouCompleteMe', { 'do': './install.py' } | |
Plug 'tpope/vim-fugitive' | |
Plug 'scrooloose/nerdtree' | |
Plug 'scrooloose/syntastic' | |
Plug 'kien/ctrlp.vim' | |
Plug 'bling/vim-airline' | |
Plug 'vim-airline/vim-airline-themes' | |
Plug 'scrooloose/nerdcommenter' | |
Plug 'pangloss/vim-javascript' |
This file contains 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
# taken from http://blog.michaelyin.info/2015/05/18/how-to-disable-ghostdriver-log-when-using-selenium/ | |
driver = webdriver.PhantomJS(service_log_path='/tmp/ghostdriver.log') |
This file contains 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
# taken from http://ericholscher.com/blog/2009/apr/16/testing-ajax-views-django/ | |
response = self.client.post('/ratings/vote/', {'value': '1',}, HTTP_X_REQUESTED_WITH='XMLHttpRequest') | |
self.assertEqual(200, response.status_code) |
This file contains 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
# dump all databases once every 24 hours | |
45 4 * * * root nice -n 19 su - postgres -c "pg_dumpall --clean" | gzip -9 > /var/local/backup/postgres/postgres_all.sql.gz | |
# vacuum all databases every night (full vacuum on Sunday night, lazy vacuum every other night) | |
45 3 * * 0 root nice -n 19 su - postgres -c "vacuumdb --all --full --analyze" | |
45 3 * * 1-6 root nice -n 19 su - postgres -c "vacuumdb --all --analyze --quiet" | |
# re-index all databases once a week | |
0 3 * * 0 root nice -n 19 su - postgres -c 'psql -t -c "select datname from pg_database order by datname;" | xargs -n 1 -I"{}" -- psql -U postgres {} -c "reindex database {};"' |
This file contains 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
from django.test.runner import DiscoverRunner | |
class CustomTestRunner(DiscoverRunner): | |
@classmethod | |
def add_arguments(cls, parser): | |
parser.add_argument('--headless', | |
action='store_true', default=False, dest='headless', | |
help='Add this options to do headless browser testing') |
This file contains 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
#!/bin/bash | |
# | |
# Program : check_cronjob | |
# | |
PROGNAME=`basename $0` | |
REVISION=`echo '$Revision: 0.1 $' | sed -e 's/[^0-9.]//g'` | |
. /usr/lib/nagios/plugins/utils.sh |
This file contains 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
# -*- coding: utf8 -*- | |
from django.test import TestCase | |
from django.core.urlresolvers import reverse | |
class ProfileViewTest(TestCase): | |
"""Unit test for verify profile views""" | |
fixtures = ['users.json'] |