2014/12/19

INI-style

構造の単純なテキストファイルであり、設定ファイルの標準です。
このファイルは主にWindowsで使用するが、他のプラットフォームでも使われる。
INIファイルという名前はこのファイルの一般的な拡張子「.INI」から来ている。INIとはinitializationである。
その他に「.CFG」や「.conf」、あるいは「.TXT」も使われる。


パラメータ name=value
セクション  [section]
コメント ; comment text


★ansible lineinfile
This module will search a file for a line, and ensure that it is present or absent.
 This is primarily useful when you want to change a single line in a file only.
 For other cases, see the copy or template modules.

 オプション
 ・backrefs->insertbefore and insertafter will be ignored, and if the regexp doesn't match anywhere in the file,
 the file will be left unchanged.
 If the regexp does match, the last matching line will be replaced by the expanded line parameter.
 ・insertafterーー> the line will be inserted after the specified regular expression

jmeter NonGUIDriver Could not find the TestPlan class

結論から言うと親要素が無い不完全なJMXファイルを作成していたから
翻訳のせいかな。。
save=->保存
save Test Plan As =>テスト計画に名前を使って保存する
Save Selection As =>別名で保存
 ==>選択された部分だけ保存する、これは罠である!!

php study memo

Each active resource has a unique identifier. Each identifier is a numerical index into
an internal PHP lookup table that holds information about all the active resources. PHP
maintains information about each resource in this table, including the number of references
to (or uses of) the resource throughout the code. When the last reference to a
resource value goes away, the extension that created the resource is called to free any
memory, close any connection

=->
$res=database_connect();
...
$res="boo"

automatic cleanup

// is_resource()
==>Many modules provide several functions for dealing with the outside world

if(is_resource($..)){
   
}

is_null($x)


★static variables
function updateCounter(){
     static  $counter=0;
     $counter ++;
     echo "Static function variables is now {$counter}\n";
}



★copy on write----------
必要な時だけ、メモリーを使う

Symbol
Each value pointed to by a symbol table has a reference count, a number that represents
the number of ways there are to get to that piece of memory. After the initial assignment
of the array to $worker and $worker to $other, the array pointed to by the symbol table
entries for $worker and $other has a reference count of 2.1 In other words, that memory
can be reached two ways: through $worker or $other. But after $worker[1] is changed,
PHP creates a new array for $worker, and the reference count of each of the arrays is
only 1.


★function parameter----------------------
func_num_args ==>$#?
func_get_args=>
func_get_arg(1)=>$1

isset(a)
isset(b)
==>設定されている?


Single-quoted strings do not interpolate variables.
echo '$name'
==>$name


$a= array(,,)
print_r($a)

Beware of using print_r() or var_dump() on a recursive structure such as $GLOBALS
(which has an entry for GLOBALS that points back to itself). The print_r() function loops
infinitely, while var_dump() cuts off after visiting the same element three times.

var_dump(true)
==>bool(true)


★echo $_COOKIE['PHPSESSID'];
==>これはないと、何もかわらない。。
session_start() ;

Build-in PHP Data Objects
==>PDO
The PHP Data Objects (PDO) extension defines a lightweight, consistent interface for
accessing databases in PHP. Each database driver that implements the PDO interface can
expose database-specific features as regular extension functions. Note that you cannot
perform any database functions using the PDO extension by itself; you must use a database-
specific PDO driver to access a database server.


file_exists($folder)
mkdir
folder
fread
fclose


imagecreate(width,heigth)
imagecolorallocate(image,red,green,blue)
imagegif
imagejpeg

a library vs a framework

・your code call libraries ,frameoworks call your code
・framework==>Don't call us, we'll call you


