Skip to content

Instantly share code, notes, and snippets.

View alertor's full-sized avatar

Stefan Taranu alertor

  • Bucharest, Romania
View GitHub Profile
@alertor
alertor / jira-behing-nginx-ssl
Last active April 27, 2023 15:45
Atlassian JIRA behind nginx + SSL
# force HTTP to HTTPS - /etc/nginx/conf.d/nonssl.conf
server {
listen 80;
server_name jira.example.com;
access_log off;
return 301 https://$server_name$request_uri;
}
# /etc/nginx/conf.d/jira.conf
server {
@alertor
alertor / mongod-install
Created February 27, 2013 10:38
install mongodb - CentOS 6.3
# /etc/yum.repos.d/10gen.repo
[10gen]
name=10gen Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
gpgcheck=0
enabled=1
# ---
yum install mongo-10gen mongo-10gen-server
@alertor
alertor / diacritics.py
Created February 27, 2013 19:44
"convert" romanian diacritics
#!/usr/bin/env python2.6
# -*- coding: utf-8 -*-
# get hex code from : http://webdesign.about.com/od/localization/l/blhtmlcodes-ro.htm
import fileinput
table = {
0x103: u'a',
0x15f: u's',
}
from fabric.api import env, run, sudo, local, put
def production():
"""Defines production environment"""
env.user = "deploy"
env.hosts = ['example.com',]
env.base_dir = "/var/www"
env.app_name = "app"
env.domain_name = "app.example.com"
env.domain_path = "%(base_dir)s/%(domain_name)s" % { 'base_dir':env.base_dir, 'domain_name':env.domain_name }
@alertor
alertor / varnishadm.py
Created April 5, 2013 09:45
check varnishadm backend health status
#!/usr/bin/python
# save as /usr/lib/nagios/plugins/check_varnish_backends.py
from optparse import OptionParser
import subprocess
def getOptions():
arguments = OptionParser()
arguments.add_option("--host", dest="host", help="Host varnishadm is running on", type="string", default="localhost")
arguments.add_option("--port", dest="port", help="varnishadm port", type="string", default="6082")
@alertor
alertor / mongodb
Created April 11, 2013 08:51 — forked from srpouyet/mongodb
# Put this in /etc/logrotate.d/mongodb
# http://stackoverflow.com/questions/5004626/mongodb-log-file-growth
/var/log/mongo/*.log {
daily
rotate 30
compress
dateext
missingok
notifempty
@alertor
alertor / opencv-install.txt
Last active August 29, 2015 14:03
Installing OpenCV on Ubuntu 14.04
[compiler] sudo apt-get install build-essential
[required] sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
[optional] sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
cd ~/<my_working _directory>
git clone https://github.com/Itseez/opencv.git
mkdir build
cd build
#!/bin/bash
EXITCODE="0"
SERVICES=(
"memcached &"
"mongod &"
"redis-server &"
"neo4j start"
"elasticsearch"
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
fabfile for Django
------------------
see http://morethanseven.net/2009/07/27/fabric-django-git-apache-mod_wsgi-virtualenv-and-p/
modified for fabric 0.9/1.0 by Hraban (fiëé visuëlle)
several additions, corrections and customizations, too
#!/usr/bin/env python
from __future__ import with_statement # needed for python 2.5
from fabric.api import *
from fabric.contrib.console import confirm
from fabric.contrib import files
USAGE = """
================================================================
NOTE:
using this fabfile expects that you have the python utility