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 | |
# GTK+ and Firefox for Amazon Linux | |
# Written by Joseph Lawson 2012-06-03 | |
# http://joekiller.com | |
# http://joekiller.com/2012/06/03/install-firefox-on-amazon-linux-x86_64-compiling-gtk/ | |
# chmod 755 ./gtk-firefox.sh | |
# sudo ./gtk-firefox.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
import MySQLdb, MySQLdb.cursors, time | |
skip_errno=1677L | |
db_user='' | |
db_passwd='' | |
db_host='' | |
db_db = '' | |
connection = MySQLdb.connect(host=db_host, user=db_user, passwd=db_passwd, db=db_db,cursorclass=MySQLdb.cursors.DictCursor, charset='UTF8') | |
cursor = connection.cursor() |
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
# get_ip is from http://stackoverflow.com/questions/166506/finding-local-ip-addresses-using-pythons-stdlib, added a fallback to making a connection for OS X/local testing | |
def get_ip(iface = 'eth0'): | |
import socket, struct, fcntl | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
sockfd = sock.fileno() | |
SIOCGIFADDR = 0x8915 | |
ifreq = struct.pack('16sH14s', iface, socket.AF_INET, '\x00'*14) |
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
* * * * * root /usr/local/bin/normalize_php_fpm_cpu_affinity.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
foreach ($post->post_meta as $key => $value) { | |
$post->post_meta[ $key ] = ( isset( $value[0] ) && count( $value ) == 1 ) ? $value[0] : $value; | |
} |
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
cd ~ && | |
sudo yum -y install mysql libtiff libXpm t1lib libc-client libmcrypt libtool-ltdl libicu cyrus-sasl-ldap freetds unixODBC aspell recode net-snmp libtidy ImageMagick libxslt libxml2 && | |
sudo yum -y install libxml2-devel ImageMagick-c++-devel ImageMagick-devel aspell-devel freetds-devel libXpm-devel libc-client-devel libicu-devel libmcrypt-devel libtidy-devel libtiff-devel libtool-ltdl-devel libxslt-devel mysql-devel net-snmp-devel recode-devel t1lib-devel unixODBC-devel pcre-devel libcurl-devel libpng-devel libtiff-devel libjpeg-devel gmp-devel openldap-devel readline-devel libedit-devel && | |
sudo yum -y install rubygems gcc ruby-devel && | |
sudo gem install fpm && | |
wget http://www.php.net/distributions/php-5.4.17.tar.bz2 && | |
bunzip2 php-5.4.17.tar.bz2 && | |
tar -xvf php-5.4.17.tar && | |
cd php-5.4.17 && | |
./configure '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-amazon-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/us |
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
## | |
# Copyright (c) 2010 Mochi Media, Inc. All rights reserved. | |
# | |
# Licensed 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 | |
# | |
# Unless required by applicable law or agreed to in writing, software |
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 unserialize_session(val): | |
if not val: | |
return | |
session = {} | |
groups = re.split("([a-zA-Z0-9_]+)\|", val) | |
if len(groups) > 2: | |
groups = groups[1:] | |
groups = map(None, *([iter(groups)] * 2)) | |
for i in range(len(groups)): |
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
service mysql stop; yum -y remove MySQL-client MySQL-shared MySQL-server; yum -y install Percona-Server-shared-56.x86_64 Percona-Server-client-56.x86_64 Percona-Server-server-56.x86_64; service mysql start |
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
diff --git a/client/mysql.cc b/client/mysql.cc | |
index d8c7ae2..c78b5d8 100644 | |
--- a/client/mysql.cc | |
+++ b/client/mysql.cc | |
@@ -238,8 +238,8 @@ static my_bool execute_buffer_conversion_done= 0; | |
The same is true for stderr. | |
*/ | |
static uint win_is_console_cache= | |
- (test(my_win_is_console(stdout)) * (1 << _fileno(stdout))) | | |
- (test(my_win_is_console(stderr)) * (1 << _fileno(stderr))); |
OlderNewer