Skip to content

Instantly share code, notes, and snippets.

View ajinkya-bhosale's full-sized avatar

ajinkya bhosale ajinkya-bhosale

View GitHub Profile
@nicpottier
nicpottier / view_permission.py
Created March 22, 2011 07:43
Adds a view permission to all your models in Django
from django.db.models.signals import post_syncdb
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import Permission
def add_view_permissions(sender, **kwargs):
"""
This syncdb hooks takes care of adding a view permission too all our
content types.
"""
# for each of our content types
@jmorton
jmorton / Dockerfile
Last active March 27, 2019 08:31
Install Python 3.4.2 + mod_wsgi on CentOS
FROM centos:centos6
MAINTAINER jmorton@usgs.gov
# Apache
RUN yum install -y httpd httpd-devel
RUN chkconfig httpd on
RUN apachectl start
# Dependencies
RUN yum groupinstall -y "Development tools"
@ajinkya-bhosale
ajinkya-bhosale / gist:951dea926e20e66167b1
Created December 20, 2014 16:15
Allow or Deny Users By IP
# ALLOW USER BY IP
#<Limit GET POST>
# order deny,allow
# deny from all
# allow from 86.67.58.216
# allow from 117.222.4.100
#</Limit>
# BAN USER BY IP
<Limit GET POST>
Steps to Install Oracle Instant client and cx_Oracle on Fedora/CentOS/RHEL
1) Download Instant client from oracle website
http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
e.g. for Linux 86_64
http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
Download
1) oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm
import requests
import sys
import json
def waybackurls(host, with_subs):
if with_subs:
url = 'http://web.archive.org/cdx/search/cdx?url=*.%s/*&output=json&fl=original&collapse=urlkey' % host
else:
url = 'http://web.archive.org/cdx/search/cdx?url=%s/*&output=json&fl=original&collapse=urlkey' % host
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
unxz wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar -xvf wkhtmltox-0.12.4_linux-generic-amd64.tar
mv wkhtmltox/bin/* /usr/local/bin/
rm -rf wkhtmltox
rm -f wkhtmltox-0.12.4_linux-generic-amd64.tar