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
# | |
# Licensed to the Apache Software Foundation (ASF) under one or more | |
# contributor license agreements. See the NOTICE file distributed with | |
# this work for additional information regarding copyright ownership. | |
# The ASF licenses this file to You under the Apache License, Version 2.0 | |
# (the "License"); you may not use this file except in compliance with | |
# the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.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
#Hadoop 2.6.0 Multinode cluster Setup | |
From Blog http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-multi-node-cluster/ | |
###Machine 1(master). | |
Prequisite: | |
java version | |
java -version |
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
<html> | |
<head> | |
<title>Testing</title> | |
<script language="javascript"> | |
fields = 1; | |
function addInput() { | |
if (fields < 4) { | |
document.getElementById('text').innerHTML += "<input type='file'"+ "name=" + "thumdals" + fields + " value=''/><br />"; | |
fields += 1; | |
} else { |
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
/* =================================================== | |
* jQuery SelectAll plugin | |
* =================================================== | |
* @author: https://gist.github.com/Leegorous | |
* @license: Licensed under the Apache License, Version 2.0 (the "License"), | |
* see http://www.apache.org/licenses/LICENSE-2.0 | |
* =================================================== | |
* | |
* Example: | |
* |
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 ImageWithThumbnail(models.Model): | |
name = models.CharField(max_length = 255) | |
image = models.ImageField(upload_to=settings.UPLOAD_ROOT,max_length=500,blank=True,null=True) | |
thumbnail = models.ImageField(upload_to=settings.UPLOAD_ROOT,max_length=500,blank=True,null=True) | |
def create_thumbnail(self): | |
# original code for this method came from | |
# http://snipt.net/danfreak/generate-thumbnails-in-django-with-pil/ |
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
#!/usr/bin/env python | |
import os | |
from subprocess import check_call | |
waittime = 5 | |
if len(sys.argv)>1: | |
waittime = int(sys.argv[1]) | |
# print waittime |
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
#!/usr/bin/env python | |
import os | |
import time | |
username = 'root' | |
defaultdb = 'postgres' | |
port = '5433' | |
backupdir='/www/backup/' | |
date = time.strftime('%Y-%m-%d') |
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 | |
#script extraido de: http://paulocassiano.wordpress.com/2008/08/29/deixando-o-gedit-com-a-cara-do-textmate/ | |
#tip for better "resolution" here: http://blog.siverti.com.br/2008/05/22/fonte-monaco-no-ubuntugedit/ | |
cd /usr/share/fonts/truetype/ | |
#TODO: put validation if folder already exists | |
sudo mkdir ttf-monaco |
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
global | |
pidfile /var/run/haproxy.pid | |
log 127.0.0.1 local0 info | |
ulimit-n 65536 | |
defaults | |
mode http | |
clitimeout 600000 # maximum inactivity time on the client side | |
srvtimeout 600000 # maximum inactivity time on the server side |