function getWavGsmDuration($file_path) { $rtn = 0; if(file_exists($file_path)){ $fp = fopen($file_path,"r"); $size_in_bytes = filesize($file_path); fseek($fp, 20); $rawheader = fread($fp, 16); $header = unpack("vtype/vchannels/Vsamplerate/…
ps -ef | grep httpd これで確認!
中国遮断コマンド例 iptables -I INPUT -m geoip --src-cc CN -j DROP 国コード A1,"Anonymous Proxy" A2,"Satellite Provider" O1,"Other Country" AD,"Andorra" AE,"United Arab Emirates" AF,"Afghanistan" AG,"Antigua and Barbuda" AI,"Anguilla" AL,"A…
対象のvirtualが電源OFFであることを確認してから、 「ファイル」→「仮想メディアマネージャー」 現在は「場所」とういうところに、 ストレージがあることを確認しておく。 「コピー」をクリックしてコピーするVDIを選択。 コピー場所等指定してコピーまで行…
exec('php test.php > /dev/null &'); こんな感じで、 > /dev/null & これが必要です。
diff -urN 旧ファイル 新ファイル > test.patch です。
自分のテーマのfunctions.phpに function allow_upload_psd( $mimes ) { $mimes['psd'] = 'image/x-photoshop'; return $mimes; } add_filter( 'upload_mimes', 'allow_upload_psd' ); こんな感じで追加する。(PSDの場合の例です。)
yum list installed です。 grepなどをポールで入れてしぼればいいでしょう。
yum -y install git rpm -ivh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm yum -y install nodejs npm --enablerepo=epel cd /usr/src git clone https://github.com/peers/peerjs-server.git cd peerjs-server npm i…
たとえばgoogle.comへの通信で経由したIPを全部見たいなら、 tracert -d google.com こんな感じですね。 1 1 ms 1 ms 1 ms 192.168.100.1 2 5 ms 4 ms 3 ms 202.224.47.115 3 3 ms 3 ms 2 ms 202.224.47.21 4 12 ms 18 ms 10 ms 202.224.47.2 5 11 ms 15 ms …
現在のプロセスを確認するには ps -ef で、httpdを特定して出すなら ps -ef | grep httpd などとすればいい。 リアルタイムで見たいなら、 top で見れる。 プロセスを止める場合は、 top 後に k を押して、プロセス番号を入力の上Enter。 top を抜けるには q
-------------------------------------------------------------------------------- ■ANSWER 通話成功Call is answered. A successful dial. The caller reached the callee. --------------------------------------------------------------------------…
grep -ri 検索文字列 ディレクトリ これで大文字・小文字区別なしで、 サブディレクトリまでgrepします。
コンソールで、 SELECT procpid, start, now() - start AS lap, current_query FROM (SELECT backendid, pg_stat_get_backend_pid(S.backendid) AS procpid, pg_stat_get_backend_activity_start(S.backendid) AS start, pg_stat_get_backend_activity(S.bac…
SELECT 'ALTER TABLE ' || schemaname || '.' || tablename || ' OWNER TO 新しいオーナー名;' FROM pg_tables WHERE tableowner ='もともとのオーナー' こういうSQLを流すと、 オーナーを変更するALTER TABLEのSQLを吐いてくれますので、 それを実行してお…
# vi /etc/ssh/sshd_config 以下のように設定します。 PermitRootLogin no SSHサービスを再起動しておしまい。 # service sshd restart
rpm -ql パッケージ名 です。
function table_tag2csv($buff) { $buff = preg_replace("/>[\s]+<",$buff); $buff = preg_replace("/^.*<table[^>]*>/Uis","",$buff); $buff = preg_replace("/<\/table>.*$/is","",$buff); $buff = preg_replace("/<([a-z]+) ([^>]+)>/i","<$1>",$buff); $buff = pr</table[^>…
/* * 多次元配列を再帰的に空かどうかを確認する */ function isEmpty($arr){ $rtn = true; if(!empty($arr)){ if(is_array($arr)){//配列なら $second_rtn = true; foreach($arr as $item){ $second_rtn = $this->isEmpty($item); if(!$second_rtn){ $rtn =…
^(?!.*STRING).+$ STRINGのところを当該文字列に置き換えればOKです。 ちなみに「含む行」の場合は、 ^.*STRING.*\n
vi /etc/selinux/config これで開いて、 SELINUX=disabled こう変更して保存。 reboot 再起動してOK。
firewall-cmd --add-port=22/tcp --zone=public --permanent こんな感じで開放できます。 その他は以下のような感じ。 # 許可されているサービスやポートの一覧を表示 firewall-cmd --list-all --zone=public firewall-cmd --list-services --zone=public fi…
<Astriskのインストール> [Aasteriskのdependenciesをインストール] yum install -y make wget openssl-devel ncurses-devel newt-devel libxml2-devel kernel-devel gcc gcc-c++ sqlite-devel libuuid-devel [tarファイルをダウンロード] cd /usr/src/ wg…
VirtualboxとCentOS7でApach・PHP・PostgreSQL環境を作るまで http://linux.just4fun.biz/%E4%BB%AE%E6%83%B3%E5%8C%96%E9%96%A2%E9%80%A3/CentOS7%E3%82%92VirtualBox%E3%81%AB%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%97%E3%81%A6%E…
Ctl+Insert でコピーShift+Insert でペーストShift+Deleteでカット こういうこと。
GUIがインストールしてあることを前提にするとChromeを使いたい場合もある。 なので、コマンドで簡単にインストールしてしまいます。 # wget http://chrome.richardlloyd.org.uk/install_chrome.sh # chmod u+x install_chrome.sh # ./install_chrome.sh こ…
ログイン中にログインユーザを切り替えたければ、 su ユーザアカウント名 として、パスワード入力を求められたら入力してEnterでOKです。
今更ですが、結構ぼんやり覚えていたパーミッションについて備忘録しときます。 基本的にパーミッションは以下の3つのユーザの権限を示しています。 ・オーナー ・グループ ・その他 rwx r-x r-x この書き方に対応させるなら左から、 オーナー グループ そ…
Ctrl + Alt + F1~F6のいずれか で切り替えられます。
以下のようなHTMLを用意して、 <div class="box ratio"> <div class="inner"> コンテンツ </div></div> 以下のようなCSSを適用します。 .box { position: relative; width: 100%; height: auto; background: #444;}.ratio:before { content: ""; display: block; padding-top: 100%; /* ここを変えると比率が変わる …