- Install SQUID
apt-get install squid
- Create an user
htpasswd -md /etc/squid3/users myuserlogin`
def national_code_generator(): | |
number_list = [] | |
_sum = 0 | |
out = "" | |
for i in reversed(range(2, 11)): | |
_j = random.randint(0, 9) | |
number_list.append(str(_j)) | |
_sum += _j * i | |
_m = _sum % 11 | |
if _m < 2: |
#!/bin/bash | |
IPT="/sbin/iptables" | |
# Server IP | |
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')" | |
# Your DNS servers you use: cat /etc/resolv.conf | |
DNS_SERVER="8.8.4.4 8.8.8.8" | |
# Allow connections to this package servers |
from django.db import models | |
class Person(models.Model): | |
name = models.CharField(max_length=200) | |
groups = models.ManyToManyField('Group', through='GroupMember', related_name='people') | |
class Meta: | |
ordering = ['name'] | |
def __unicode__(self): |
$(document).ready(function () { | |
$("#approval_form").validate(); | |
$('input[type=radio][name=status]').on('change', function () { | |
switch ($(this).val()) { | |
case '1': | |
console.log('case 1'); | |
$("#id_notes").rules('remove', 'required'); | |
break; | |
case '0': |
<a onclick="$('#datepicker').datepicker('setDate','c-1y');">Prev Year</a> | |
<a onclick="$('#datepicker').datepicker('setDate','c-1m');">Prev Month</a> |
from django.core.exceptions import ImproperlyConfigured | |
from django.contrib import messages | |
class SuccessMessageMixin(object): | |
success_message = None | |
def get_success_message(self): | |
if self.success_message: |
# Copyright (c) 2012, Vehbi Sinan Tunalioglu <[email protected]> | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions | |
# are met: | |
# | |
# - Redistributions of source code must retain the above copyright | |
# notice, this list of conditions and the following disclaimer. | |
# |
apt-get install squid
htpasswd -md /etc/squid3/users myuserlogin`
# coding: utf-8 | |
from django.contrib import admin | |
from django.contrib.auth.models import Group, User | |
from django.contrib.auth.admin import GroupAdmin, UserAdmin | |
from django.utils.translation import ugettext_lazy as _ | |
class CustomUserAdmin(UserAdmin): | |
fieldsets = ( |