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 | |
HOST=$(hostname) | |
function install_postfix() { | |
echo | sudo debconf-set-selections <<__EOF | |
postfix postfix/root_address string | |
postfix postfix/rfc1035_violation boolean false | |
postfix postfix/mydomain_warning boolean | |
postfix postfix/mynetworks string 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 |
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
using System; | |
using System.Data; | |
using System.Data.Odbc; | |
public class Test | |
{ | |
public static void Main(string[] args) | |
{ | |
// have an ODBC DSN setup named MYSQLDSN | |
// that accesses a MySQL database via |
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
#!/usr/bin/env python | |
import functools, logging | |
from django.utils import simplejson | |
def safeweb(srcfunc): | |
def decorated(self, *vargs, **kwargs): | |
try: | |
return srcfunc(self, *vargs, **kwargs) |
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
#!/usr/bin/env python | |
import datetime | |
from django.utils import simplejson | |
def jsondefault(self, data): | |
#### logging.warn( data ) | |
if isinstance(data , datetime.date ): | |
data = data.strftime("%Y-%m-%d") | |
if isinstance(data , datetime.datetime ): |
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/sh -x | |
#svnadmin create file:$PWD/$( basename $1 ) | |
URL1=$( echo $1 | sed -e 's/\/trunk\///' ) | |
NAMING=$( echo $URL1 | sed -e 's/\/\/*/\//g;s/\/$//' | rev | cut -d/ -f1-2 | rev | tr / _ ) | |
echo $URL1 | |
echo $NAMING | |
###exit | |
NAMING=SVFS-$NAMING | |
svnadmin create $NAMING | |
( echo "#!/bin/sh" ; echo exit 0 ) > $NAMING/hooks/pre-revprop-change |
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
curl http://gist.github.com/gists/574260/download | tar xfz - | |
mv ./gist*/test.sh test.sh | |
chmod u+x test.sh | |
./test.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
if os.isatty(sys.stderr.fileno() ): | |
logging.getLogger().setLevel(logging.DEBUG) | |
logging.basicConfig( format='%(asctime)s %(levelname)s %(module)s:%(lineno)s %(message)s' ) |
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
#define _LP64 1 | |
#define __CHAR_BIT__ 8 | |
#define __DBL_DENORM_MIN__ 4.9406564584124654e-324 | |
#define __DBL_DIG__ 15 | |
#define __DBL_EPSILON__ 2.2204460492503131e-16 | |
#define __DBL_HAS_INFINITY__ 1 | |
#define __DBL_HAS_QUIET_NAN__ 1 | |
#define __DBL_MANT_DIG__ 53 | |
#define __DBL_MAX_10_EXP__ 308 | |
#define __DBL_MAX_EXP__ 1024 |
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
#!/usr/bin/env python | |
#https://gist.github.com/635194 | |
import logging | |
from google.appengine.ext import db | |
__all__ = [ | |
"bulkinsert", | |
] |
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
uint32_t murmur3_32(const char *key, uint32_t len, uint32_t seed) { | |
static const uint32_t c1 = 0xcc9e2d51; | |
static const uint32_t c2 = 0x1b873593; | |
static const uint32_t r1 = 15; | |
static const uint32_t r2 = 13; | |
static const uint32_t m = 5; | |
static const uint32_t n = 0xe6546b64; | |
uint32_t hash = seed; |
OlderNewer