Skip to content

Instantly share code, notes, and snippets.

View HTMLScraping.class.php.fileschema.patch
228c228
< if (!preg_match('/^(https?|file):\/\/+/i', $url)) {
---
> if (!preg_match('/^https?:\/\/\w[\w\-\.]+/i', $url)) {
231d230
<
233,434c232,239
< if (preg_match('/^https?:\/\/\w[\w\-\.]+/i', $url)) {
< $cache_lifetime = (int) $cache_lifetime;
< $use_cache = !empty($this->cacheDir) and $cache_lifetime > 0;
@kaz29
kaz29 / apc_install.sh
Created May 28, 2011
CakePHP setup on NiftyCloud
View apc_install.sh
#!/bin/sh
# APCをインストール
pecl install apc
cat <<_EOT_ 1>/etc/php.d/apc.ini
extension=apc.so
_EOT_
service httpd restart
@kaz29
kaz29 / cakephp2_on_nifyucloud_centos5_6.sh
Created Oct 13, 2011
CakePHP2.0.0 setup on NiftyCloud CentOS5.6
View cakephp2_on_nifyucloud_centos5_6.sh
#!/bin/sh
CAKEPHP_PAH=/usr/local/app
if [ ! -d $CAKEPHP_PAH ]
then
mkdir $CAKEPHP_PAH
fi
# IPアドレスを取得
IPADDR=`ip addr show | grep eth0 | grep 'inet *' | awk '{print $2;}' | cut -f1 -d '/'`
@kaz29
kaz29 / Controller_InstancesController.php
Created Oct 15, 2011
PHPMatsuri2011 NiftyCloud Workshop
View Controller_InstancesController.php
<?php
// メンバ変数を追加
public $uses = array(
'NiftyCloudControllPanel.Instance',
'NiftyCloudControllPanel.KeyPair',
'NiftyCloudControllPanel.SecurityGroup',
);
/// アクションを追加
public function run($id=null)
@kaz29
kaz29 / step 1
Created Oct 15, 2011
PHPMatsuri2011 NiftyCloud Workshop2
View step 1
cd /usr/local/app/cakephp/vendors/
git clone git://github.com/kaz29/unofficial-niftycloud-sdk-for-php.git \
NiftyCloud
@kaz29
kaz29 / startup.sh
Created Oct 28, 2011
CakePHP2.0.0 setup on NiftyCloud CentOS5.6 plain startup script
View startup.sh
#!/bin/sh
# CakePHP2.0 setup script
# Only for CentOS 5.6 64bit Plain
/bin/cat <<EOF >> /etc/rc.d/rc.local
curl https://raw.github.com/gist/1284739/2fbed6559815413523cda708d99eb18f9926428a/cakephp2_on_nifyucloud_centos5_6.sh | sh | tee /root/_setup.log
/bin/sed -i.orig -e "s/curl/#curl/g" /etc/rc.d/rc.local
/bin/sed -i.orig -e "s/\/bin\/sed/#\/bin\/sed/g" /etc/rc.d/rc.local
EOF
@kaz29
kaz29 / find-1.php
Created Dec 14, 2011
CakePHP Advent Calendar 2011/12/14
View find-1.php
<?php
// @ operator
// compare to circle
$conditions = array(
'loc @' => array('circle' => array('point'=> array(10.1,10.1), 100)),
);
// order by distance
$order = array(
'loc <-> point(10.1,10.1)'
);
@kaz29
kaz29 / cakephp2.sh
Created Jan 8, 2012
CakePHP Setup Script for NiftyCloud - Ubuntu 10.04 64bit Plain
View cakephp2.sh
#!/bin/sh
export CAKEPHP_VERSION=2.0.5
export CAKEPHP_PATH=/usr/local/app
if [ ! -d $CAKEPHP_PATH ]
then
mkdir $CAKEPHP_PATH
fi
# IPアドレスを取得
@kaz29
kaz29 / basercms.sh
Created Jan 8, 2012
baserCMS Setup Script for NiftyCloud - Ubuntu 10.04 64bit Plain
View basercms.sh
#!/bin/sh
export BASERCMS_PATH=/usr/local/app
if [ ! -d $BASERCMS_PATH ]
then
mkdir $BASERCMS_PATH
fi
# IPアドレスを取得
export IPADDR=`ip addr show | grep eth0 | grep 'inet *' | awk '{print $2;}' | cut -f1 -d '/'`
@kaz29
kaz29 / td-agetnt.sh
Created Jan 12, 2012
td-agent setup for NiftyCloud - CentOS 5.6 64bit Plain
View td-agetnt.sh
#!/bin/sh
# apache,fluent-plugin-s2が依存するパッケージをインストール
yum -y install httpd.x86_64 \
libxml2-devel.x86_64 libxslt-devel.x86_64
# td-agent 用のリポジトリを登録
cat <<_EOT_ 1>/etc/yum.repos.d/td.repo
[treasuredata]
name=TreasureData
You can’t perform that action at this time.