<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule" >
  <channel>
  <title>ゆるいSEの小ネタ集</title>
  <link>http://yuruse.tou3.com/</link>
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://yuruse.tou3.com/RSS/" />
  <description>ゆるキャラ好きのITエンジニアが書くTips。

ゆるキャラ命なSEのIT徒然草
https://itmagic.hatenablog.com/

</description>
  <lastBuildDate>Mon, 02 Mar 2020 13:08:12 GMT</lastBuildDate>
  <language>ja</language>
  <copyright>© Ninja Tools Inc.</copyright>
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" />

    <item>
    <title>Xサーバ</title>
    <description>
    <![CDATA[■Xサーバとは<br />
Unix上のアプリケーションを、端末（PC）側でGUI表示するソフト。<br />
クライアント側で動くのに、サーバと呼ぶ。。<br />
<br />
参考<br />
http://www.atmarkit.co.jp/flinux/special/ctl_xserver/xserver08.html]]>
    </description>
    <category>unix/linux</category>
    <link>http://yuruse.tou3.com/unix/x%E3%82%B5%E3%83%BC%E3%83%90</link>
    <pubDate>Tue, 10 Oct 2017 15:25:02 GMT</pubDate>
    <guid isPermaLink="false">yuruse.tou3.com://entry/258</guid>
  </item>
    <item>
    <title>[unix]uncompress</title>
    <description>
    <![CDATA[<div>[用途]</div>
<div>Z形式を解凍</div>
<div>[使用例]</div>
<div>$uncompress test1.tar.Z</div>
<div>&rarr;test1.tarが出力される。</div>
<div></div>]]>
    </description>
    <category>unix/linux</category>
    <link>http://yuruse.tou3.com/unix/-unix-uncompress</link>
    <pubDate>Thu, 05 Oct 2017 14:50:36 GMT</pubDate>
    <guid isPermaLink="false">yuruse.tou3.com://entry/257</guid>
  </item>
    <item>
    <title>[unixコマンド]tar</title>
    <description>
    <![CDATA[<div>[用途]</div>
<div>ファイル・ディレクトリをTAR形式で固める</div>
<div><br />
<br />
[使用例]</div>
<div>1)特定ディレクトリをTAR化</div>
<div>$tar cvf&nbsp; logs.tar logs/</div>
<div>&rarr;カレントのlogsディレクトリが固められ、logs.tar</div>
<div>というファイルが生成される。(logs自体は消去されない）</div>
<div><br />
★TARコマンドの注意事項</div>
<div>以下のように、圧縮対象を/からの絶対パスで指定すると、絶対パス形式でTAR化される。</div>
<div>tar cvf&nbsp; logs.tar /opt/aaa/bbb/logs</div>
<div>この場合、tar xvfコマンド実行時に、</div>
<div>絶対パスで指定したディレクトリに対し解凍される。</div>
<div>従って、既存ディレクトリがある場合は上書きしてしまう。</div>
<div>（tar内の古いファイルで上書きしてしまう、といった事故が発生する恐れがある）</div>
<div>これを防ぐため、tar化する際は、tar化対象ディレクトリまで移動し、</div>
<div>tarコマンドを実行することを推奨する。(下記例)</div>
<div>cd /opt/aaa/bbb/</div>
<div>tar cvf logs.tar logs</div>
<div><br />
2)特定ファイルをTAR化</div>
<div>$tar -cvf files.tar file1.txt file2.txt file3.txt</div>
<div>&rarr;file1～3.txtが圧縮される。</div>
<div><br />
3)tarを解凍</div>
<div>$tar xvf test1.tar</div>
<div>&rarr;test1.tarが解凍される。（tarファイルはそのまま残る）</div>
<div><br />
4)tarの中身を確認する</div>
<div>$tar tvf&nbsp; test1.tar</div>
<div>&rarr;test1.tarの中身が一覧表示される。tar解凍前に、期待するファイルが存在するかどうか確認する場合に使用。</div>
<div><br />
<br />
[オプション]</div>
<div>c：圧縮</div>
<div>x：解凍</div>
<div>t：中身の表示 v：解凍状況をコンソール表示（使用しないことで処理高速化できる）</div>
<div>h：シンボリックリンクの先も実体のファイルとしてtarに取り込む</div>]]>
    </description>
    <category>unix/linux</category>
    <link>http://yuruse.tou3.com/unix/-unix%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89-tar</link>
    <pubDate>Thu, 05 Oct 2017 14:45:20 GMT</pubDate>
    <guid isPermaLink="false">yuruse.tou3.com://entry/255</guid>
  </item>
    <item>
    <title>[unixコマンド]システム情報採取(sar)</title>
    <description>
    <![CDATA[<div>□用途</div>
<div>システム動作状況(主にCPU使用状況)レポート</div>
<div><br />
□使用例</div>
<div>1)CPU使用率を出力</div>
<div>#sar 3 10 (3秒間隔で10回)</div>
<div>&nbsp; 07:29:58&nbsp; %usr&nbsp; %sys&nbsp; %wio&nbsp; %idle</div>
<div>&nbsp; 07:30:01&nbsp; &nbsp;60&nbsp; &nbsp; 7&nbsp; &nbsp; 8&nbsp; &nbsp;25</div>
<div>&nbsp; 07:30:04&nbsp; &nbsp;12&nbsp; &nbsp; 9&nbsp; &nbsp; 1&nbsp; &nbsp;78</div>
<div>&nbsp; 07:30:07&nbsp; &nbsp;10&nbsp; &nbsp; 4&nbsp; &nbsp;35&nbsp; &nbsp;51</div>
<div>&nbsp; 07:30:10&nbsp; &nbsp; 4&nbsp; &nbsp; 5&nbsp; &nbsp;64&nbsp; &nbsp;27</div>
<div>&nbsp; 07:30:13&nbsp; &nbsp; 2&nbsp; &nbsp; 4&nbsp; &nbsp;87&nbsp; &nbsp; 8</div>
<div>&nbsp; 07:30:16&nbsp; &nbsp; 2&nbsp; &nbsp; 4&nbsp; &nbsp;90&nbsp; &nbsp; 5</div>
<div>&nbsp; 07:30:19&nbsp; &nbsp;30&nbsp; &nbsp; 3&nbsp; &nbsp;66&nbsp; &nbsp; 1</div>
<div>&nbsp; 07:30:22&nbsp; &nbsp;54&nbsp; &nbsp; 3&nbsp; &nbsp;40&nbsp; &nbsp; 3</div>
<div>&nbsp; 07:30:25&nbsp; &nbsp;33&nbsp; &nbsp;15&nbsp; &nbsp; 9&nbsp; &nbsp;43</div>
<div>&nbsp; 07:30:28&nbsp; &nbsp;38&nbsp; &nbsp; 2&nbsp; &nbsp;10&nbsp; &nbsp;51</div>
<div>&nbsp; Average&nbsp; &nbsp; 24&nbsp; &nbsp; 5&nbsp; &nbsp;41&nbsp; &nbsp;29</div>
<div>[表示の意味]</div>
<div>・sys</div>
<div>&nbsp; カーネル内でそのプロセス(平たく言うとOS自体)がCPUを使用した時間。</div>
<div>&nbsp; 例）open(2) や write(2) などシステムコールの実行時間。</div>
<div>・usr</div>
<div>&nbsp; java等のアプリそのものの処理がCPUを使用した時間。</div>
<div>&nbsp; 例）加減乗除算、関数呼び出し操作、if 文やループ終了判定などの条件判定</div>
<div>・wio (wait i/o)</div>
<div>&nbsp; I/O待ち。アイドルの一種。CPUの使用時間には含まない。</div>
<div>2)ディスクの情報を3秒間隔で5回出力する</div>
<div>#sar -dR 3 5 ※dオプション&hellip;ディスク情報表示</div>
<div>&nbsp; 07:31:31&nbsp; device&nbsp; %busy&nbsp; avque&nbsp; &nbsp;r/s&nbsp; &nbsp;w/s blks/s avwait avserv</div>
<div>&nbsp; 07:31:34&nbsp; disk1&nbsp; 5.98&nbsp; 0.50&nbsp; &nbsp; 2&nbsp; &nbsp; 8&nbsp; &nbsp;377&nbsp; 0.00&nbsp; 7.70</div>
<div>&nbsp; 07:31:37&nbsp; disk1&nbsp; 21.59&nbsp; 0.51&nbsp; &nbsp;38&nbsp; &nbsp;19&nbsp; 4490&nbsp; 0.22&nbsp; 11.25</div>
<div>&nbsp; 07:31:40&nbsp; disk1&nbsp; 5.00&nbsp; 0.50&nbsp; &nbsp; 1&nbsp; &nbsp; 8&nbsp; &nbsp;170&nbsp; 0.00&nbsp; 10.41</div>
<div>&nbsp; 07:31:43&nbsp; disk1&nbsp; 6.31&nbsp; 1.69&nbsp; &nbsp; 0&nbsp; &nbsp;17&nbsp; &nbsp;323&nbsp; 4.21&nbsp; 13.90</div>
<div>&nbsp; 07:31:46&nbsp; disk1&nbsp; 35.12&nbsp; 3.39&nbsp; &nbsp; 0&nbsp; &nbsp;128&nbsp; 12505&nbsp; 6.73&nbsp; 11.66</div>
<div>&nbsp; Average&nbsp; &nbsp;disk1&nbsp; 14.78&nbsp; 2.26&nbsp; &nbsp; 8&nbsp; &nbsp;36&nbsp; 3564&nbsp; 4.27&nbsp; 11.50<br />
<br />
</div>
<div>[表示の意味]</div>
<div>device デバイス</div>
<div>%busy ディスクビジー率</div>
<div>avque</div>
<div>r/s</div>
<div>w/s</div>
<div>blks/s</div>
<div>avwait</div>
<div>avserv</div>
<div>3)システムコールの実行状況を3秒間隔で５回出力する。</div>
<div>#sar -c 3 5 ※cオプション&hellip;システムコール情報表示</div>
<div>&nbsp; 07:33:37 scall/s sread/s swrit/s&nbsp; fork/s&nbsp; exec/s rchar/s wchar/s</div>
<div>&nbsp; 07:33:40&nbsp; 73984&nbsp; &nbsp;270&nbsp; &nbsp;209&nbsp; &nbsp;0.00&nbsp; &nbsp;0.00 2536265 1513621</div>
<div>&nbsp; 07:33:43&nbsp; 91504&nbsp; &nbsp;339&nbsp; &nbsp;234&nbsp; &nbsp;0.67&nbsp; &nbsp;1.34 1575385 1667168</div>
<div>&nbsp; 07:33:46&nbsp; 85029&nbsp; &nbsp;273&nbsp; &nbsp;341&nbsp; &nbsp;0.00&nbsp; &nbsp;0.00 1567639 1483269</div>
<div>&nbsp; 07:33:49&nbsp; 58040&nbsp; &nbsp;283&nbsp; &nbsp;209&nbsp; &nbsp;0.00&nbsp; &nbsp;0.00 1729195 1656832</div>
<div>&nbsp; 07:33:52 1417672&nbsp; &nbsp;635&nbsp; &nbsp;196&nbsp; &nbsp;4.01&nbsp; &nbsp;5.35 3457626 1471272</div>
<div>[表示の意味]</div>
<div>・scall</div>
<div>・sread</div>
<div>・srit</div>
<div>・fork</div>
<div>・exec</div>
<div>・rchar</div>
<div>・wchar</div>]]>
    </description>
    <category>unix/linux</category>
    <link>http://yuruse.tou3.com/unix/-unix%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89-%E3%82%B7%E3%82%B9%E3%83%86%E3%83%A0%E6%83%85%E5%A0%B1%E6%8E%A1%E5%8F%96-sar-</link>
    <pubDate>Thu, 05 Oct 2017 14:41:33 GMT</pubDate>
    <guid isPermaLink="false">yuruse.tou3.com://entry/253</guid>
  </item>
    <item>
    <title>[unixコマンド]chmod chown(ファイル情報変更)</title>
    <description>
    <![CDATA[<div>【chmod】</div>
<div>■用途</div>
<div>ファイル・ディレクトリのパーミッション変更</div>
<div><br />
■使用例</div>
<div>1)特定ファイルを変更</div>
<div>$chmod 755 abc.config</div>
<div><br />
2)ディレクトリごと変更</div>
<div>$chmod -R 777 logs</div>
<div>&rarr;logsディレクトリ以下が再帰的に変更される。</div>
<div><br />
<br />
</div>
<div>【chown】</div>
<div>■用途<br />
ファイル・ディレクトリのオーナー変更</div>
<div><br />
■使用例</div>
<div>1)特定ファイルを変更</div>
<div>$chown usr1:grp1 abc.config</div>
<div><br />
2)ディレクトリごと変更</div>
<div>$chown -R usr1:grp1 logs</div>
<div>&rarr;logsディレクトリ以下が再帰的に変更される。</div>]]>
    </description>
    <category>unix/linux</category>
    <link>http://yuruse.tou3.com/unix/-unix%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89-chmod%20chown-%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E6%83%85%E5%A0%B1%E5%A4%89%E6%9B%B4-</link>
    <pubDate>Thu, 05 Oct 2017 14:40:15 GMT</pubDate>
    <guid isPermaLink="false">yuruse.tou3.com://entry/252</guid>
  </item>
    <item>
    <title>[unixコマンド]rm</title>
    <description>
    <![CDATA[<div>■用途</div>
<div>ファイル・ディレクトリ削除</div>
<div><br />
■使用例</div>
<div>1)ファイル削除</div>
<div>$rm sample.txt</div>
<div><br />
2)ディレクトリ削除</div>
<div>$rm -r dir1</div>
<div>&rarr;rオプションでディレクトリ削除可能。</div>
<div><br />
3)ディレクトリ一括削除</div>
<div>$rm -r DIR[ABCDE]_1</div>
<div>&rarr;DIRA_1～DIRE_1 が一気に削除できる 。</div>
<div></div>]]>
    </description>
    <category>unix/linux</category>
    <link>http://yuruse.tou3.com/unix/-unix%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89-rm</link>
    <pubDate>Thu, 05 Oct 2017 14:38:09 GMT</pubDate>
    <guid isPermaLink="false">yuruse.tou3.com://entry/251</guid>
  </item>
    <item>
    <title>[unixコマンド]mv(移動)</title>
    <description>
    <![CDATA[<div>■用途</div>
<div>ファイルを移動する</div>
<div><br />
■使用例</div>
<div>1)ファイルを/tmpに移動する</div>
<div>$mv abc.sh /tmp/</div>
<div><br />
2)ディレクトリを移動する</div>
<div>$mv tempdir /tmp/</div>
<div><br />
3)ファイルをdef.shにリネームする</div>
<div>$mv abc.sh def.sh</div>
<div></div>
<div></div>]]>
    </description>
    <category>unix/linux</category>
    <link>http://yuruse.tou3.com/unix/-unix%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89-mv-%E7%A7%BB%E5%8B%95-</link>
    <pubDate>Thu, 05 Oct 2017 14:36:59 GMT</pubDate>
    <guid isPermaLink="false">yuruse.tou3.com://entry/250</guid>
  </item>
    <item>
    <title>[bat]ローカルユーザ作成</title>
    <description>
    <![CDATA[<div>ユーザ作成</div>
<div>net user<span style="white-space: pre;"> </span>testuser1<span style="white-space: pre;"> </span>testpassword1<span style="white-space: pre;"> </span>/fullname:"徳川 家康"<span style="white-space: pre;"> </span>/comment:"担当者１"<span style="white-space: pre;"> </span>/passwordchg:no<span style="white-space: pre;"> </span>/add</div>
<div></div>
<div>グループ作成</div>
<div>net<span style="white-space: pre;"> </span>localgroup<span style="white-space: pre;"> </span>GROUP1<span style="white-space: pre;"> </span>testuser1<span style="white-space: pre;"> </span>/add</div>
<div></div>]]>
    </description>
    <category>Windows</category>
    <link>http://yuruse.tou3.com/windows/-bat-%E3%83%AD%E3%83%BC%E3%82%AB%E3%83%AB%E3%83%A6%E3%83%BC%E3%82%B6%E4%BD%9C%E6%88%90_247</link>
    <pubDate>Thu, 28 Sep 2017 21:44:12 GMT</pubDate>
    <guid isPermaLink="false">yuruse.tou3.com://entry/247</guid>
  </item>
    <item>
    <title>[bat]ローカルユーザ作成</title>
    <description>
    <![CDATA[ユーザ作成<br />
net user testuser1 testpassword1<span style="white-space: pre;"> </span>/fullname:"石田 光成"<span style="white-space: pre;"> </span>/comment:"担当者１"<span style="white-space: pre;"> </span>/passwordchg:no<span style="white-space: pre;"> </span>/add<br />
<br />
ユーザをグループへ所属させる<br />
net<span style="white-space: pre;"> </span>localgroup GROUP1&nbsp;testuser1&nbsp;/add]]>
    </description>
    <category>Windows</category>
    <link>http://yuruse.tou3.com/windows/-bat-%E3%83%AD%E3%83%BC%E3%82%AB%E3%83%AB%E3%83%A6%E3%83%BC%E3%82%B6%E4%BD%9C%E6%88%90</link>
    <pubDate>Thu, 28 Sep 2017 21:42:05 GMT</pubDate>
    <guid isPermaLink="false">yuruse.tou3.com://entry/246</guid>
  </item>
    <item>
    <title>バッチからストアド実行</title>
    <description>
    <![CDATA[<div>[execsp.bat]</div>
<div></div>
<div>SET PORT=1433</div>
<div>SET DBSERVER=localhost</div>
<div>SET INSTANCE=MSSQLSERVER</div>
<div>SET DBNAME=DB1</div>
<div></div>
<div>sqlcmd -S %DBSERVER%\%INSTANCE%,%PORT% -v InFiscalYear=2009 -i D:\execsp.sql</div>
<div></div>
<div></div>
<div>[execsp.sql]</div>
<div>sp1というストアドを実行する</div>
<div>EXEC DB1.sp1</div>
<div>'$(InFiscalYear)'</div>
<div></div>]]>
    </description>
    <category>SQLServer</category>
    <link>http://yuruse.tou3.com/sqlserver/%E3%83%90%E3%83%83%E3%83%81%E3%81%8B%E3%82%89%E3%82%B9%E3%83%88%E3%82%A2%E3%83%89%E5%AE%9F%E8%A1%8C</link>
    <pubDate>Thu, 28 Sep 2017 00:14:10 GMT</pubDate>
    <guid isPermaLink="false">yuruse.tou3.com://entry/242</guid>
  </item>

    </channel>
</rss>