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
class MyPBKDF2PasswordHasher(PBKDF2PasswordHasher): | |
iterations = 12000 |
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
# | |
# in the remote (client) machine | |
# | |
sudo ssh -o PermitLocalCommand=yes \ | |
-o LocalCommand="sudo ifconfig tun1 192.168.123.2 pointopoint 192.168.123.1 netmask 255.255.255.0" \ | |
-TC -w 1:1 root@ip-of-the-machine-with-the-virtual-servers \ | |
'ifconfig tun1 192.168.123.1 pointopoint 192.168.123.2 netmask 255.255.255.0; echo tun ready' | |
# |
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
#! /bin/sh | |
# | |
# ntpd-samba Control the NTP server | |
# | |
# chkconfig: - 90 10 | |
# Source function library. | |
. /etc/rc.d/init.d/functions | |
RETVAL=0 |
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 logging | |
import fcntl | |
import os | |
from optparse import make_option | |
from django.core.management.base import BaseCommand | |
logger = logging.getLogger(__name__) |
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
#!/bin/bash | |
#STATE_OK=0 | |
#STATE_WARNING=1 | |
#STATE_CRITICAL=2 | |
#STATE_UNKNOWN=3 | |
#STATE_DEPENDENT=4 | |
STATUS_OK="OK" | |
STATUS_WARNING="WARNING" |
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
#!/bin/bash | |
TMP=$(mktemp) | |
for IP in $(dig +short 1.south-america.pool.ntp.org) ; do | |
rm -f $TMP > /dev/null 2> /dev/null | |
/usr/lib/nagios/plugins/check_ntp -H $IP > $TMP 2>&1 | |
EXIT_STATUS=$? | |
if [ "$EXIT_STATUS" -eq 0 ] ; then |
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
#!/bin/bash | |
# | |
# TODO: use time from `time` command, not from 'end-start' | |
# | |
if [ -z "$(which exiv2)" ] ; then | |
echo "ERROR: exiv2 required. On Ubuntu, install with 'sudo apt-get install exiv2'" | |
exit 1 | |
fi |
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
class Article(models.Model): | |
headline = models.CharField(max_length=100, default='Default headline') | |
pub_date = models.DateTimeField() | |
Meta: | |
optimistic_locking = True |
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
class Article(models.Model): | |
headline = models.CharField(max_length=100, default='Default headline') | |
pub_date = models.DateTimeField() | |
version = models.VersionField() |
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
#! /bin/sh | |
# | |
# Snorby Control the Unicorn+Snorby server | |
# | |
# chkconfig: - 90 10 | |
# config: /home/snorby/snorby/unicorn.conf.rb | |
# pidfile: /var/run/snorby/unicorn.pid | |
# Source function library. | |
. /etc/rc.d/init.d/functions |
NewerOlder