Skip to content

Instantly share code, notes, and snippets.

@wadap
wadap / for apache1.3x
Created August 2, 2013 13:44
support.patch
共通の下位ディレクトリー: support.org/SHA1とsupport/SHA1
diff -cN support.org/htdigest.c support/htdigest.c
*** support.org/htdigest.c 2006-07-12 08:16:05.000000000 +0000
--- support/htdigest.c 2013-08-02 13:39:12.591655724 +0000
***************
*** 71,77 ****
while ((line[y++] = line[x++]));
}
! static int getline(char *s, int n, FILE *f)
@wadap
wadap / iptables.sh
Created May 21, 2013 06:01
iptables for localnet
#!/bin/sh
#
# iptables script for local servers
# by [email protected]
#
# SET PATH
PATH=$PATH:/sbin/:/usr/sbin/
# localnetwork
LOCALNET='10.0.0.0/8'
--- mod_extract_forwarded.c.orig 2004-03-09 00:27:36.000000000 +0900
+++ mod_extract_forwarded.c 2007-04-18 10:27:08.945045803 +0900
@@ -758,7 +758,7 @@
{
if (conf->debug == MEF_DEBUG_ON)
{
- fprintf(stderr,"MEF: phase:%s, $s not acceptabler proxy, %s\n",
+ fprintf(stderr,"MEF: phase:%s, %s not acceptabler proxy, %s\n",
phase, conn->remote_ip, r->unparsed_uri);
fflush(stderr);
@wadap
wadap / td_query.sql
Last active December 15, 2015 18:58
URL/検索クエリの流入数の調査
SELECT
url,
search_query,
COUNT(1) AS count
FROM
na_log
WHERE
referrer_host IN ("www.google.co.jp", "search.yahoo.co.jp", "www.google.com", "search.smt.docomo.ne.jp")
AND
TD_TIME_RANGE (TIME ,TD_TIME_ADD (TD_SCHEDULED_TIME (),"-1day"),TD_SCHEDULED_TIME (),"JST")
#!/bin/sh
# browsecap 更新
FILE=php_browscap.ini
DST=/usr/local/php5.3/lib
TMP=/var/tmp
URL="http://tempdownloads.browserscap.com/stream.php?PHP_BrowsCapINI"
curl $URL | tee $DST/$FILE > /dev/null
chown root:root $DST/$FILE
2013-03-25 16:09:25 +0900: Size of the emitted data exceeds buffer_chunk_limit.
2013-03-25 16:09:25 +0900: This may occur problems in the output plugins ``at this server.``
2013-03-25 16:09:25 +0900: To avoid problems, set a smaller number to the buffer_chunk_limit
2013-03-25 16:09:25 +0900: in the forward output ``at the log forwarding server.``
#!/bin/sh
WORKDIR=$HOME/chef
TMPDIR=/tmp/chef-solo
# setup
yum install -y gcc zlib-devel openssl-devel
\curl -L https://get.rvm.io | bash -s stable --ruby
. /etc/profile.d/rvm.sh
gem install chef --no-ri --no-rdoc