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
GRANT ALL on *.* to root@'%'; |
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
def check_module_version(module_name, version_finder=None): | |
print module_name+':', | |
try: | |
module = __import__(module_name) | |
if callable(version_finder): | |
version = version_finder(module) | |
else: | |
try: | |
version = getattr(module, '__version__') | |
except AttributeError: |
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
# List what ports are in use on OS X | |
sudo lsof -i -P | grep -i "listen" |
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
# List what ports are in use on Unix | |
sudo lsof -iTCP -sTCP:LISTEN |
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 | |
# a=2, b=3, c='acd' | |
# { 'a':2, 'b': 3, 'c': 'acd' } | |
import sys, os | |
selection = os.environ['TM_SELECTED_TEXT'] | |
try: | |
values = [x.strip() for x in selection.split(",")] |
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
import collections | |
import MySQLdb as dbapi | |
__all__ = ['MySql'] | |
class MySql(object): | |
def __init__(self, **kwargs): | |
self.connection = dbapi.connect(**kwargs) | |
self.host_name = kwargs.get('host') |
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
import sys | |
import os | |
import contextlib | |
from subprocess import Popen, PIPE | |
def die(message, error_code=1): | |
print message | |
sys.exit(error_code) |
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 jython -J-XstartOnFirstThread -Dpython.path=jms.jar:tibcrypt.jar:tibjms.jar | |
import time | |
from javax.jms import TopicConnectionFactory, MessageListener, Session | |
from com.tibco.tibjms import TibjmsQueueConnectionFactory, TibjmsTopicConnectionFactory | |
class Listener(MessageListener): | |
def onMessage(self, message): |
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 | |
# Escaped color codes | |
BLACK=`echo -e '\033[0;30m'` | |
DK_GREY=`echo -e '\033[1;30m'` | |
RED=`echo -e '\033[0;31m'` | |
PINK=`echo -e '\033[1;31m'` | |
GREEN=`echo -e '\033[0;32m'` | |
LT_GREEN=`echo -e '\033[1;32m'` | |
BROWN=`echo -e '\033[0;33m'` |
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/ruby | |
search = ARGV.first | |
manpath = `manpath`.split(':') | |
pages = Dir["/usr/share/man/man?/*"].map do |f| | |
File.basename f | |
end.map do |f| | |
f =~ /(.+?)(\.(gz|bz2|lzma|Z))?$/ | |
$1 |
OlderNewer