Skip to content

Instantly share code, notes, and snippets.

そなー cs-sonar

Block or report user

Report or block cs-sonar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cs-sonar
cs-sonar / bitbucket_issues.rb
Created Mar 11, 2015
bitbucketに登録されたりコメントされたりしたissuesをslackで通知する
View bitbucket_issues.rb
# -*- coding: utf-8 -*-
require 'net/http'
require "json"
require 'time'
########
# config
########
# crontabに登録は以下のような感じで
@cs-sonar
cs-sonar / composer.json
Created Sep 2, 2014
fuelphp1.7.2 composer.json
View composer.json
{
"name": "fuel/fuel",
"type": "project",
"description" : "FuelPHP is a simple, flexible, community driven PHP 5.3+ framework, based on the best ideas of other frameworks, with a fresh start!",
"keywords": ["application", "website", "development", "framework", "PHP"],
"license": "MIT",
"require": {
"php": ">=5.3.3",
"composer/installers": "~1.0",
"monolog/monolog": "1.5.*",
View gist:ed656b7397cb4dcc22c3

rest controllerでのログインチェック

restコントローラーではbefore内で、全体のログインチェックを行う事が出来ない。

fuel/app/classes/api.php

class Controller_Api extends \Fuel\Core\Controller_Rest
@cs-sonar
cs-sonar / apache_restert.sh
Created Jul 29, 2013
netstatとかロードアベレージの閾値を超えたらログを残しつつApache再起動
View apache_restert.sh
#!/bin/sh
######
# netstatの80が400越えたら再起動
#####
apacheprocess=`netstat -an | grep :80 | wc -l`
if [ $apacheprocess -gt 400 ]; then
@cs-sonar
cs-sonar / 001_create_sessions.php
Created Jul 16, 2013
fuelphpのセッションテーブルを作るmigrationファイル
View 001_create_sessions.php
<?php
namespace Fuel\Migrations;
class Create_sessions
{
public function up()
{
\DBUtil::create_table('sessions', array(
'session_id' => array('constraint' => 40, 'type' => 'varchar', 'null' =>false),
View ccc.php
<?php
/**
* http://kore1server.com/create-your-site/build-your-own-site/234-fuelphp-code-completion-code-grnerator.html
*/
namespace Fuel\Tasks;
/**
@cs-sonar
cs-sonar / make_user.sh
Last active Dec 17, 2015
一行の実行でLinuxユーザーを作るシェルスクリプト
View make_user.sh
#!/bin/sh
#
#[使い方]
#
#実行権限を与える
# chmod 755 ./useradd.sh
#
#第一引数にユーザー名、第二引数にパスワードを書いて実行
# ./useradd.sh username passwd
#
View queue_del.sh
#!/bin/sh
echo "deleting bounce queue \n";
rm -f /var/qmail/queue/bounce/*/*
echo "deleting remote queue \n";
rm -f /var/qmail/queue/remote/0/*
rm -f /var/qmail/queue/remote/1/*
rm -f /var/qmail/queue/remote/2/*
rm -f /var/qmail/queue/remote/3/*
rm -f /var/qmail/queue/remote/4/*
You can’t perform that action at this time.