<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4014060824118902191</id><updated>2024-08-29T07:27:27.771+09:00</updated><category term="Linux"/><category term="AWS"/><category term="Rails3"/><category term="CentOS"/><category term="EC2"/><category term="S3"/><category term="Mysql"/><category term="Perl"/><category term="Windows7"/><category term="Amazon Linux AMI"/><category term="無料ソフト"/><category term="Bash"/><category term="Ruby"/><category term="シェルスクリプト"/><category term="Apache"/><category term="Chef"/><category term="GlusterFS"/><category term="Rightscale"/><category term="Windows"/><category term="cron"/><category term="IAM"/><category term="RDS"/><category term="sort"/><category term="広告"/><category term="Firefox"/><category term="PowerShell"/><category term="SSL"/><category term="Shell Script"/><category term="Skype"/><category term="mysqldump"/><category term="s3cmd"/><category term="yum"/><category term="JavaScript"/><category term="Rails"/><category term="SSHクライアント"/><category term="WindowsUpdate"/><category term="awk"/><category term="git"/><category term="httpd"/><category term="nfs"/><category term="rpm"/><category term="rsync"/><category term="sed"/><category term="ssh"/><category term="お店"/><category term="お酒"/><category term="ターミナルエミュレータ"/><category term="居酒屋"/><category term="自動起動"/><category term="迷惑メール"/><category term="Amazon"/><category term="Anti Virus"/><category term="CSRF"/><category term="CentOS6"/><category term="Chrome"/><category term="CloudWatch"/><category term="Cloudfront"/><category term="Clowdworks"/><category term="CouchDB"/><category term="DNS"/><category term="DVD"/><category term="DVD作成"/><category term="DragonDisk"/><category term="E-350"/><category term="ELB"/><category term="FTP"/><category term="GOM Player"/><category term="Gmail"/><category term="HDD"/><category term="HTML"/><category term="HTTP"/><category term="HTTPS"/><category term="JOYSOUND"/><category term="Java"/><category term="Lsyncd"/><category term="MFA"/><category term="MindTerm"/><category term="My SQL"/><category term="MySQL5.6"/><category term="Open SSL"/><category term="Power Point"/><category term="Route53"/><category term="Ruby2"/><category term="SOCKS Proxy"/><category term="SQS"/><category term="SSD"/><category term="Sendmail"/><category term="SimpleDB"/><category term="WMP"/><category term="WinRM"/><category term="Windows DVD メーカー"/><category term="Windows PowerShell"/><category term="Windows Update"/><category term="Windows10"/><category term="X509"/><category term="Yahoo！メール"/><category term="agetty"/><category term="capistrano"/><category term="cgi"/><category term="checkinstall"/><category term="date"/><category term="dhclient"/><category term="du"/><category term="elFinder"/><category term="flock"/><category term="iSCSI"/><category term="iso"/><category term="m2ts"/><category term="mod_ssl"/><category term="mts"/><category term="mysql2"/><category term="ntpd"/><category term="proxy"/><category term="rake"/><category term="recipe"/><category term="rightresource"/><category term="role"/><category term="rsyslog"/><category term="slow log"/><category term="sudo"/><category term="sync"/><category term="t1.micro"/><category term="tail"/><category term="tcpdump"/><category term="ubuntu"/><category term="unicorn"/><category term="web-app-theme"/><category term="xen"/><category term="　チケット"/><category term="カーナビ"/><category term="クライアント証明書"/><category term="クラウドマネジメントツール"/><category term="スパム"/><category term="スライドショー"/><category term="ディズニー"/><category term="ディレクトリごとのサイズ"/><category term="バックグラウンド"/><category term="ビール"/><category term="ファイルダウンロード"/><category term="ファイル一覧"/><category term="ファイル同期"/><category term="フィルタ"/><category term="ベンチマーク"/><category term="メール転送"/><category term="例外"/><category term="単位"/><category term="同期"/><category term="帯域"/><category term="帯域制御"/><category term="抽選"/><category term="排他制御"/><category term="改行"/><category term="文字コード"/><category term="日本酒"/><category term="曲目リスト"/><category term="焼き鳥"/><category term="監視"/><category term="第三のビール"/><category term="置換"/><category term="自動ログオン"/><category term="電波時計"/><title type='text'>メモOFF</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://memo-off.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://memo-off.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03247442628823360053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>200</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4014060824118902191.post-2074517427775846321</id><published>2018-07-04T11:25:00.002+09:00</published><updated>2018-07-04T11:25:16.713+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript"/><title type='text'>Java ScriptでQuery StringをObjectに変換する</title><content type='html'>&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;var qs = document.location.search.replace(/(^\?)/,&#39;&#39;).split(&quot;&amp;&quot;).map(function(n){return n = n.split(&quot;=&quot;),this[n[0]] = decodeURIComponent(n[1]),this}.bind({}))[0];
&lt;/pre&gt;&lt;br /&gt;
これで&lt;br /&gt;
?name=hoge&amp;gender=female&lt;br /&gt;
に対して&lt;br /&gt;
qs.name --&gt; hoge&lt;br /&gt;
と値が取得できます。</content><link rel='replies' type='application/atom+xml' href='http://memo-off.blogspot.com/feeds/2074517427775846321/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://memo-off.blogspot.com/2018/07/java-scriptquery-stringobject.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/2074517427775846321'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/2074517427775846321'/><link rel='alternate' type='text/html' href='http://memo-off.blogspot.com/2018/07/java-scriptquery-stringobject.html' title='Java ScriptでQuery StringをObjectに変換する'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03247442628823360053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4014060824118902191.post-2565615055744740456</id><published>2017-07-03T17:46:00.000+09:00</published><updated>2017-07-03T17:46:13.387+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="elFinder"/><title type='text'>elFinderでchmod出来るようにする</title><content type='html'>ブラウザ上から、サーバーのファイル操作ができるWEBアプリ版のファイルマネージャー elFinder ですが、デフォルトではパーミッションの変更が出来ず少々苦労したのでメモです。&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
どうやらこのオプションを有効にしてあげれば良いみたいです。&lt;br /&gt;&lt;br /&gt;
https://github.com/Studio-42/elFinder/wiki/Connector-configuration-options-2.1#statOwner&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
elFinder/php/connector.minimal.php&lt;br /&gt;&lt;br /&gt;
のファイルに次の記述を入れれば設定が有効かされました。&lt;br /&gt;&lt;br /&gt;
&#39;statOwner&#39; =&gt; &#39;True&#39;,&lt;br /&gt;&lt;br /&gt;
記述箇所はこのあたり&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;$opts = array(
 // &#39;debug&#39; =&gt; true,
 &#39;roots&#39; =&gt; array(
  // Items volume
  array(
---- 中略 ----
   &#39;statOwner&#39; =&gt; &#39;True&#39;,
---- 中略 ----
  ),
&lt;/pre&gt;&lt;br /&gt;
この設定を入れて、リロードしてみると ＊ みたいな黄色のアイコンが出現し、属性変更（パーミッション変更）が出来るようになりましたヽ(´ー｀)/&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuI1d8H0pnJPRWZvArIFhPOdYwYZ1xhL-7EFUgxfGw6vNsr37TD3_p1zgu2Z1RkNQcyB0evGjby9Dyd4ylZXMOtIjwxvCe9FzpJO9U8cWjAKhqOUifVA-B9LNbwsKbdEftFvCiD9XGH0yp/s1600/elFinder-chmod.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuI1d8H0pnJPRWZvArIFhPOdYwYZ1xhL-7EFUgxfGw6vNsr37TD3_p1zgu2Z1RkNQcyB0evGjby9Dyd4ylZXMOtIjwxvCe9FzpJO9U8cWjAKhqOUifVA-B9LNbwsKbdEftFvCiD9XGH0yp/s320/elFinder-chmod.jpg&quot; width=&quot;320&quot; height=&quot;119&quot; data-original-width=&quot;224&quot; data-original-height=&quot;83&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGyFQ3CiSmN7m5i-dLBSXbb_R9T01hneuJLgf72zPI5CgRRvJ4E88zBrm6C7lfkLTSFq5dQG0vThzJB0DUG6d8c5RAmQimMob2gT5dvDc4R5cq2icLonlXdwzE8B1AaS-Mwoj4IIbA1iiF/s1600/elFinder-chmod2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGyFQ3CiSmN7m5i-dLBSXbb_R9T01hneuJLgf72zPI5CgRRvJ4E88zBrm6C7lfkLTSFq5dQG0vThzJB0DUG6d8c5RAmQimMob2gT5dvDc4R5cq2icLonlXdwzE8B1AaS-Mwoj4IIbA1iiF/s320/elFinder-chmod2.jpg&quot; width=&quot;320&quot; height=&quot;199&quot; data-original-width=&quot;422&quot; data-original-height=&quot;262&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://memo-off.blogspot.com/feeds/2565615055744740456/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://memo-off.blogspot.com/2017/07/elfinderchmod.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/2565615055744740456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/2565615055744740456'/><link rel='alternate' type='text/html' href='http://memo-off.blogspot.com/2017/07/elfinderchmod.html' title='elFinderでchmod出来るようにする'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03247442628823360053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuI1d8H0pnJPRWZvArIFhPOdYwYZ1xhL-7EFUgxfGw6vNsr37TD3_p1zgu2Z1RkNQcyB0evGjby9Dyd4ylZXMOtIjwxvCe9FzpJO9U8cWjAKhqOUifVA-B9LNbwsKbdEftFvCiD9XGH0yp/s72-c/elFinder-chmod.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4014060824118902191.post-6022023790415641484</id><published>2017-06-27T16:57:00.001+09:00</published><updated>2017-06-27T16:57:29.977+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AWS"/><category scheme="http://www.blogger.com/atom/ns#" term="S3"/><title type='text'>AWS Management ConsoleのS3新UIで、deletedなオブジェクトをprefix指定でフィルタリング表示する</title><content type='html'>バージョン管理をenableにしたS3バケットで、大量のdeletedなオブジェクトの中からprefix指定でオブジェクトをピックアップしようとしてみたところ&lt;br /&gt;
&lt;br /&gt;
No keys were found for prefix search.&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;
と言われてしまい、deletedなオブジェクトに対してprefix指定での検索ができませんでした(´・ω・`)&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-C0lAjTqnbq9FbsjVKJl4_qb6eAaYmAbo-KAVYstthjoFOtvuxnICHKky2nqLDFoOkWLSx8k8qhD2QK76OEntk0Sxw6-8jU9f9AUbrH_u7BxXdAbrR3B5N2yKSSf4fvXstHD6S5nB9x8M/s1600/s3-new-ui.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;299&quot; data-original-width=&quot;840&quot; height=&quot;113&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-C0lAjTqnbq9FbsjVKJl4_qb6eAaYmAbo-KAVYstthjoFOtvuxnICHKky2nqLDFoOkWLSx8k8qhD2QK76OEntk0Sxw6-8jU9f9AUbrH_u7BxXdAbrR3B5N2yKSSf4fvXstHD6S5nB9x8M/s320/s3-new-ui.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
ブラウザ上の操作では&lt;br /&gt;&lt;br /&gt;
Type a prefix and press Enter to search. Press ESC to clear.&lt;br /&gt;&lt;br /&gt;
と書かれているフォームにprefixを指定してみても、deletedではない現行バージョンに対して検索してしまうようです。&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
ワークアラウンドとして、次のように直接URLで指定してあげるとdeletedなオブジェクトに対して検索することができましたよヽ(´ー｀)/&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;https://console.aws.amazon.com/s3/buckets/&amp;lt;バケット名&amp;gt;/&amp;lt;prefix&amp;gt;?showdeleted=true
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://memo-off.blogspot.com/feeds/6022023790415641484/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://memo-off.blogspot.com/2017/06/aws-management-consoles3uideletedprefix.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/6022023790415641484'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/6022023790415641484'/><link rel='alternate' type='text/html' href='http://memo-off.blogspot.com/2017/06/aws-management-consoles3uideletedprefix.html' title='AWS Management ConsoleのS3新UIで、deletedなオブジェクトをprefix指定でフィルタリング表示する'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03247442628823360053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-C0lAjTqnbq9FbsjVKJl4_qb6eAaYmAbo-KAVYstthjoFOtvuxnICHKky2nqLDFoOkWLSx8k8qhD2QK76OEntk0Sxw6-8jU9f9AUbrH_u7BxXdAbrR3B5N2yKSSf4fvXstHD6S5nB9x8M/s72-c/s3-new-ui.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4014060824118902191.post-7126369917733009235</id><published>2017-02-14T20:17:00.001+09:00</published><updated>2017-02-14T20:17:42.152+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Amazon Linux AMI"/><category scheme="http://www.blogger.com/atom/ns#" term="Mysql"/><title type='text'>MySQLでユーザーに設定したパスワードが効かなくて嵌った件</title><content type='html'>Amazon Linuxでyumを使ってMySQL56をインストールし起動し、データベースとユーザーを作成して&lt;/ br&gt;&lt;br /&gt;
ログインしてみると設定したパスワードでログインできないではありませんか（；゜〇゜)&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;mysql&gt; create database mydb character set utf8;
mysql&gt; grant all on mydb.* to user identified by &#39;xxxxx&#39;;

$ mysql -u user -p
Enter password: 
ERROR 1045 (28000): Access denied for user &#39;user &#39;@&#39;localhost&#39; (using password: YES)
&lt;/pre&gt;&lt;br /&gt;
ところが、パスワードなしでログインを試みるとは入れてしまいましたΣ(゜д゜;)&lt;br /&gt;&lt;br /&gt;
プロセスを確認してみると指定したユーザーでログインしています。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;$ mysql -u user
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 30
Server version: 5.6.35 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type &#39;help;&#39; or &#39;\h&#39; for help. Type &#39;\c&#39; to clear the current input statement.

mysql&gt; show processlist;
+----+-----------+-----------+------+---------+------+-------+------------------+
| Id | User  | Host      | db   | Command | Time | State | Info  |
+----+-----------+-----------+------+---------+------+-------+------------------+
| 28 | user      | localhost | NULL | Query   |    0 | init  | show processlist |
+----+-----------+-----------+------+---------+------+-------+------------------+
1 row in set (0.00 sec)
&lt;/pre&gt;&lt;br /&gt;
ユーザーテーブルどーなってるか確認してみるとユーザー名なし、パスワードなしの登録が入っていました&lt;br /&gt;&lt;br /&gt;
あやしいです(；一_一)&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;mysql&gt; select user,host from user;
+-----------+------------------+-------------------------------------------+
| user     | host        | password       |
+-----------+------------------+-------------------------------------------+
| user      | %         | *XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
| root     | 127.0.0.1        |                                           |
| root     | ::1        |                                           |
|     | ip-xxx-xx-xx-xxx |                                           |
| root     | ip-xxx-xx-xx-xxx |                                           |
|     | localhost        |                                           |
| root     | localhost        |                                           |
+-----------+------------------+-------------------------------------------+

mysql&gt; select host from user where user=&quot;&quot;;
+------------------+
| host     |
+------------------+
| ip-xxx-xx-xx-xxx |
| localhost    |
+------------------+
2 rows in set (0.00 sec)
&lt;/pre&gt;&lt;br /&gt;
怪しいので消してしまいましょうヽ(´ー｀)/&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;mysql&gt; delete from user where user=&quot;&quot;;
Query OK, 2 rows affected (0.00 sec)

mysql&gt; FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
&lt;/pre&gt;&lt;br /&gt;
そしたら、次の通り入れました！ヾ(*･∀･)ノ&quot;&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;$ mysql -u user -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 30
Server version: 5.6.35 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type &#39;help;&#39; or &#39;\h&#39; for help. Type &#39;\c&#39; to clear the current input statement.

mysql&gt; 
&lt;/pre&gt;&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://memo-off.blogspot.com/feeds/7126369917733009235/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://memo-off.blogspot.com/2017/02/mysql.html#comment-form' title='1 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/7126369917733009235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/7126369917733009235'/><link rel='alternate' type='text/html' href='http://memo-off.blogspot.com/2017/02/mysql.html' title='MySQLでユーザーに設定したパスワードが効かなくて嵌った件'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03247442628823360053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4014060824118902191.post-8710714790028045328</id><published>2016-10-05T13:33:00.000+09:00</published><updated>2016-10-05T13:33:01.016+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dhclient"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><title type='text'>restart dhclient without OS reboot</title><content type='html'>yum updateを実施したところdhclientがdeletedな状態となってしまいました&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;# lsof|grep del
dhclient   2292      root  txt      REG       202,1    547784   402927 /sbin/dhclient (deleted)
&lt;/pre&gt;&lt;br /&gt;
いろいろと調べて、最終的に辿り着いた対応方法がこれ&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;# service network reload
Shutting down interface eth0:       [  OK  ]
Shutting down loopback interface:      [  OK  ]
Bringing up loopback interface:       [  OK  ]
Bringing up interface eth0:  
Determining IP information for eth0... done.
          [  OK  ]
# lsof|grep del
&lt;/pre&gt;&lt;br /&gt;
瞬断はあるものの、接続中のセッションが切れることもなくdeleted状態から抜け出せましたヾ(*･∀･)ノ&quot;</content><link rel='replies' type='application/atom+xml' href='http://memo-off.blogspot.com/feeds/8710714790028045328/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://memo-off.blogspot.com/2016/10/restart-dhclient-without-os-reboot.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/8710714790028045328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/8710714790028045328'/><link rel='alternate' type='text/html' href='http://memo-off.blogspot.com/2016/10/restart-dhclient-without-os-reboot.html' title='restart dhclient without OS reboot'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03247442628823360053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4014060824118902191.post-4664300966617791950</id><published>2016-10-05T12:57:00.001+09:00</published><updated>2016-10-05T12:57:15.431+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="agetty"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><title type='text'>agettyを再起動する方法</title><content type='html'>yum updateしたら、どうもagettyが更新されたようでdeletedな状態となってしまいました。&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;# lsof|grep del
agetty    2777      root  txt      REG       202,1 36184   401041 /sbin/agetty (deleted)
&lt;/pre&gt;&lt;br /&gt;
OSごと再起動してしまえば済むのでしょうけれど、OSは再起動せずにagettyだけ再起動できないものかと&lt;/br&gt;&lt;br /&gt;
restart agetty&lt;/br&gt;&lt;br /&gt;
みたいな感じでぐぐってみるもなかなか対処方法にたどり着きませんでした。&lt;/br&gt;&lt;br /&gt;
&lt;/br&gt;&lt;br /&gt;
そして、最終的にたどり着いた方法がこれ&lt;/br&gt;&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;# initctl list
...中略...
serial (ttyS0) start/running, process 2777
# initctl status serial DEV=ttyS0
serial (ttyS0) start/running, process 2777
# initctl restart serial DEV=ttyS0
serial (ttyS0) start/running, process 27704
# lsof|grep del
&lt;/pre&gt;&lt;br /&gt;
agettyが再起動され、deleted状態から抜け出しましたヽ(´ー｀)/</content><link rel='replies' type='application/atom+xml' href='http://memo-off.blogspot.com/feeds/4664300966617791950/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://memo-off.blogspot.com/2016/10/agetty.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/4664300966617791950'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/4664300966617791950'/><link rel='alternate' type='text/html' href='http://memo-off.blogspot.com/2016/10/agetty.html' title='agettyを再起動する方法'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03247442628823360053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4014060824118902191.post-1378435085731637038</id><published>2016-04-25T10:05:00.002+09:00</published><updated>2016-04-25T10:05:19.662+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><title type='text'>psコマンドでCPU使用率、メモリ使用率で降順ソートする</title><content type='html'>CPU使用率はcpuではなくpcpu、メモリ使用率はrssでそれぞれ-をつけてあげると降順ソートされるのですねヾ(*･ω･)ｼ&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;$ ps aux --sort -pcpu|head -4
USER    PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root  27481 4.9  0.0 417760  5504 ?        Sl   Apr04 1484:06 xxx
lumata  21324 0.4  0.1 386072 10636 ?        Sl    2015 1361:06 xxx
root      1 0.0  0.0  19456  1472 ?        Ss    2015   2:09  xxx

$ ps aux --sort -rss|head -4
USER    PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME  COMMAND
root  12295 0.0  0.2 366620 18220 ?        SN    2015   5:39  xxx
lumata  21324 0.4  0.1 386072 10636 ?        Sl    2015 1361:06 xxx
root  23780 0.0  0.1 155064  9088 ?        Ss    2015  16:09  xxx
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://memo-off.blogspot.com/feeds/1378435085731637038/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://memo-off.blogspot.com/2016/04/pscpu.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/1378435085731637038'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/1378435085731637038'/><link rel='alternate' type='text/html' href='http://memo-off.blogspot.com/2016/04/pscpu.html' title='psコマンドでCPU使用率、メモリ使用率で降順ソートする'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03247442628823360053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4014060824118902191.post-5247788808188722985</id><published>2016-04-15T16:31:00.000+09:00</published><updated>2016-04-15T16:31:21.657+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AWS"/><category scheme="http://www.blogger.com/atom/ns#" term="CloudWatch"/><title type='text'>CloudWatchのSumな統計値の最新値を採用してはいけない件</title><content type='html'>Periodとして指定できる最低値は60秒なのだが、最低値の60秒を指定してSumな統計値を取得してみると&lt;br /&gt;&lt;br /&gt;
最新値は取得タイミングによって変化していく&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
なので、最新値はfixされている保証がないのでこの値を採用してしまうと後で変わる可能性がある&lt;br /&gt;&lt;br /&gt;
最新より1つ以上前の値を採用しましょうヾ(*･ω･)ｼ&lt;br /&gt;&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;$ aws cloudwatch get-metric-statistics \
--region us-east-1 --metric-name Requests \
--namespace AWS/CloudFront \
--statistics Sum \
--dimensions 
 Name=DistributionId,Value=xxxxxxxxxxxxxx \
 Name=Region,Value=Global \
--start-time `date --iso-8601=seconds -d &#39;3 minute ago&#39;` \
--end-time `date --iso-8601=seconds` \
--period 60 \
--output text|sort -k3

Requests
DATAPOINTS 4231.0 2016-04-15T06:54:00Z None
DATAPOINTS 4389.0 2016-04-15T06:55:00Z None
DATAPOINTS 1205.0 2016-04-15T06:56:00Z None

$ aws cloudwatch get-metric-statistics \
--region us-east-1 --metric-name Requests \
--namespace AWS/CloudFront \
--statistics Sum \
--dimensions 
 Name=DistributionId,Value=xxxxxxxxxxxxxx \
 Name=Region,Value=Global \
--start-time `date --iso-8601=seconds -d &#39;3 minute ago&#39;` \
--end-time `date --iso-8601=seconds` \
--period 60 \
--output text|sort -k3

Requests
DATAPOINTS 4231.0 2016-04-15T06:54:00Z None
DATAPOINTS 4389.0 2016-04-15T06:55:00Z None
DATAPOINTS 4380.0 2016-04-15T06:56:00Z None
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://memo-off.blogspot.com/feeds/5247788808188722985/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://memo-off.blogspot.com/2016/04/cloudwatchsum.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/5247788808188722985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/5247788808188722985'/><link rel='alternate' type='text/html' href='http://memo-off.blogspot.com/2016/04/cloudwatchsum.html' title='CloudWatchのSumな統計値の最新値を採用してはいけない件'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03247442628823360053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4014060824118902191.post-7186838377402931334</id><published>2016-04-06T20:21:00.002+09:00</published><updated>2016-04-06T20:24:19.480+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AWS"/><category scheme="http://www.blogger.com/atom/ns#" term="ELB"/><title type='text'>ELBのログよりWEBサーバーのログが多くなる件</title><content type='html'>ELBはクライアントへ応答を返した時点&lt;/ br&gt;&lt;br /&gt;
WEBサーバーはELBへ応答を返した時点&lt;/ br&gt;&lt;br /&gt;
でログを出力するので、ELBからクライアントへの応答が受信キャンセルや回線断などで中断されるとWEBサーバーのログへは残るがELBへのログには残らないという事象が発生する&lt;br /&gt;
&lt;br /&gt;
* test?escapeはレスポンス受信中にescapeボタンを押してレスポンス受信を中断&lt;br /&gt;
* test?timeoutはレスポンス受信中にELBのタイムアウトにひっかかり応答中断…この場合はWEBサーバーからELBの応答完了は、ELB→クライアントの応答中断の後となるがWEBサーバーのログには残る&lt;br /&gt;
* test?linkdownはレスポンス受信中に回線断で中断&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxcavezDiDWpjHYNxRd8VbyYraYk_OBcxN1koJU0NAWuuEZyC8nuGHuYKxZCVuLJH0MwNeMG9tsJtb1Hw0JNM0MJFb4Jv1Uslo6YrPADK6ZPb17-hq46TtArPgAi0X_FJsdV2jv7OirMiR/s1600/elb-apache.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxcavezDiDWpjHYNxRd8VbyYraYk_OBcxN1koJU0NAWuuEZyC8nuGHuYKxZCVuLJH0MwNeMG9tsJtb1Hw0JNM0MJFb4Jv1Uslo6YrPADK6ZPb17-hq46TtArPgAi0X_FJsdV2jv7OirMiR/s1600/elb-apache.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
■Apacheのログ抜粋&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;[06/Apr/2016:10:39:40 +0000] &quot;GET /test?escape HTTP/1.1&quot; 200 95 35008269
[06/Apr/2016:10:41:00 +0000] &quot;GET /test?timeout HTTP/1.1&quot; 200 95 35008254
[06/Apr/2016:10:43:47 +0000] &quot;GET /hoge HTTP/1.1&quot; 403 213 92
[06/Apr/2016:10:43:52 +0000] &quot;GET /piyo HTTP/1.1&quot; 403 213 95
[06/Apr/2016:11:06:39 +0000] &quot;GET /test?linkdown HTTP/1.1&quot; 200 95 35009322
[06/Apr/2016:11:07:30 +0000] &quot;GET /ok HTTP/1.1&quot; 403 211 86
&lt;/pre&gt;&lt;br /&gt;
■ELBのログ抜粋&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;2016-04-06T10:41:00.811664Z 504 0 0 0 &quot;GET https://xxx:443/test?timeout HTTP/1.1&quot;
2016-04-06T10:43:47.905126Z 403 403 0 213 &quot;GET https://xxx:443/hoge HTTP/1.1&quot;
2016-04-06T10:43:51.996916Z 403 403 0 213 &quot;GET https://xxx:443/piyo HTTP/1.1&quot;
2016-04-06T11:07:30.187571Z 403 403 0 211 &quot;GET https://xxx:443/ok HTTP/1.1&quot;
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://memo-off.blogspot.com/feeds/7186838377402931334/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://memo-off.blogspot.com/2016/04/elbweb.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/7186838377402931334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/7186838377402931334'/><link rel='alternate' type='text/html' href='http://memo-off.blogspot.com/2016/04/elbweb.html' title='ELBのログよりWEBサーバーのログが多くなる件'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03247442628823360053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxcavezDiDWpjHYNxRd8VbyYraYk_OBcxN1koJU0NAWuuEZyC8nuGHuYKxZCVuLJH0MwNeMG9tsJtb1Hw0JNM0MJFb4Jv1Uslo6YrPADK6ZPb17-hq46TtArPgAi0X_FJsdV2jv7OirMiR/s72-c/elb-apache.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4014060824118902191.post-6365346596705599738</id><published>2016-02-15T16:27:00.001+09:00</published><updated>2016-05-08T08:01:42.624+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GOM Player"/><category scheme="http://www.blogger.com/atom/ns#" term="広告"/><title type='text'>GOM Playerの広告を非表示にする</title><content type='html'>&lt;s&gt;&lt;br /&gt;
■http://d.cpsoft86.com　を制限付きサイトとして登録&lt;br /&gt;
コマンドを指定して実行([Windowsキー]+R)&lt;br /&gt;
↓&lt;br /&gt;
inetcpl.cpl　を入力&lt;br /&gt;
↓&lt;br /&gt;
OK&lt;br /&gt;
↓&lt;br /&gt;
セキュリティタブ&lt;br /&gt;
↓&lt;br /&gt;
制限付きサイト&lt;br /&gt;
↓&lt;br /&gt;
サイト&lt;br /&gt;
↓&lt;br /&gt;
このWebサイトをゾーンに追加する　のところへ&lt;br /&gt;
http://d.cpsoft86.com&lt;br /&gt;
を入力して「追加」ボタン&lt;br /&gt;
↓&lt;br /&gt;
閉じる&lt;br /&gt;
↓&lt;br /&gt;
OK&lt;br /&gt;
&lt;/s&gt;&lt;br /&gt;
&lt;br /&gt;
■広告系のドメインを127.0.0.1として名前解決するよう設定 … 5/8更新&lt;br /&gt;
C:\Windows\System32\drivers\etc\hostsへ次の記述を追加して保存する&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;#GOMプレーヤー広告系
127.0.0.1 wpad
127.0.0.1 cdn.taboola.com
127.0.0.1 trc.taboola.com
127.0.0.1 adclients.gomplayer.jp
127.0.0.1 adc.gomplayer.jp
127.0.0.1 playinfo.gomlab.com
127.0.0.1 securepubads.g.doubleclick.net
127.0.0.1 applog.gomtv.com
127.0.0.1 b.scorecardresearch.com
#オプション
127.0.0.1 www.googletagservices.com
127.0.0.1 www.google-analytics.com
127.0.0.1 partner.googleadservices.com
&lt;/pre&gt;&lt;br /&gt;
■GOM Playerを起動してみる&lt;br /&gt;
広告枠は出ているものの、中身は表示されなくなりましたヾ(*･∀･)ノ&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqg9UqQliUOEUtns78Q80of9b_cW72_DRzmZMAG38D2ZzwR5mxXjbzdnRMKPB9IHfQplg7Qk98IeSdY8pL1k2lmThd2JmzkHOpYqphMi-GKg7vlby_sNBiTcHl2SplLeYkwXfITiC1AFsJ/s1600/gom.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqg9UqQliUOEUtns78Q80of9b_cW72_DRzmZMAG38D2ZzwR5mxXjbzdnRMKPB9IHfQplg7Qk98IeSdY8pL1k2lmThd2JmzkHOpYqphMi-GKg7vlby_sNBiTcHl2SplLeYkwXfITiC1AFsJ/s320/gom.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://memo-off.blogspot.com/feeds/6365346596705599738/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://memo-off.blogspot.com/2016/02/gom-player.html#comment-form' title='4 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/6365346596705599738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/6365346596705599738'/><link rel='alternate' type='text/html' href='http://memo-off.blogspot.com/2016/02/gom-player.html' title='GOM Playerの広告を非表示にする'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03247442628823360053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqg9UqQliUOEUtns78Q80of9b_cW72_DRzmZMAG38D2ZzwR5mxXjbzdnRMKPB9IHfQplg7Qk98IeSdY8pL1k2lmThd2JmzkHOpYqphMi-GKg7vlby_sNBiTcHl2SplLeYkwXfITiC1AFsJ/s72-c/gom.png" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4014060824118902191.post-2391036248952992914</id><published>2016-02-12T13:56:00.001+09:00</published><updated>2016-02-12T13:56:02.765+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PowerShell"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>ファイルのタイムスタンプを他のファイルと同じにする</title><content type='html'>Linuxでいうところのtouchで他のファイルを参照してタイムスタンプを揃えるみたいなことをWindowsでやってみようという訳です。&lt;br /&gt;
&lt;br /&gt;
Linuxならこんな感じ&lt;br /&gt;
&lt;pre&gt;$ touch target.txt -r source.txt
&lt;/pre&gt;&lt;br /&gt;
WindowsだとPowerShellを使って、次のような感じでとりあえずはできました。&lt;br /&gt;
もっとスマートな方法あるのかな・・・(´・ω・｀)&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;Set-ItemProperty target.txt lastwritetime -value $(Get-ItemProperty source.txt).lastwritetime
Set-ItemProperty target.txt creationtime -value $(Get-ItemProperty 0source.txt).creationtime
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://memo-off.blogspot.com/feeds/2391036248952992914/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://memo-off.blogspot.com/2016/02/blog-post.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/2391036248952992914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/2391036248952992914'/><link rel='alternate' type='text/html' href='http://memo-off.blogspot.com/2016/02/blog-post.html' title='ファイルのタイムスタンプを他のファイルと同じにする'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03247442628823360053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4014060824118902191.post-5526281344856308407</id><published>2016-02-08T16:22:00.000+09:00</published><updated>2016-02-08T16:22:00.545+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Amazon Linux AMI"/><category scheme="http://www.blogger.com/atom/ns#" term="HTTP"/><title type='text'>Amazon LinuxにtcpflowをインストールしてHTTPリクエスト＆レスポンスをキャプチャして覗いてみる</title><content type='html'>http://apt.sw.be/redhat/el7/en/x86_64/rpmforge/RPMS/ からtcpflowの最新rpmパッケージを探してインストール&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;# yum install `curl -s http://apt.sw.be/redhat/el7/en/x86_64/rpmforge/RPMS/|grep -o &#39;&quot;tcpflow[^&quot;]*&#39;|sed &#39;s|&quot;|http://apt.sw.be/redhat/el7/en/x86_64/rpmforge/RPMS/|&#39;`

Dependencies Resolved

======================================================================================================================================
 Package   Arch   Version    Repository      Size
======================================================================================================================================
Installing:
 tcpflow   x86_64   0.21-1.2.el7.rf   /tcpflow-0.21-1.2.el7.rf.x86_64    61 k

Transaction Summary
======================================================================================================================================
Install  1 Package
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : tcpflow-0.21-1.2.el7.rf.x86_64             1/1 
  Verifying  : tcpflow-0.21-1.2.el7.rf.x86_64             1/1 

Installed:
  tcpflow.x86_64 0:0.21-1.2.el7.rf                  

Complete!
&lt;/pre&gt;&lt;br /&gt;
eth0の80番ポートのパケットを試しにキャプチャ&lt;br /&gt;
※-cでコンソール出力,-sで表示できない文字を.で表示&lt;br /&gt;
ELBからのヘルスチェックのリクエスト＆レスポンスが取得されました。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;# tcpflow -cs -i eth0 port 80
tcpflow[6577]: listening on eth0
010.000.012.250.26633-010.000.022.012.00080: GET / HTTP/1.1
host: 10.0.22.12
User-Agent: ELB-HealthChecker/1.0
Accept: */*
Connection: keep-alive

010.000.022.012.00080-010.000.012.250.26633: HTTP/1.1 200 OK
Date: Mon, 08 Feb 2016 03:34:19 GMT
Server: Apache
Content-Type: text/plain;charset=ISO-8859-1
Content-Length: 0
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
manpage&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;# man tcpflow
tcpflow(1)

NAME
       tcpflow - TCP flow recorder

SYNOPSIS
       tcpflow [-chpsv] [-b max_bytes] [-d debug_level] [-f max_fds] [-i iface] [-r file] [expression]

DESCRIPTION
       tcpflow is a program that captures data transmitted as part of TCP connections (flows), and stores the data in a way that is convenient for protocol analysis or debugging.  A program like tcpdump(4) shows a summary of pack‐
       ets seen on the wire, but usually doesn&#39;t store the data that&#39;s actually being transmitted.  In contrast, tcpflow reconstructs the actual data streams and stores each flow in a separate file for later analysis.  tcpflow
       understands TCP sequence numbers and will correctly reconstruct data streams regardless of retransmissions or out-of-order delivery.

       tcpflow stores all captured data in files that have names of the form
     192.168.101.102.02345-010.011.012.013.45103
       where the contents of the above file would be data transmitted from host 192.168.101.102 port 2345, to host 10.11.12.13 port 45103.

OPTIONS
       -b     Max bytes per flow.  Capture no more than max_bytes bytes per flow.  Any data captured for a flow beyond max_bytes from the first byte captured will be discarded.  The default is to store an unlimited number of bytes
       per flow.

       -c     Console print.  Print the contents of packets to stdout as they are received, without storing any captured data to files (implies -s ).

       -d     Debug level.  Set the level of debugging messages printed to stderr to debug_level.  Higher numbers produce more messages.  -d 0 causes completely silent operation.  -d 1 , the default, produces minimal status mes‐
       sages.  -d 10 produces verbose output equivalent to -v . Numbers higher than 10 can produce a large amount of debugging information useful only to developers.

       -f     Max file descriptors used.  Limit the number of file descriptors used by tcpflow to max_fds.  Higher numbers use more system resources, but usually perform better.  If the underlying operating system supports the
       setrlimit() system call, the OS will be asked to enforce the requested limit.  The default is for tcpflow to use the maximum number of file descriptors allowed by the OS.  The -v option will report how many file
       descriptors tcpflow is using.

       -h     Help.  Print usage information and exit.

       -i     Interface name.  Capture packets from the network interface named iface. If no interface is specified with -i , a reasonable default will be used by libpcap automatically.

       -p     No promiscuous mode.  Normally, tcpflow attempts to put the network interface into promiscuous mode before capturing packets.  The -p option tells tcpflow not to put the interface into promiscuous mode.  Note that it
       might already be in promiscuous mode for some other reason.

       -r     Read from file.  Read packets from file, which was created using the -w option of tcpdump(1).  Standard input is used if file is ``-&#39;&#39;.  Note that for this option to be useful, tcpdump&#39;s -s option should be used to
       set the snaplen to the MTU of the interface (e.g., 1500) while capturing packets.

       -s     Strip non-printables.  Convert all non-printable characters to the &quot;.&quot; character before printing packets to the console or storing them to a file.

       -v     Verbose operation.  Verbosely describe tcpflow&#39;s operation.  Equivalent to -d 10 .
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://memo-off.blogspot.com/feeds/5526281344856308407/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://memo-off.blogspot.com/2016/02/amazon-linuxtcpflowhttp.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/5526281344856308407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/5526281344856308407'/><link rel='alternate' type='text/html' href='http://memo-off.blogspot.com/2016/02/amazon-linuxtcpflowhttp.html' title='Amazon LinuxにtcpflowをインストールしてHTTPリクエスト＆レスポンスをキャプチャして覗いてみる'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03247442628823360053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4014060824118902191.post-662899137187241044</id><published>2016-02-04T20:07:00.002+09:00</published><updated>2016-06-03T09:32:33.806+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Skype"/><category scheme="http://www.blogger.com/atom/ns#" term="広告"/><title type='text'>Skypeの広告を非表示にする Version 7.18編</title><content type='html'>■Skypeユーザー別の設定ファイルを編集&lt;br /&gt;
C:\Users\[Windowsのログインユーザー名]\AppData\Roaming\Skype\[Skypeのログインユーザー名]\config.xml&lt;br /&gt;
を開いて、次の記述を探しコメントアウトして保存する&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;&lt;advertplaceholder&gt;1&lt;/AdvertPlaceholder&gt;
&lt;/pre&gt;↓&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;&lt;!--&lt;advertplaceholder&gt;1&lt;/AdvertPlaceholder&gt;--&gt;
&lt;/pre&gt;&lt;br /&gt;
■Skypeユーザー別の設定ファイルを読み取り専用に変更する&lt;br /&gt;
C:\Users\[Windowsのログインユーザー名]\AppData\Roaming\Skype\[Skypeのログインユーザー名]\config.xml&lt;br /&gt;
ファイルを右クリック&lt;br /&gt;
↓&lt;br /&gt;
プロパティ&lt;br /&gt;
↓&lt;br /&gt;
読み取り専用にチェック&lt;br /&gt;
↓&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
■https://apps.skype.com　を制限付きサイトとして登録&lt;br /&gt;
コマンドを指定して実行([Windowsキー]+R)&lt;br /&gt;
↓&lt;br /&gt;
inetcpl.cpl　を入力&lt;br /&gt;
↓&lt;br /&gt;
OK&lt;br /&gt;
↓&lt;br /&gt;
セキュリティタブ&lt;br /&gt;
↓&lt;br /&gt;
制限付きサイト&lt;br /&gt;
↓&lt;br /&gt;
サイト&lt;br /&gt;
↓&lt;br /&gt;
このWebサイトをゾーンに追加する　のところへ&lt;br /&gt;
https://apps.skype.com&lt;br /&gt;
を入力して「追加」ボタン&lt;br /&gt;
↓&lt;br /&gt;
閉じる&lt;br /&gt;
↓&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
■Skypeを起動&lt;br /&gt;
はっぴーヾ(*･∀･)ノ”&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4ZglJALyUrd36pWnRAqK1GomzDmMNPqnKXoZEkAqSlsgBC8n8M7EQ6kaAy5QhnmoObF-xi6KXTiy40wlDMdhHhaaKaU4L1R8ybXcqYwjmqRrajFx8KWhagwAAuR8TZwRKChJjX4L4f4PU/s1600/skype.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4ZglJALyUrd36pWnRAqK1GomzDmMNPqnKXoZEkAqSlsgBC8n8M7EQ6kaAy5QhnmoObF-xi6KXTiy40wlDMdhHhaaKaU4L1R8ybXcqYwjmqRrajFx8KWhagwAAuR8TZwRKChJjX4L4f4PU/s320/skype.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://memo-off.blogspot.com/feeds/662899137187241044/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://memo-off.blogspot.com/2016/02/skype-version-718.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/662899137187241044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/662899137187241044'/><link rel='alternate' type='text/html' href='http://memo-off.blogspot.com/2016/02/skype-version-718.html' title='Skypeの広告を非表示にする Version 7.18編'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03247442628823360053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4ZglJALyUrd36pWnRAqK1GomzDmMNPqnKXoZEkAqSlsgBC8n8M7EQ6kaAy5QhnmoObF-xi6KXTiy40wlDMdhHhaaKaU4L1R8ybXcqYwjmqRrajFx8KWhagwAAuR8TZwRKChJjX4L4f4PU/s72-c/skype.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4014060824118902191.post-7516174653483355025</id><published>2016-02-04T19:29:00.000+09:00</published><updated>2016-02-04T19:29:23.146+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="tcpdump"/><title type='text'>tcpdumpでHTTP通信を覗く</title><content type='html'>まず、前提として&lt;br /&gt;
TCPヘッダのヘッダ長は先頭から 12[Byte] offset された後の4[bit] に記述されており、そのbit値を4倍することでヘッダ長になる&lt;br /&gt;
&lt;br /&gt;
TCPヘッダ長を得るために&lt;br /&gt;
tcp[12:1]&lt;br /&gt;
で、12[Byte]オフセットしたところから1[Byte](8[bit])を取得し&lt;br /&gt;
&amp; 0xf0&lt;br /&gt;
で、その後半を0にするために0xf0 (1111 0000)との積を採る&lt;br /&gt;
後半の0000を捨てて（右に4[bit]シフト）、4倍する（左に2[bit]シフト）をまとめて実行→右に2[bit]シフト&lt;br /&gt;
&gt;&gt; 2&lt;br /&gt;
その、TCPのヘッダ長をオフセットとしてデータ部からMETHODが書かれている先頭部分を取得（ここでは4[Byte]）&lt;br /&gt;
tcp[((tcp[12:1] &amp; 0xf0) &gt;&gt; 2):4]&lt;br /&gt;
これが、&quot;GET &quot;であればtrueとする&lt;br /&gt;
= 0x47455420&lt;br /&gt;
&lt;br /&gt;
&quot;GET &quot;のASCIIコード表現は次のように取得&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;$ echo &quot;GET &quot;|hexdump -C
00000000  47 45 54 20 0a        |GET .|
00000005
&lt;/pre&gt;&lt;br /&gt;
これにより、GETメソッドだけフィルタするには&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;sudo tcpdump -s 0 -A &#39;tcp[((tcp[12:1] &amp; 0xf0) &gt;&gt; 2):4] = 0x47455420&#39;
&lt;/pre&gt;&lt;br /&gt;
■POSTだけフィルタ&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;sudo tcpdump -s 0 -A &#39;tcp dst port 80 and (tcp[((tcp[12:1] &amp; 0xf0) &gt;&gt; 2):4] = 0x504f5354)&#39;
&lt;/pre&gt;&lt;br /&gt;
■リクエスト、レスポンス、ボディだけフィルタ&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;sudo tcpdump -A -s 0 &#39;tcp port 80 and (((ip[2:2] - ((ip[0]&amp;0xf)&lt;&lt;2)) - ((tcp[12]&amp;0xf0)&gt;&gt;2)) != 0)&#39;
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://memo-off.blogspot.com/feeds/7516174653483355025/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://memo-off.blogspot.com/2016/02/tcpdumphttp.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/7516174653483355025'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/7516174653483355025'/><link rel='alternate' type='text/html' href='http://memo-off.blogspot.com/2016/02/tcpdumphttp.html' title='tcpdumpでHTTP通信を覗く'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03247442628823360053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4014060824118902191.post-8937376442983101431</id><published>2016-02-04T18:39:00.001+09:00</published><updated>2016-02-04T18:39:21.626+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="awk"/><title type='text'>awk Tips</title><content type='html'>awkについてφ(・ω・ )ﾒﾓﾒﾓ&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;標準入力をそのまま標準出力に出力する。
$ cat foo.txt | awk &#39;{print $0}&#39;
標準入力をそのまま標準出力に出力する。
$ cat foo.txt | awk &#39;1&#39;
空行を削除する。
$ awk &#39;/./&#39; foo.txt
空行を削除する。
$ awk &#39;NF&#39; foo.txt
最初の 10 行を表示する。
$ awk &#39;NF &gt;= 10&#39; foo.txt
一行ごとに改行を追加する。
$ awk &#39;1;{print &quot;&quot;}&#39; foo.txt
一行ごとに改行を追加する。
awk &#39;BEGIN{ORS=&quot;\n\n&quot;};1&#39; foo.txt
ファイルに行番号を付ける。
$ awk &#39;$0 = NR OFS $0&#39; foo.txt
ファイルに行番号を付ける。
$ awk &#39;{print NR &quot;\t&quot; $0}&#39; foo.txt
ファイル毎に行番号を付ける。
$ awk &#39;{prin FNR &quot;\t&quot; $0}&#39; foo*.txt
行番号を 4 桁で表示させる。
$ awk &#39;{printf(&quot;%4d : %s\n&quot;, NR, $0)}&#39; foo.txt
最も長い行の長さを表示する。
$ awk &#39;{if (length($0) &gt; max) max = length($0)} END {print max}&#39; foo.txt
80 文字を越える行を表示する。
$ awk &#39;length($0) &gt; 80&#39; foo.txt
0 から 100 までの間の乱数を 5 つ表示する。
$ awk &#39;BEGIN {for (i = 1; i &lt;= 7; i++) print int(101 * rand())}&#39;
ファイルの行数を数える。
$ awk &#39;END {print NR}&#39; foo.txt
奇数行を表示する。
$ awk &#39;NR % 2 == 1&#39; foo.txt
偶数行を表示する。
$ awk &#39;NR % 2 == 0&#39; foo.txt
最初の 1 行を表示する。
$ awk &#39;NR == 1&#39; foo.txt
最初の 1 行を表示する。
$ awk &#39;{print; exit}&#39; foo.txt
最後の 1 行を表示する。
$ awk &#39;END {print}&#39; foo.txt
最後の 1 行を表示する。
$ awk &#39;{last = $0} END {print last}&#39; foo.txt
同一行の削除を行う。(uniq)
$ awk &#39;a !~ $0; {a = $0}&#39; foo.txt
同一行の削除を行う。(uniq)
$ awk &#39;{if ($0 != line || NR == 1) print; line = $0}&#39; foo.txt
行のソートを行う。(gawk 以上)
$ gawk &#39;{line[NR] = $0} END {asort(line); for (i = 1; i &lt;= length(line); i++) print line[i]}&#39; foo.txt
10 行目から 20 行目までを表示する。
$ awk &#39;NR == 10, NR == 20 {print $0}&#39; foo.txt
1 から 10 までの数字を生成する。
$ awk &#39;BEGIN {for (i == 1; i &lt;= 10; i++) print i}&#39;
&#39;#&#39; で始まるコメントを削除する。
$ awk &#39;{sub(/#.*/, &quot;&quot;, $0)}1&#39; foo.txt
さいころを作る。
$ awk &#39;BEGIN {srand();print int(rand() * 6 + 1)}&#39;
ワード数をカウントする。
$ awk &#39;{n += NF} END {print n}&#39; foo.txt
文字数をカウントする。
$ awk &#39;{n += length($0)} END {print n}&#39; foo.txt
Load Average を表示する。(Linux のみ)
$ awk &#39;{print $1}&#39; /proc/loadavg
yes コマンドを作る。(延々と &#39;y&#39; を返す)
$ awk &#39;BEGIN {for (;;) print &quot;y&quot;}&#39;
yes コマンドを作る。(延々と &#39;y&#39; を返す)
$ awk &#39;BEGIN {while (awk != &quot;Perl&quot;) print &quot;y&quot;}&#39;
Apache のログにある IP アドレスからホスト名をリアルタイムで引く。(root のみ)
# tail -f /var/log/httpd/access_log | gawk &#39;{system (&quot;dig -x&quot; $1 &quot; +short&quot;)}&#39;
Apache のログからリンク元をリアルタイムで表示する。(root のみ)
# tail -f /var/log/httpd/access_log | gawk -F\&quot; &#39;$4!~/gauc/&amp;&amp;$4!=&quot;-&quot;{fflush();print $4}&#39;
CSV (カンマ区切り) から TSV (タブ区切り) への変換を行う。
$ awk -v FS=&#39;,&#39; -v OFS=&#39;\t&#39; &#39;$1=$1&#39; foo.txt
TSV (タブ区切り) から CSV (カンマ区切り) への変換を行う。
$ awk -v OFS=&#39;,&#39; -v FS=&#39;\t&#39; &#39;$1=$1&#39; foo.txt
各フィールドの和を求める。
$ awk &#39;{for (i = 1; i &lt;= NF; i++) s += $i} $0=s&#39; foo.txt
各行のフィールド数を表示する。
$ awk &#39;{print NF &quot;:&quot; $0}&#39; foo.txt
最後の行のフィールド数を表示する。
$ awk &#39;{s = NF} END {print NF}&#39; foo.txt
フィールドが 5 以上の行を表示する。
$ awk &#39;NF &gt;= 5&#39; foo.txt
改行 CR/LF を LF に変換する。
$ awk &#39;sub(/\r$/,&quot;&quot;)&#39; foo.txt
改行 LF を CR/LF に変換する。
$ awk &#39;sub(/$/,&quot;\r&quot;)&#39; foo.txt
行頭の空白とタブを削除する。
$ awk &#39;{sub(/^[ \t]+/, &quot;&quot;)}1&#39; foo.txt
行末の空白とタブを削除する。
$ awk &#39;{sub(/[ \t]+$/, &quot;&quot;)}1&#39; foo.txt
行頭と行末の空白とタブを削除する。
$ awk &#39;{gsub(/^[ \t]+|[ \t]+$/, &quot;&quot;)}1&#39; foo.txt
行頭と行末の空白とタブを削除する。(フィールドも再構成される)
$ awk &#39;$1 = $1&#39; foo.txt
最後の行から表示する。(tac)
$ &#39;{a[i++] = $0} END {for (j = i - 1; j &gt;= 0;) print a[j--]}&#39; foo.txt
正規表現 abc の行を表示する。(grep)
$ awk &#39;/abc/&#39; foo.txt
正規表現 abc にマッチしない行を表示する。(grep -v)
$ awk &#39;! /abc/&#39; foo.txt
Pattern にマッチした前の行を表示する。
$ awk &#39;/Pattern/ {print a} {a=$0}&#39; foo.txt
Pattern にマッチした前の行を表示する。
$ awk &#39;{D[NR] = $0} /match/ {print D[NR-1]}&#39; foo.txt
ファイルサイズが 0 byte のものを表示する。
$ ls -al | awk &#39;$5==0 {print $8}&#39;
Subversion の svn status で &#39;?&#39; の付くファイルを全て svn add する。
$ svn status | gawk &#39;/^?/{print $2}&#39; | xargs svn add&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://memo-off.blogspot.com/feeds/8937376442983101431/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://memo-off.blogspot.com/2016/02/awk-tips.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/8937376442983101431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/8937376442983101431'/><link rel='alternate' type='text/html' href='http://memo-off.blogspot.com/2016/02/awk-tips.html' title='awk Tips'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03247442628823360053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4014060824118902191.post-403976928378953895</id><published>2016-02-04T18:36:00.001+09:00</published><updated>2016-02-04T18:36:45.338+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Amazon Linux AMI"/><category scheme="http://www.blogger.com/atom/ns#" term="Anti Virus"/><category scheme="http://www.blogger.com/atom/ns#" term="AWS"/><title type='text'>Amazon Linuxで無料のウイルススキャン実施</title><content type='html'>オープンソースなantivirus engineである&lt;a href=&quot;http://www.clamav.net/&quot;&gt;ClamAV&lt;/a&gt;が利用できます。&lt;br /&gt;
&lt;br /&gt;
■インストール&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;# yum install clamav
&lt;/pre&gt;&lt;br /&gt;
■設定&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;# vi /etc/freshclam.conf
Example  表記をコメントアウト
&lt;/pre&gt;&lt;br /&gt;
■定義ファイル更新&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;freshclam
&lt;/pre&gt;&lt;br /&gt;
■スキャン実行&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;clamscan --exclude-dir=&quot;/sys/&quot; -r -i /
&lt;/pre&gt;&lt;br /&gt;
※以下のようなエラーが出るので、回避策として/sys/を除外しています&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;LibClamAV Warning: fmap_readpage: pread fail: asked for 4085 bytes @ offset 11, got 0
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://memo-off.blogspot.com/feeds/403976928378953895/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://memo-off.blogspot.com/2016/02/amazon-linux.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/403976928378953895'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/403976928378953895'/><link rel='alternate' type='text/html' href='http://memo-off.blogspot.com/2016/02/amazon-linux.html' title='Amazon Linuxで無料のウイルススキャン実施'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03247442628823360053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4014060824118902191.post-1843263460957945367</id><published>2015-12-21T15:11:00.001+09:00</published><updated>2015-12-21T15:11:33.788+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="proxy"/><category scheme="http://www.blogger.com/atom/ns#" term="yum"/><title type='text'>yumでその場限りのproxy設定をする</title><content type='html'>/etc/yum.confに記述するならば&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;proxy=http://xxx.xxx.xxx.xxx:3128
&lt;/pre&gt;&lt;br /&gt;
な感じですが、一発だけproxy設定したい場合は&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;$ yum --setopt=proxy=http://xxx.xxx.xxx.xxx:3128 info ntp
&lt;/pre&gt;&lt;br /&gt;
な感じでOKヾ(*･∀･)ノ&quot;</content><link rel='replies' type='application/atom+xml' href='http://memo-off.blogspot.com/feeds/1843263460957945367/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://memo-off.blogspot.com/2015/12/yumproxy.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/1843263460957945367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/1843263460957945367'/><link rel='alternate' type='text/html' href='http://memo-off.blogspot.com/2015/12/yumproxy.html' title='yumでその場限りのproxy設定をする'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03247442628823360053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4014060824118902191.post-5522956316832582745</id><published>2015-12-09T07:03:00.003+09:00</published><updated>2015-12-09T07:03:30.765+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Windows Update"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows10"/><title type='text'>Windows10のWindowsUpdateでKB3122947が0x80070643エラーになる場合の対処法</title><content type='html'>1. スタートメニューを開き cmd と入力&lt;br /&gt;
2. 検索されてでてきた　コマンドプロンプト　を右クリックし　管理者として実行　を選択する&lt;br /&gt;
3. エクスプローラーを開き　C:\Windows\SoftwareDistribution\Download\c4a1b8896ce9fbfea96c1ee6890d52a5　に　windows10.0-kb3122947-x64.cab　があることを確認する&lt;br /&gt;
4. dism /online /add-package /packagepath:C:\Windows\SoftwareDistribution\Download\c4a1b8896ce9fbfea96c1ee6890d52a5\windows10.0-kb3122947-x64.cab を実行する&lt;br /&gt;
&lt;pre&gt;C:\WINDOWS\system32&gt;dism /online /add-package /packagepath:C:\Windows\SoftwareDistribution\Download\c4a1b8896ce9fbfea96c1ee6890d52a5\windows10.0-kb3122947-x64.cab

展開イメージのサービスと管理ツール
バージョン: 10.0.10586.0

イメージのバージョン: 10.0.10586.0

1 / 1 を処理しています - パッケージ Package_for_KB3122947~31bf3856ad364e35~amd64~~10.0.1.0 を追加しています
[==========================100.0%==========================]
操作は正常に完了しました。
&lt;/pre&gt;5. 再度WindowsUpdateを実行しエラーがなくなっていることを確認</content><link rel='replies' type='application/atom+xml' href='http://memo-off.blogspot.com/feeds/5522956316832582745/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://memo-off.blogspot.com/2015/12/windows10windowsupdatekb31229470x800706.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/5522956316832582745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/5522956316832582745'/><link rel='alternate' type='text/html' href='http://memo-off.blogspot.com/2015/12/windows10windowsupdatekb31229470x800706.html' title='Windows10のWindowsUpdateでKB3122947が0x80070643エラーになる場合の対処法'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03247442628823360053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4014060824118902191.post-3508166596677254048</id><published>2015-11-15T09:28:00.000+09:00</published><updated>2015-11-15T09:28:23.037+09:00</updated><title type='text'>Power Shellで全ファイルをファイル名の逆順でタイムスタンプ更新</title><content type='html'>&lt;pre&gt;Get-ChildItem . -Recurse|sort -descending|%{Set-ItemProperty $_.fullname -Name LastWriteTime  -Value $(Get-Date)|start-sleep -m 1}
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://memo-off.blogspot.com/feeds/3508166596677254048/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://memo-off.blogspot.com/2015/11/power-shell.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/3508166596677254048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/3508166596677254048'/><link rel='alternate' type='text/html' href='http://memo-off.blogspot.com/2015/11/power-shell.html' title='Power Shellで全ファイルをファイル名の逆順でタイムスタンプ更新'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03247442628823360053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4014060824118902191.post-5281001948781786021</id><published>2015-09-29T21:31:00.003+09:00</published><updated>2015-09-29T21:33:31.535+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Amazon Linux AMI"/><category scheme="http://www.blogger.com/atom/ns#" term="rsyslog"/><title type='text'>Amazon Linuxにrsyslog v8をインストール</title><content type='html'>&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;# vi /etc/yum.repos.d/rsyslog.repo
----
[rsyslog_v8]
name=Adiscon CentOS-$releasever - local packages for $basearch
baseurl=http://rpms.adiscon.com/v8-stable/epel-7/$basearch
enabled=0
gpgcheck=0
gpgkey=http://rpms.adiscon.com/RPM-GPG-KEY-Adiscon
protect=1
----
# /usr/bin/yum install rsyslog --enablerepo=rsyslog_v8 --setopt=rsyslog_v8.priority=1

=======================================================================================================
 Package        Arch        Version     Repository        Size
=======================================================================================================
Updating:
 rsyslog        x86_64        8.13.0-1.el7    rsyslog_v8       627 k
Installing for dependencies:
 json-c         x86_64        0.11-6.8.amzn1    amzn-main        31 k
 libestr        x86_64        0.1.10-1.el7    rsyslog_v8       9.3 k
 libgt         x86_64        0.3.11-1.el7    rsyslog_v8        58 k
 libksi         x86_64        3.2.2.0-1.el7    rsyslog_v8        96 k
 liblogging        x86_64        1.0.5-1.el7    rsyslog_v8        25 k

Transaction Summary
=======================================================================================================
Install      ( 5 Dependent packages)
Upgrade  1 Package

Total download size: 846 k
Is this ok [y/d/N]: y
&lt;/pre&gt;&lt;br /&gt;
これで行けましたヾ(*･∀･)ノ”</content><link rel='replies' type='application/atom+xml' href='http://memo-off.blogspot.com/feeds/5281001948781786021/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://memo-off.blogspot.com/2015/09/amazon-linuxrsyslog-v8.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/5281001948781786021'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/5281001948781786021'/><link rel='alternate' type='text/html' href='http://memo-off.blogspot.com/2015/09/amazon-linuxrsyslog-v8.html' title='Amazon Linuxにrsyslog v8をインストール'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03247442628823360053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4014060824118902191.post-2433611097114223860</id><published>2015-09-14T11:34:00.003+09:00</published><updated>2015-09-14T11:34:40.839+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="awk"/><category scheme="http://www.blogger.com/atom/ns#" term="Shell Script"/><title type='text'>ログファイルから指定範囲のタイムスタンプが付いた行を切り出す</title><content type='html'>ログファイルのタイムスタンプが&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;2015-09-14T02:29:05+00:00 ....
&lt;/pre&gt;の様な形式だとして、5分前以降のログを切り出すならば次のような具合でいけます&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;$ awk -v from=$(date &#39;+%Y-%m-%dT%H:%M:%S&#39; -d &#39;5 minute ago&#39;) -F+ &#39;from &lt; $1&#39; /var/log/hoge.log
&lt;/pre&gt;

5分前から1分前までだとしたらこんな具合
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;awk -v from=$(date &#39;+%Y-%m-%dT%H:%M:%S&#39; -d &#39;2 minute ago&#39;) -v to=$(date &#39;+%Y-%m-%dT%H:%M:%S&#39; -d &#39;1 minute ago&#39;) -F+ &#39;from &lt; $1, to &lt;= $1&#39; /var/log/hoge.log
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://memo-off.blogspot.com/feeds/2433611097114223860/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://memo-off.blogspot.com/2015/09/blog-post.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/2433611097114223860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/2433611097114223860'/><link rel='alternate' type='text/html' href='http://memo-off.blogspot.com/2015/09/blog-post.html' title='ログファイルから指定範囲のタイムスタンプが付いた行を切り出す'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03247442628823360053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4014060824118902191.post-6796608631724908819</id><published>2015-08-27T20:24:00.001+09:00</published><updated>2015-08-27T20:24:20.684+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Bash"/><category scheme="http://www.blogger.com/atom/ns#" term="シェルスクリプト"/><title type='text'>シェルスクリプトで変数のデフォルト値を使う</title><content type='html'>&lt;table&gt;&lt;tr&gt;&lt;td&gt;${var:-foo}&lt;/td&gt;&lt;td&gt;変数varが未定義の時fooを返す&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;${var:=foo}&lt;/td&gt;&lt;td&gt;変数varが未定義の時fooを代入する。&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;${var:+foo}&lt;/td&gt;&lt;td&gt;変数varに値がセットされているときfooを返す&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;${var:?puyo}&lt;/td&gt;&lt;td&gt;変数varが未定義の時&quot;puyo&quot;を出力しexit 1する&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;br /&gt;
な感じで使えます(ﾉﾟ⊿ﾟ)ﾉ</content><link rel='replies' type='application/atom+xml' href='http://memo-off.blogspot.com/feeds/6796608631724908819/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://memo-off.blogspot.com/2015/08/blog-post_27.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/6796608631724908819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/6796608631724908819'/><link rel='alternate' type='text/html' href='http://memo-off.blogspot.com/2015/08/blog-post_27.html' title='シェルスクリプトで変数のデフォルト値を使う'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03247442628823360053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4014060824118902191.post-390026011883892604</id><published>2015-08-26T12:35:00.001+09:00</published><updated>2015-08-26T12:35:36.861+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Bash"/><category scheme="http://www.blogger.com/atom/ns#" term="cron"/><category scheme="http://www.blogger.com/atom/ns#" term="シェルスクリプト"/><title type='text'>cronから起動されたスクリプトの多重起動チェック</title><content type='html'>多重起動チェックについてググってみると次のような例が多く見つかりました&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;[[ $$ != `pgrep -fo &quot;$0&quot;`  ]] echo &quot;$0 is already running&quot; &amp;&amp; exit 2
&lt;/pre&gt;&lt;br /&gt;
これは、自身と同じプロセス名を検索して、&lt;br&gt;&lt;br /&gt;
そのもっとも古いプロセスIDが自身のプロセスIDと一致していればおーけー&lt;br&gt;&lt;br /&gt;
という処理になります。&lt;br&gt;&lt;br /&gt;
ただ、これは直接スクリプトを実行した場合にのみ有効で&lt;br&gt;&lt;br /&gt;
cronなどから子プロセスそしてスクリプトを実行した場合は&lt;br&gt;&lt;br /&gt;
$$は子プロセスとして起動されたスクリプトのプロセスID&lt;br&gt;&lt;br /&gt;
pgrep -fo &quot;$0&quot;で引っかかってくるのが起動元の親プロセスのIDとなり&lt;br&gt;&lt;br /&gt;
一致しないので、多重起動として扱われてしまいました(´・ω・`)&lt;br&gt;&lt;br /&gt;
これに対応するため、親プロセスIDが格納される$PPIDとの比較も追加して次のようにしてみました&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;[[ $$ != `pgrep -fo &quot;$0&quot;`  ]] &amp;&amp; [[ $PPID != `pgrep -fo &quot;$0&quot;`  ]] &amp;&amp; echo &quot;$0 is already running&quot; &amp;&amp; exit 2
&lt;/pre&gt;&lt;br /&gt;
これで、直接起動した場合も、cronなどから子プロセスとして起動した場合も多重起動チェックできますヾ(*･ω･)ｼ</content><link rel='replies' type='application/atom+xml' href='http://memo-off.blogspot.com/feeds/390026011883892604/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://memo-off.blogspot.com/2015/08/cron.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/390026011883892604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/390026011883892604'/><link rel='alternate' type='text/html' href='http://memo-off.blogspot.com/2015/08/cron.html' title='cronから起動されたスクリプトの多重起動チェック'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03247442628823360053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4014060824118902191.post-2716552118596370628</id><published>2015-08-26T12:21:00.002+09:00</published><updated>2015-08-26T12:21:54.069+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Bash"/><category scheme="http://www.blogger.com/atom/ns#" term="シェルスクリプト"/><title type='text'>シェルスクリプトで変数に格納された文字列から部分文字列を抽出する</title><content type='html'>&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;str=abcdefg

echo ${str:0:2}  # ab
echo ${str:2:2}  # cd
&lt;/pre&gt;&lt;br /&gt;
な感じ(ﾉﾟ⊿ﾟ)ﾉ</content><link rel='replies' type='application/atom+xml' href='http://memo-off.blogspot.com/feeds/2716552118596370628/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://memo-off.blogspot.com/2015/08/blog-post.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/2716552118596370628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/2716552118596370628'/><link rel='alternate' type='text/html' href='http://memo-off.blogspot.com/2015/08/blog-post.html' title='シェルスクリプトで変数に格納された文字列から部分文字列を抽出する'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03247442628823360053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4014060824118902191.post-3979587021659463878</id><published>2015-03-20T10:00:00.004+09:00</published><updated>2015-03-20T10:00:57.491+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CentOS"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="sudo"/><title type='text'>sudo初回実行時のレクチャメッセージを改めて表示する</title><content type='html'>■Cent OS 6.xの場合&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;# find / -name &lt;ユーザ名&gt;
/var/spool/mail/&lt;ユーザ名&gt;
/var/db/sudo/&lt;ユーザ名&gt;
/home/&lt;ユーザ名&gt;
&lt;/pre&gt;な感じでひっかかってくるので&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;# rm -rf /var/db/sudo/&lt;ユーザ名&gt;
&lt;/pre&gt;&lt;br /&gt;
■Cent OS 5.xの場合&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;# find / -name &lt;ユーザ名&gt;
/var/spool/mail/&lt;ユーザ名&gt;
/var/run/sudo/&lt;ユーザ名&gt;
/home/&lt;ユーザ名&gt;
&lt;/pre&gt;な感じでひっかかってくるので&lt;br /&gt;
&lt;pre class=&quot;xml:nogutter:nocontrols&quot; name=&quot;code&quot;&gt;# rm -rf /var/run/sudo/&lt;ユーザ名&gt;
&lt;/pre&gt;&lt;br /&gt;
これでsudoを実行すると改めて表示されます</content><link rel='replies' type='application/atom+xml' href='http://memo-off.blogspot.com/feeds/3979587021659463878/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://memo-off.blogspot.com/2015/03/sudo.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/3979587021659463878'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014060824118902191/posts/default/3979587021659463878'/><link rel='alternate' type='text/html' href='http://memo-off.blogspot.com/2015/03/sudo.html' title='sudo初回実行時のレクチャメッセージを改めて表示する'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03247442628823360053</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>