framework
===>
Frameworks are not the cure for all programming
problems. Putting aside today's awesome state of
development, you should always remember how
frameworks were created a few years ago. Most of them
were more or less unoptimized junk created by one guy to
help him speed up his development process, without much
care for documentation, elegance, ease of use, or even
readability of his code. Then another group of guys took
this code and bloated it with a patchwork of extra
functionalities barely consistent with the original code.
Then it became apparent that this whole lot needs a solid
cleanup in order to be usable, but this would mean either
rewriting it from scratch or packaging code in additional
wrapper classes, further increasing its unnecessary
complexity.
Of course, today the disorganized origin of frameworks is
not as evident as before because the quality of code has
risen considerably. But still, that's why most beefed-up
frameworks have performance issues. That's why they are
39
www.it-ebooks.info
not always easy to learn. And that's why new ones emerge
to cover up weaknesses of older ones. And finally that's
why major frameworks provide completely rewritten 2.0
versions, which address all previously mentioned
problems.

ftp 421 service not available vsftpd

yum install vsftpd
--->サーバー
yum install ftp
--->テスト用のクライアント


★vsftpd tcp_wrappers=YES
    ==>権限/etc/hostsに渡る

★vsftpd tcp_wrappers=YES
500 failed to open file
 =>SeLinux有効になっってる。
  getenforce
  sudo setenforce 0;

2014/11/14

systemd mysql.service file where

Q:
mysqlをrpmをインストールして、systemctlの設定はどこ?
==>何?mysql?

sudo systemd show mysql

here is the same man

Implementation of systemd is imminent, yet after days of research I can
not find a mysqld.service file that actually works in Debian.  I've
searched and searched, asked on mailing lists, and asked in IRC on
#debian, #systemd, and #mysql.

Nobody knows, or at least nobody helps.  There isn't even a
mysqld.service file in Sid's mysql-server package.

=ーー>ぜんぜんみつかりません。。。

じゃ。。rpmファイルを解析する
=ー>そんなsrc.rpmはない。。

yum localinstall
==>
ローカルにあるのrpmファイルをyumでインストールする方法。
依存性のファイルをレポジトリから探してきてくれるのが超便利です。

=-->ないです。

How Do I Convert A SysV Init Script Into A systemd Service File?
SysV Init Script????
systemd Service File??
何か合っている。


A:==>init.d/のしたにtestを作って、
sudo systemctl show testを確認するところ
    ExecStart={ path=/etc/rc.d/init.d/test ; argv[]=/etc/rc.d/init.d/test start ; ignore_errors=no ; start_time=[n/a] ;
    ExecStop={ path=/etc/rc.d/init.d/test ; argv[]=/etc/rc.d/init.d/test stop ; ignore_errors=no ; start_time=[n/a] ;
ありますね。。。
結論的には、mysql.serviceは存在しない。systemdはinit.d↓のスクリプトを使って偽装(init.dしたのスクリプトは大体、start,stop restart status)があるので

2014/11/13

linux eth1 ifconfig network-scripts

Q:今のVMですが、自動的にIPをアサインする物があり、
ifconfigで=> eth1 eth2
 /network-scriptsのところは、eth0だけ。。。中にIPがない
再起動してIPはかわらない。VMであるが、このIPの情報はどこで保存された?
ネットワーク
 1準仮想化ネットワーク(NAT)
 2準仮想化ネットワーク(ホストオンリーアダブター virtualBox Host-only Ethernet Apapter)

A:
  ifup eht0
  ==>デバイスはない
  ifup eht1
  ==>デバイスに対する設定はみつかりません

==>設定ファイルの名前たしかに対応している
eth1を作ればいい。。

ーーーーーーーーー
DEVICE=eth1
TYPE=Ethernet
IPADDR=
NETMASK=
NETWORK=127.0.0.0
BROADCAST=
OTPROTO=static
ONBOOT=yes
HWADDR=。。。
ーーーーーーーーー

2014/11/07

msg: the python mysqldb module is required

まずは pip を入れる。

 # yum -y install python-setuptools
 # easy_install pip

必要な依存パッケージをインストールする。

 # yum -y install python-devel mysql-devel

 # pip install mysql-python
 # pip freeze | grep -i mysql
 MySQL-python==1.2.3

以上。