Skip to content

Instantly share code, notes, and snippets.

@kashiwasan
kashiwasan / useradd_script.sh
Created March 12, 2016 16:10
サーバ管理用(ユーザ追加・管理)
#!/bin/bash
# 使い方: ./useradd_scirpt.sh username password
# 注意: XXXXXX の部分を mysql のrootパスワードに置き換えてください。
useradd -G wheel $1
echo $2 | passwd --stdin $1
su $1 -c "ssh-keygen"
su $1 -c "touch ~/.ssh/authorized_keys"
su $1 -c "mkdir ~/public_html/"
su $1 -c "chmod 0777 ~/public_html/"
ln -s /home/$1/public_html /var/www/html/$1
@kashiwasan
kashiwasan / member_model.class.php
Last active March 21, 2016 04:59
Original Model Classes
<?php
class Member extends Model {
protected $tableName = 'members';
}
#!/bin/bash
# yum install firefox
wget "http://download.mozilla.org/?product=firefox-43.0-SSL&os=linux&lang=ja"
tar jxvf firefox-43.0.tar.bz2
cp -frp firefox /usr/local/firefox43
mv /usr/bin/firefox{,.bak}
ln -s /usr/local/firefox43/firefox /usr/bin/.
@kashiwasan
kashiwasan / mosquito.php
Created December 8, 2012 15:39
モスキート音認証
<?php
// モスキート音認証
// バージョン 1.1
// 作者: 園田 裕大
//    柏木 祥太
// サイト: http://www.0319.jp/
// ライセンス: PHP License
// This product includes PHP, freely available from http://www.php.net/
/////////////// 定義 ////////////////
@kashiwasan
kashiwasan / opJsonApiTest.php
Created March 31, 2012 10:10
JsonApi 単体テストスクリプト
<?php
$app = 'api';
include_once dirname(__FILE__) . '/../../bootstrap/unit.php';
include_once dirname(__FILE__) . '/../../bootstrap/database.php';
$configuration = ProjectConfiguration::getApplicationConfiguration('api', 'prod', isset($debug) ? $debug : true);
sfContext::createInstance($configuration);
$numOfTest = 42;
@kashiwasan
kashiwasan / message_list.json
Created February 6, 2012 03:44
message_list.json
{"status":"success","data":[{"id":1,"member":{"id":1,"profile_image":"http:\/\/example.com\/images\/no_image.gif","profile_url":"http:\/\/example.com\/member\/1","friend":"false","blocking":"false"},"title":"(title)","created_at":"Thu, 05 Jan 2012 14:03:40 +0900"},{"id":2,"member":{"id":2,"profile_image":"http:\/\/example.com\/images\/no_image.gif","profile_url":"http:\/\/example.com\/member\/2","friend":"false","blocking":"false"},"title":"(title2)","created_at":"Thu, 06 Jan 2012 14:03:40 +0900"}]}
@kashiwasan
kashiwasan / mail_generator.php
Created January 12, 2012 12:16
mailaddress generator for coreserver
<?php
/***************************
(c) mail address generator for coreserver
@author : kashiwasan <pc.kashiwasan@gmail.com>
****************************/
// ベースドメインを指定
$domain = "example.com";
@kashiwasan
kashiwasan / .htaccess
Created December 13, 2011 07:32 — forked from tejima/.htaccess
p.kslive.jp
RewriteEngine On
RewriteRule ([0-9]+)/([0-9A-Za-z]+\.(jpg|png)) ./index.php?src=http://dl.dropbox.com/u/20190621/p/$2&q=100&aoe=0&w=$1 [L]
RewriteRule ([0-9]+\.(jpg|png)) ./index.php?src=http://dl.dropbox.com/u/20190621/p/$1&q=100 [L]
@kashiwasan
kashiwasan / openpneFastInstallTask.class.php
Created November 25, 2011 08:40 — forked from 77web/openpneFastInstallTask.class.php
(kashiwagi fixed) 1行コマンドでインストールができるopenpne:fast-installタスクの提案。
<?php
/**
* This file is part of the OpenPNE package.
* (c) OpenPNE Project (http://www.openpne.jp/)
*
* For the full copyright and license information, please view the LICENSE
* file and the NOTICE file that were distributed with this source code.
*/
@kashiwasan
kashiwasan / gist:1269655
Created October 7, 2011 07:03
OpenPNE3 Azure SQL (INSERT)
INSERT INTO sns_term (name,application) VALUES ('friend','pc_frontend'),('friend','mobile_frontend'),('my_friend','pc_frontend'),('my_friend','mobile_frontend'),('community','pc_frontend'),('community','mobile_frontend'),('nickname','pc_frontend'),('nickname','mobile_frontend'),('activity','pc_frontend'),('activity','mobile_frontend'),('post_activity','pc_frontend'),('post_activity','mobile_frontend');
INSERT INTO sns_term_translation (value,lang) VALUES ('friend','en'),('フレンド','ja_JP'),('friend','en'),('フレンド','ja_JP'),('my friend','en'),('マイフレンド','ja_JP'),('my friend','en'),('マイフレンド','ja_JP'),('community','en'),('コミュニティ','ja_JP'),('community','en'),('コミュニティ','ja_JP'),('nickname','en'),('ニックネーム','ja_JP'),('nickname','en'),('ニックネーム','ja_JP'),('activity','en'),('アクティビティ','ja_JP'),('activity','en'),('アクティビティ','ja_JP'),('Post Activity','en'),('アクティビティ投稿','ja_JP'),('Post Activity','en'),('投稿','ja_JP');
INSERT INTO sns_config (name,value) VALUES ('OpenPNE_revision','46'),('opAshiatoPlugin_revision','3'),('opAuth