2017-01-01から1年間の記事一覧

redis classをベタで書く

redis = new Redis(); if (!$this->redis->connect($hostname, $port)) { throw new Exception('fail connect redis server.'); } } /** * */ public function __destruct() { $this->…

sql order by

SELECT * FROM userswhere prefecture_id = 13and deleted_at is not nullorder by created_at > current_time() desc, created_at != '0000-00-00 00:00:00' asc, created_at asc; created_at > current_time() の結果を0,1 で判断し、desc or asc で並び替…

EC2新規作成 php version

基本はいつもどおり CentOS7+nginx+php7+MariaDBの環境構築 - Qiita これでいけるけど、 なぜかphp のversionが古い yum remove php-* httpd-* AWS EC2 Amazon Linux 2016.09 + nginx + PHP7.0でサーバー構築 - Qiita sudo yum install php70 sudo yum insta…

正規表現メモ ひらがな カタカナ

ひらがな function check_hiragana( $str ) { mb_regex_encoding('UTF-8'); $result = true; if (!preg_match("/^[ぁ-ゞー]+$/u",$str)) { $result = false; } return $result;} カタカナ function check_katakana( $str ) { mb_regex_encoding('UTF-8'); $r…

9/23

尊敬できる先輩起業家を間近で見て悔しかった。 自分がやりたい、作りたいと思う、自分の理想に近い経営を目の前で見せつけられた。 プロダクト、組織づくり、メンバーのキャリア育成、経営哲学、すべてにおいてブレない。 24h仕事のこと考えて楽しそうなの…

9/19

朝目標、todoリストつくったか no事業アイディア思いついたか no ダイエットキュレーション × 何か 考える時間は取れたか yes 事業リサーチしたか no 今日新たに10個海外サービス知れたか 今日のよかったこと 中目のスタバに仮想通貨の本があったから読んで…

SJISにencodeする

ini_set('memory_limit', '512M'); $file_path = '~/Desktop/file_name.csv'; $data = file_get_contents($file_path, true);$sjis_data = mb_convert_encoding($data, "SJIS"); file_put_contents($file_path, $sjis_data);

embulk 環境設定

wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u65-b17/jdk-8u65-linux-x64.rpmyum localinstall jdk-8u40-linux-x64.rpmcurl --create-dirs -o ~/…

php 静的解析

phpdcd インストールwget https://phar.phpunit.de/phpdcd.pharchmod +x phpdcd.pharmv phpdcd.phar /usr/local/bin/phpdcd https://github.com/sebastianbergmann/phpdcd phpmd インストールhttps://matome.naver.jp/odai/2134971273831838401 phpunit inst…

mysql 外部からアクセスを許可する

ローカルでの設定 mysql ユーザー許可ポート追加grant all privileges on *.* to ユーザー名@"%" identified by 'password' with grant option; grant all privileges on *.* to root@"%" identified by 'root' with grant option; vim /etc/my.cnfbind-addr…

SSL作成方法

一般的なSSLの作成方法を記載します。 SHA-2の発行方法です。 OpenSSLのバージョン確認 ターミナルで下記コマンドを実行します。 # openssl version OpenSSL 1.0.1e-fips 11 Feb 2013 秘密鍵の作成 ディレクトリの作成(Apacheの設定ファイルが入っているディ…

SSL作成方法

SSL作成方法(Apache2) Introduction 一般的なSSLの作成方法を記載します。 SHA-2の発行方法です。 OpenSSLのバージョン確認 ターミナルで下記コマンドを実行します。 # openssl version OpenSSL 1.0.1e-fips 11 Feb 2013 秘密鍵の作成 ディレクトリの作成(Ap…

apatch vhosts

vim /etc/httpd/vhost/~.com.conf ``` <VirtualHost *:80> DocumentRoot "/home/vhosts/www/htdocs/" ServerName www.domain.com ErrorLog "/home/vhosts/www/logs/error.log" <Directory "/home/vhosts/www/htdocs/"> Options FollowSymLinks IncludesNoExec AllowOverride All Deny from none </Directory></VirtualHost>…

機種依存文字の抽出

PHP で機種依存文字をフィルタリングする関数を作ってみた | ウェブル $pdc = '①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮⑯⑰⑱⑲⑳㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡㍻〝〟㏍㊤㊥㊦㊧㊨㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪纊褜鍈銈蓜俉炻昱棈鋹曻彅晥晗晙晴晳暙暠暲暿涖涬淏淸淲淼渹湜…

CasperJS 導入

npm install -g casperjs npm install -g phantomjs casperjs test registration.js

redis コマンド

redis ログイン redis-cli 削除 flushall

redis 外につなぐ

ss -an | grep 6379 ポート開ける firewall きる 許可ip たす bind /etc/init.d/redis /etc/redis.conf /var/run/redis/redis.pid redisサーバー構築メモ - @Konboi memo Redis Desktop Managerを使ってみる - Qiita

ディレクトリの中の文字列grep

find /var/logs/ -print | xargs grep '文字列' 【Linux】複数あるファイルの中から特定の文字列を検索するコマンド | かわたま.net

秘密鍵パスフレーズ解除

openssl rsa -in admin.key -out admin.key