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
class Product(ContentModel): | |
tablename = "product_data" | |
def set_properties(self): | |
ckeditor = CKEditor() | |
T = current.T | |
self.fields = [ | |
Field("price", "double", notnull=True, default=0), | |
Field("manufacturer", "string", notnull=True), | |
Field("in_stock", "boolean", notnull=True, default=True), |
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/python | |
import subprocess | |
while 1: subprocess.Popen("mysql -u root mysql --password=blah",shell=True).wait() |
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
from __future__ import with_statement | |
from fabric.api import env, run, settings, hide, local | |
from fabric.decorators import hosts, runs_once | |
import os | |
import pip | |
import sys, xmlrpclib | |
from cStringIO import StringIO | |
from distutils.version import StrictVersion, LooseVersion | |
def _find_current_version(package, index_urls=None): |
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
jquitheme={} | |
jquitheme["http://www.stormondemand.com"]=''' | |
http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight= |
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 | |
# -*- coding: utf-8 -*- | |
import urllib2 | |
gh_url = 'https://api.github.com' | |
req = urllib2.Request(gh_url) | |
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm() |
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
# The following script allows to export a SimpleGeo Storage layer to a CSV | |
# You have to change the credentials and the layer that you want to export | |
# It will generate a CSV file with the name of the layer | |
# | |
# Author: Javier de la Torre ([email protected] @jatorre) | |
#Adapt the following to your SimpleGeo credentials. Get it from the UI. | |
oauth_token="token" | |
oauth_secret="secret" |
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 | |
# encoding: utf-8 | |
""" | |
Aggregate the number of nominees by outcome for each congress since the 107th | |
""" | |
import csv | |
import sys | |
import os |
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 | |
"""mysql-replace-tables-live | |
Replace live, in use, MySQL tables without restarting or interrupting | |
dependent applications. | |
http://code.google.com/p/mysql-replace-tables-live/ | |
By Richard Bronosky, offered under the MIT License | |
http://www.opensource.org/licenses/mit-license.php | |
Sometimes you find yourself needing to replace tables on production servers. |
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
sudo iptables -F | |
sudo iptables -A INPUT -i lo -j ACCEPT | |
sudo iptables -A INPUT -i ! lo -d 127.0.0.0/8 -j REJECT | |
sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
sudo iptables -A OUTPUT -j ACCEPT | |
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT | |
sudo iptables -A INPUT -p tcp --dport 10000 -j ACCEPT | |
sudo iptables -A INPUT -p tcp --dport 443 -j ACCEPT | |
sudo iptables -A INPUT -p tcp --dport 3333 -j ACCEPT | |
sudo iptables -A INPUT -p tcp --dport 3000 -j ACCEPT |
NewerOlder