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
Patch to `/usr/libexec/path_helper` to prevent hangs with long `PATH`s. | |
--- path_helper_bak 2009-05-07 15:54:37.000000000 +0200 | |
+++ path_helper 2009-06-04 10:51:39.000000000 +0200 | |
@@ -15,7 +15,7 @@ | |
for f in "$DIR" "$DIR".d/* ; do | |
if [ -f "$f" ]; then | |
for p in $(< "$f") ; do | |
- [[ "$NEWPATH" = *(*:)${p}*(:*) ]] && continue | |
+ egrep -q "(^|${SEP})${p}($|${SEP})" <<<"$NEWPATH" && continue | |
[ ! -z "$NEWPATH" ] && SEP=":" |
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 | |
####################################################################### | |
# Update the HE (Hurricane Electric) ipv6-tunnel | |
####################################################################### | |
# original at: http://pugio.net/2009/01/enable-ipv6-on-mac-os-x-the-tu.html | |
# Interfaces to try, in order: en1 = Airport, en0 = Ethernet | |
MYIFS="en0 en1" | |
# leave as is | |
IPCACHE="/Library/Caches/ipv6scriptIP" |
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
#Google和各种网站的IPv6服务hosts | |
#利用IPv6技术翻墙,保证Google服务可用,校园网用户使用IPv6应该不收取上网费用(至少我们学校如此) | |
#最下方有各种网站的IPv6hosts列表 | |
#欢迎转载,请注明来源,谢谢 | |
#本文的发布地址:http://docs.google.com/View?id=dfkdmxnt_61d9ck9ffq | |
#本文的共享链接:https://docs.google.com/View?docID=0ARhAbsvps1PlZGZrZG14bnRfOTVmZzR4NjRkdA&revision=_latest | |
#表格版的host列表地址:http://spreadsheets.google.com/ccc?key=0AhhAbsvps1PldEVXVzBkR3hBaWFnbEQ0OWIwMU5ycmc&hl=zh_CN | |
#Google IPv6 地址及对应证书列表(不再细分):https://docs.google.com/Doc?docid=0ARhAbsvps1PlZGZrZG14bnRfOTVmZzR4NjRkdA&hl=en |
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
user root; | |
worker_processes 2; | |
worker_rlimit_nofile 90000; | |
error_log /usr/local/nginx/logs/error.log; | |
pid /var/run/nginx.pid; | |
events { | |
use epoll; | |
multi_accept off; | |
accept_mutex off; |
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
<?php | |
function my_http_request_args ( $r ) | |
{ | |
$r['timeout'] = 15; # new timeout | |
return $r; | |
} | |
add_filter( 'http_request_args', 'my_http_request_args', 100, 1 ); |
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 | |
mkdir /tmp/curl-ca-bundle | |
cd /tmp/curl-ca-bundle | |
wget http://curl.haxx.se/download/curl-7.22.0.tar.bz2 | |
tar xzf curl-7.22.0.tar.bz2 | |
cd curl-7.22.0/lib/ | |
./mk-ca-bundle.pl | |
if [ ! -d /usr/share/curl/ ]; then | |
sudo mkdir -p /usr/share/curl/ | |
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
<?php | |
function roots_root_relative_url($input) { | |
$output = preg_replace_callback( | |
'!(https?://[^/|"]+)([^"]+)?!', | |
create_function( | |
'$matches', | |
// if full URL is site_url, return a slash for relative root | |
'if (isset($matches[0]) && $matches[0] === site_url()) { return "/";' . | |
// if domain is equal to site_url, then make URL relative |
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
--- mod_rpaf-2.0.c.org 2012-05-17 12:05:34.082130109 +0900 | |
+++ mod_rpaf-2.0.c 2012-05-17 12:16:41.648138252 +0900 | |
@@ -147,8 +147,8 @@ | |
static apr_status_t rpaf_cleanup(void *data) { | |
rpaf_cleanup_rec *rcr = (rpaf_cleanup_rec *)data; | |
- rcr->r->connection->remote_ip = apr_pstrdup(rcr->r->connection->pool, rcr->old_ip); | |
- rcr->r->connection->remote_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(rcr->r->connection->remote_ip); | |
+ rcr->r->connection->client_ip = apr_pstrdup(rcr->r->connection->pool, rcr->old_ip); | |
+ rcr->r->connection->client_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(rcr->r->connection->client_ip); |
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 -e | |
clear | |
echo "============================================" | |
echo "WordPress Install Script" | |
echo "============================================" | |
echo "Database Name: " | |
read -e dbname | |
echo "Database User: " | |
read -e dbuser | |
echo "Database Password: " |
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
<?php | |
/* | |
Plugin Name: Custom WordPress Avatars | |
Plugin URI: http://c3mdigital.com | |
Description: Adds a custom avatar uploader in the user profile to replace gravatars with a custom avatar | |
Version: 1.0 | |
Author: Chris Olbekson | |
Author URI: http://c3mdigital.com/ | |
License: GPL v2 | |
*/ |
OlderNewer