Skip to content

Instantly share code, notes, and snippets.

View uhlhosting's full-sized avatar
🏠
Working from home

Viorel-Cosmin Miron uhlhosting

🏠
Working from home
View GitHub Profile
@mkhl
mkhl / path_helper.patch
Created June 4, 2009 08:53
Patch to `/usr/libexec/path_helper` to prevent hangs with long `PATH`s
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=":"
@skiold
skiold / ipv6script
Created June 3, 2011 10:46
hurricane electric ipv6 tunneling script for macosx
#!/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"
@luoshu
luoshu / README
Created June 28, 2011 15:48
ipv6 hosts
#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
@vincentbernat
vincentbernat / nginx.conf
Created August 14, 2011 17:23
nginx configuration for SSL benchmark
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;
@goblindegook
goblindegook / gist:1919587
Created February 26, 2012 23:15
Adjust WordPress HTTP request timeout
<?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 );
@1stvamp
1stvamp / mac-curl-ca-bundle.sh
Created March 22, 2012 12:50
Script to install cURL CA certificates on OS X without macports
#!/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
@wycks
wycks / gist:2315279
Created April 6, 2012 00:05
Relative URLs in WordPress (hide wordpress)
<?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
@teriyakisan
teriyakisan / mod_rpaf-2.0.c.patch
Created May 17, 2012 03:30
mod_rpafのApache2.4系対応パッチ / patch file of mod_rpaf for apache 2.4+
--- 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);
@bgallagh3r
bgallagh3r / wp.sh
Last active March 24, 2024 03:12
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/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: "
@miziomon
miziomon / .htaccess | custom admin installation
Created June 27, 2012 10:54
WordPress secure .htaccess
Options All -Indexes
<files .htaccess>
Order allow,deny
Deny from all
</files>
<files wp-config.php>
Order allow,deny
Deny from all