<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule" >
  <channel>
  <title>LinuC（Linux技術者認定資格）＆リナックスサーバ構築設定事例</title>
  <link>http://archives.blog-mmo.com/</link>
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://archives.blog-mmo.com/RSS/" />
  <description>◆当blogは、Linuxサーバ構築する際の実際の設定手順を個人的メモとして記載しております。LinuC試験の役に立つ情報があるかも…？</description>
  <lastBuildDate>Wed, 06 May 2026 06:28:23 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>【PowerShell】関数オブジェクト</title>
    <description>
    <![CDATA[<div><strong><span style="color: #808080; font-size: xx-small;">REM ▼▲▼▲▼▲▼▲▼▲▼▲▼</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">REM ▼スクリプトファイル名&nbsp;&nbsp;</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">REM ▲『WinMerge_Excel.bat』</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">REM ▲▼▲▼▲▼▲▼▲▼▲▼▲</span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">@echo off</span></div><div><span style="color: #808080; font-size: xx-small;">REM **************************</span></div><div><span style="color: #808080; font-size: xx-small;">REM # conhost切替</span></div><div><span style="color: #808080; font-size: xx-small;">REM **************************</span></div><div><strong><span style="color: #808080; font-size: xx-small;">if not "%1"=="am_admin" (</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; start conhost "%~f0" am_admin &amp; exit /b</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">)</span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">REM **************************</span></div><div><span style="color: #808080; font-size: xx-small;">REM # 画面サイズ設定</span></div><div><span style="color: #808080; font-size: xx-small;">REM # カラー設定</span></div><div><span style="color: #808080; font-size: xx-small;">REM # 文字コード設定</span></div><div><span style="color: #808080; font-size: xx-small;">REM **************************</span></div><div><strong><span style="color: #808080; font-size: xx-small;">mode con: cols=120 lines=16</span></strong></div><div><span style="color: #808080; font-size: xx-small;">color 0a</span></div><div><span style="color: #808080; font-size: xx-small;">chcp 932</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">timeout 1</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">REM **************************</span></div><div><span style="color: #808080; font-size: xx-small;">REM # PowerShell実行</span></div><div><span style="color: #808080; font-size: xx-small;">REM **************************</span></div><div><strong><span style="color: #808080; font-size: xx-small;">powershell -ExecutionPolicy RemoteSigned -File <span style="color: #0000ff; font-size: xx-small;">"%CD%\WinMerge_Excel.ps1"</span></span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">timeout 5</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">REM **************************</span></div><div><span style="color: #808080; font-size: xx-small;">REM # バッチ終了処理</span></div><div><span style="color: #808080; font-size: xx-small;">REM **************************</span></div><div><span style="color: #808080; font-size: xx-small;">color 17</span></div><div><span style="color: #808080; font-size: xx-small;">cls</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">echo .</span></div><div><span style="color: #808080; font-size: xx-small;">echo " ================= "</span></div><div><span style="color: #808080; font-size: xx-small;">echo " ====== END ====== "</span></div><div><span style="color: #808080; font-size: xx-small;">echo " ================= "</span></div><div><span style="color: #808080; font-size: xx-small;">echo .</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">timeout 3</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><strong><span style="color: #808080; font-size: xx-small;"># ▼▲▼▲▼▲▼▲▼▲▼▲▼</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;"># ▼スクリプトファイル名&nbsp;&nbsp;</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;"># ▲『WinMerge_Excel.ps1』</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;"># ▲▼▲▼▲▼▲▼▲▼▲▼▲</span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;"># ■ .NET クラス読込</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><strong><span style="color: #808080; font-size: xx-small;">Add-Type -AssemblyName System.Windows.Forms</span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;"># ■ 定数設定</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">#【年月日-時分秒】</span></div><div><strong><span style="color: #808080; font-size: xx-small;">$DayTime = Get-Date -Format <span style="color: #0000ff; font-size: xx-small;">"yyyyMMdd-HHmmss"</span></span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">#【WinMerge格納パス】</span></div><div><span style="color: #808080; font-size: xx-small;"># ※ 環境に合わせて以下のパスを設定</span></div><div><strong><span style="color: #808080; font-size: xx-small;">$winMerge = <span style="color: #0000ff;">"C:\Program Files\WinMerge\WinMergeU.exe"</span></span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">#【ポップアップメッセージ】</span></div><div><span style="color: #808080; font-size: xx-small;">$P_MSG_1 = "★★★★★ 【WinMerge】比較元（左側）ファイルを選択 ★★★★★"</span></div><div><span style="color: #808080; font-size: xx-small;">$P_MSG_2 = "★★★★★ 【WinMerge】比較先（右側）ファイルを選択 ★★★★★"</span></div><div><span style="color: #808080; font-size: xx-small;">$P_MSG_3 = "★★★★★ 【WinMerge】出力先を確認ください ★★★★★"</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">#【出力メッセージ】</span></div><div><span style="color: #808080; font-size: xx-small;">$W_MSG_0 = " ================= "</span></div><div><span style="color: #808080; font-size: xx-small;">$W_MSG_1 = " ※※※ 【PowerShell実行 &rArr; WinMerge】 ※※※ "</span></div><div><span style="color: #808080; font-size: xx-small;">$W_MSG_2 = " ※※※ 比較元と比較先のファイルを確認ください ※※※ "</span></div><div><span style="color: #808080; font-size: xx-small;">$W_MSG_3 = " ====== END ====== "</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">#【msgbox オブジェクト生成】</span></div><div><strong><span style="color: #808080; font-size: xx-small;">$msgbox = New-Object -ComObject Wscript.Shell</span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">#【fileDialog オブジェクト生成】</span></div><div><strong><span style="color: #808080; font-size: xx-small;">$FileDialog = New-Object System.Windows.Forms.OpenFileDialog</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">$fileDialog.Title = <span style="color: #0000ff;">"【★★★★★ 対象ファイルを選択してください ★★★★★】"</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">$FileDialog.Filter = <span style="color: #0000ff;">"すべてのファイル (*.*)|*.*"</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">$fileDialog.ValidateNames = <span style="color: #0000ff;">$false</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">$fileDialog.CheckFileExists = <span style="color: #0000ff;">$false</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">$fileDialog.CheckPathExists = <span style="color: #0000ff;">$true</span></span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;"># ■ 関数設定</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">#【ダイアログからパス取得】</span></div><div><span style="color: #ff0000;"><strong><span style="font-size: xx-small;">function Select_File {</span></strong></span></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; if ($FileDialog.ShowDialog() -eq [System.Windows.Forms.DialogResult]::OK) {</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; $filePath = $FileDialog.FileName</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; #-----------------------------</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; #【アクセスチェック】</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; if (Test-Path -LiteralPath $filePath) {</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">return $filePath</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; } else {</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; &nbsp; &nbsp; Write-Error <span style="color: #0000ff;">"【*** Path ERROR ***】 : $_"</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; &nbsp; &nbsp; exit</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; }</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; } else {</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; Write-Host <span style="color: #0000ff;">"選択無し（キャンセル）"</span> -ForegroundColor Yellow</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; exit</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; }</span></strong></div><div><span style="color: #ff0000;"><strong><span style="font-size: xx-small;">}</span></strong></span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;"># ■ 処理開始メッセージ表示</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host " "</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host "$W_MSG_1"</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host " "</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">Start-Sleep 1</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;"># ■ 比較元（左側）を選択</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">$msgbox.popup("$P_MSG_1")</span></div><div><strong><span style="color: #808080; font-size: xx-small;">$PATH_L = <span style="color: #ff0000;">Select_File</span></span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host "【WinMerge】比較元（左側）: $PATH_L"</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">Start-Sleep 1</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;"># ■ 比較先（右側）を選択</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;">$msgbox.popup("$P_MSG_2")</span></div><div><strong><span style="color: #808080; font-size: xx-small;">$PATH_R = <span style="color: #ff0000;">Select_File</span></span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host "【WinMerge】比較先（右側）: $PATH_R"</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;"># ■ 確認メッセージ表示</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host " "</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host "$W_MSG_2"</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host " "</span></div><div><span style="color: #808080; font-size: xx-small;">pause</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;"># ■ 出力先パス設定</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;"># ## $OUTPUT_Path = [Environment]::GetFolderPath("Desktop")</span></div><div><span style="color: #808080; font-size: xx-small;"># ## $OUTPUT_Path = (Get-Location).Path</span></div><div><strong><span style="color: #808080; font-size: xx-small;">$OUTPUT_Path = $PSScriptRoot</span></strong></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">$msgbox.popup("$P_MSG_3")</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host "**************************************"</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host "【WinMerge】フォルダ名&nbsp; : $OUTPUT_Path"</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;"># ■ HTMLパス取得（生成）</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><strong><span style="color: #808080; font-size: xx-small;">$HTML_File = <span style="color: #0000ff;">"$OUTPUT_Path\Diff_HTML_$DayTime.html"</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">Get-ChildItem | Select-Object Name, Length | ConvertTo-Html &gt; <span style="color: #0000ff;">$HTML_File</span></span></strong></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host "【WinMerge】ＨＴＭＬ名&nbsp; : $HTML_File"</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;"># ■ WinMerge 比較実行</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><strong><span style="color: #808080; font-size: xx-small;"><span style="color: #ff0000;">&amp;</span> <span style="color: #0000ff;">$winMerge</span> /r /noninteractive /or <span style="color: #0000ff;">"$HTML_File" "$PATH_L" "$PATH_R"</span></span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;"># ■ WinMerge比較結果を保存する</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">#【EXCELファイル名の設定】</span></div><div><strong><span style="color: #808080; font-size: xx-small;">$EXCEL_File = <span style="color: #0000ff;">"$OUTPUT_Path\Diff_Excel_$DayTime.xlsx"</span></span></strong></div><div><span style="color: #808080; font-size: xx-small;">Write-Host "【WinMerge】エクセル名&nbsp; : $EXCEL_File"</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host "**************************************"</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host " "</span></div><div><span style="color: #808080; font-size: xx-small;">pause</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">#【EXCEL オブジェクト生成】</span></div><div><strong><span style="color: #808080; font-size: xx-small;">$excel = New-Object -ComObject Excel.Application</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">$excel.Visible = <span style="color: #0000ff;">$false</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">$excel.DisplayAlerts = <span style="color: #0000ff;">$false</span></span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">#【EXCEL ファイル保存処理】</span></div><div><strong><span style="color: #808080; font-size: xx-small;">try {</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; $workbook = $excel.Workbooks.Open(<span style="color: #0000ff;">$HTML_File</span>)</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; $fileFormat = <span style="color: #0000ff;">51</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; $workbook.SaveAs(<span style="color: #0000ff;">$EXCEL_File,$fileFormat</span>)</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; Write-Host " "</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; Write-Host "【*** Excel保存完了 ***】 $EXCEL_File" -ForegroundColor Green</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; Write-Host " "</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">}</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">catch {</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; Write-Host " "</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; Write-Error "【*** EXCEL ERROR ***】 : $_"</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; Write-Host " "</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">}</span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;"># ■ オブジェクト解放処理</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #0000ff;"><strong><span style="font-size: xx-small;">finally {</span></strong></span></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; #-----------------------------</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; #【EXCEL オブジェクト解放】</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; if ($workbook) {&nbsp;</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; <span style="color: #0000ff;">$workbook.Close($false)</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; }</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; <span style="color: #0000ff;">$excel.Quit()</span></span></strong></div><div><span style="color: #0000ff;"><strong><span style="font-size: xx-small;">&nbsp; [System.Runtime.Interopservices.Marshal]::ReleaseComObject($excel) | Out-Null</span></strong></span></div><div><span style="color: #0000ff;"><strong><span style="font-size: xx-small;">&nbsp; Remove-Variable excel</span></strong></span></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp;</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; #-----------------------------</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; #【fileDialog オブジェクト解放】</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; <span style="color: #0000ff;">$fileDialog.Dispose()</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp;</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; #-----------------------------</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; #【msgbox オブジェクト解放】</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; <span style="color: #0000ff;">$msgbox = $null</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; if ($null -ne $msgbox) {</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; [System.Runtime.InteropServices.Marshal]::ReleaseComObject($msgbox) | Out-Null</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; #-----------------------------</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; #【ガベージコレクション強制】</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; <span style="color: #0000ff;">[System.GC]::Collect()</span></span></strong></div><div><span style="color: #0000ff;"><strong><span style="font-size: xx-small;">&nbsp; &nbsp; [System.GC]::WaitForPendingFinalizers()</span></strong></span></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; }</span></strong></div><div><span style="color: #0000ff;"><strong><span style="font-size: xx-small;">}</span></strong></span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;"># ■ 処理終了メッセージ表示</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host " "</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host "$W_MSG_0"</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host "$W_MSG_3"</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host "$W_MSG_0"</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host " "</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">Start-Sleep 2</span></div>]]>
    </description>
    <category>PowerShell</category>
    <link>http://archives.blog-mmo.com/powershell/%E3%80%90powershell%E3%80%91%E9%96%A2%E6%95%B0%E3%82%AA%E3%83%96%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88</link>
    <pubDate>Sat, 09 May 2026 04:55:42 GMT</pubDate>
    <guid isPermaLink="false">archives.blog-mmo.com://entry/187</guid>
  </item>
    <item>
    <title>【awk】列の合計</title>
    <description>
    <![CDATA[<div><strong><span style="font-size: xx-small; color: #808080;">#*****************************</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">#【ls 結果サイズを合計する】</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">#*****************************</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">ls -l | <span style="color: #0000ff;">awk '{sum += <span style="color: #ff0000;">$5</span>} <span style="color: #ff0000;">END {print sum}</span>'</span></span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">&nbsp;</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">#*****************************</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">#【画面表示＆ファイルに保存】</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">#*****************************</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">ls -l | <span style="color: #0000ff;">awk '{sum += <span style="color: #ff0000;">$5</span>} <span style="color: #ff0000;">END {print sum}</span>' | tee result.txt</span></span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">&nbsp;</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">#*****************************</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">#【MB単位＆小数点以下2桁】</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">#*****************************</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">ls -l | <span style="color: #0000ff;">awk '{sum += <span style="color: #ff0000;">$5</span>} <span style="color: #ff0000;">END {printf "<span style="color: #0000ff;">%.2f MB\n</span>", sum<span style="color: #0000ff;">/1024/1024</span>}</span>'</span></span></strong></div>]]>
    </description>
    <category>Linux コマンド</category>
    <link>http://archives.blog-mmo.com/linux%20%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89/%E3%80%90awk%E3%80%91%E5%88%97%E3%81%AE%E5%90%88%E8%A8%88</link>
    <pubDate>Wed, 06 May 2026 06:23:14 GMT</pubDate>
    <guid isPermaLink="false">archives.blog-mmo.com://entry/188</guid>
  </item>
    <item>
    <title>【PowerShell】WinMarge</title>
    <description>
    <![CDATA[<div><strong><span style="font-size: xx-small; color: #808080;">■■■■■■■■■■■■■■■</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">■『WinMerge_Excel.bat』で以下を保存する</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">■■■■■■■■■■■■■■■</span></strong></div><div><span style="font-size: xx-small; color: #808080;">@echo off</span></div><div><span style="font-size: xx-small; color: #808080;">REM **************************</span></div><div><span style="font-size: xx-small; color: #808080;">REM # conhost切替</span></div><div><span style="font-size: xx-small; color: #808080;">REM **************************</span></div><div><span style="font-size: xx-small; color: #0000ff;">if not "%1"=="am_admin" (</span></div><div><span style="font-size: xx-small; color: #0000ff;">&nbsp; &nbsp; start conhost "%~f0" am_admin &amp; exit /b</span></div><div><span style="font-size: xx-small; color: #0000ff;">)</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">REM **************************</span></div><div><span style="font-size: xx-small; color: #808080;">REM # 画面サイズ設定</span></div><div><span style="font-size: xx-small; color: #808080;">REM # カラー設定</span></div><div><span style="font-size: xx-small; color: #808080;">REM # 文字コード設定</span></div><div><span style="font-size: xx-small; color: #808080;">REM **************************</span></div><div><span style="font-size: xx-small; color: #808080;">mode con: cols=120 lines=16</span></div><div><span style="font-size: xx-small; color: #808080;">color 0a</span></div><div><span style="font-size: xx-small; color: #808080;">chcp 932</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">timeout 1</span></div><div><span style="font-size: xx-small; color: #808080;">echo "====== START ======"</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">REM **************************</span></div><div><span style="font-size: xx-small; color: #808080;">REM # PowerShell実行</span></div><div><span style="font-size: xx-small; color: #808080;">REM **************************</span></div><div><strong><span style="font-size: xx-small; color: #ff0000;">powershell -ExecutionPolicy RemoteSigned -File "<span style="color: #0000ff;">%USERPROFILE%\Desktop\</span>PowerShell_WinMerge\WinMerge_Excel.ps1"</span></strong></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">color 17</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">echo "====== E N D ======"</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">timeout 5</span></div><div></div><div><strong><span style="font-size: xx-small; color: #808080;">■■■■■■■■■■■■■■■</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">■『WinMerge_Excel.ps1』で以下を保存する</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">■■■■■■■■■■■■■■■</span></strong></div><div><span style="font-size: xx-small; color: #808080;">Write-Host " "</span></div><div><span style="font-size: xx-small; color: #808080;">Write-Host " ※※※ 【 PowerShellで、WinMergeの比較を実行 】 ※※※ "</span></div><div><span style="font-size: xx-small; color: #808080;">Write-Host " ※※※ 【 比較結果をExcelファイルに保存する&nbsp; 】 ※※※ "</span></div><div><span style="font-size: xx-small; color: #808080;">Write-Host " "</span></div><div><span style="font-size: xx-small; color: #808080;">Start-Sleep 2</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#******************************</span></div><div><span style="font-size: xx-small; color: #808080;"># ■ .NET クラス読込</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #0000ff;">Add-Type -AssemblyName System.Windows.Forms</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#******************************</span></div><div><span style="font-size: xx-small; color: #808080;"># ■ 定数設定</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">#【ダイアログ】</span></div><div><span style="font-size: xx-small; color: #0000ff;">$fileDialog = New-Object System.Windows.Forms.OpenFileDialog</span></div><div><span style="font-size: xx-small; color: #0000ff;">$fileDialog.Title = "<span style="color: #808080;">【★★★★★ 対象ファイルを選択してください ★★★★★】</span>"</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">#【メッセージボックス】</span></div><div><span style="font-size: xx-small; color: #0000ff;">$msgbox = new-object -comobject wscript.shell</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">#【年月日-時分秒】</span></div><div><strong><span style="font-size: xx-small; color: #0000ff;">$DayTime = Get-Date -Format "<span style="color: #ff0000;">yyyyMMdd-HHmmss</span>"</span></strong></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">#【WinMerge格納パス】</span></div><div><strong><span style="font-size: xx-small; color: #0000ff;">$winMerge = "<span style="color: #ff0000;">C:\Program Files\WinMerge\WinMergeU.exe</span>"</span></strong></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#******************************</span></div><div><span style="font-size: xx-small; color: #808080;"># ■ 比較元（左側）を選択</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">$msgbox.popup("★★★★★ 【WinMerge】比較元（左側）ファイルを選択 ★★★★★")</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">#【左側（比較元）パス取得】</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #0000ff;">if ($fileDialog.ShowDialog() -eq [System.Windows.Forms.DialogResult]::OK) {</span></div><div><span style="font-size: xx-small; color: #0000ff;">&nbsp; $selectedFile = $fileDialog.FileName</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp; Write-Host "【WinMerge】比較元（左側）: $selectedFile"</span></div><div><span style="font-size: xx-small; color: #808080;">} else {</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp; Write-Host "選択無し（キャンセル）"</span></div><div><span style="font-size: xx-small; color: #808080;">}</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">#【左側（比較元）を変数に格納】</span></div><div><span style="font-size: xx-small; color: #808080;">$PATH_L = "$selectedFile"</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#******************************</span></div><div><span style="font-size: xx-small; color: #808080;"># ■ 比較先（右側）を選択</span></div><div><span style="font-size: xx-small; color: #808080;">#******************************</span></div><div><span style="font-size: xx-small; color: #808080;">$msgbox.popup("★★★★★ 【WinMerge】比較先（右側）ファイルを選択 ★★★★★")</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">#【右側（比較先）パス取得】</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #0000ff;">if ($fileDialog.ShowDialog() -eq [System.Windows.Forms.DialogResult]::OK) {</span></div><div><span style="font-size: xx-small; color: #0000ff;">&nbsp; $selectedFile = $fileDialog.FileName</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp; Write-Host "【WinMerge】比較先（右側）: $selectedFile"</span></div><div><span style="font-size: xx-small; color: #808080;">} else {</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp; Write-Host "選択無し（キャンセル）"</span></div><div><span style="font-size: xx-small; color: #808080;">}</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">#【右側（比較先）を変数に格納】</span></div><div><span style="font-size: xx-small; color: #808080;">$PATH_R = "$selectedFile"</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#******************************</span></div><div><span style="font-size: xx-small; color: #808080;"># ■ 確認メッセージ表示</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">Write-Host " "</span></div><div><span style="font-size: xx-small; color: #808080;">Write-Host " ※※※ 比較元と比較先のファイルを確認ください ※※※ "</span></div><div><span style="font-size: xx-small; color: #808080;">Write-Host " "</span></div><div><span style="font-size: xx-small; color: #808080;">pause</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#******************************</span></div><div><span style="font-size: xx-small; color: #808080;"># ■ 出力先パス設定</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;"># ## $OUTPUT_Path = [Environment]::GetFolderPath("Desktop")</span></div><div><span style="font-size: xx-small; color: #808080;"># ## $OUTPUT_Path = (Get-Location).Path</span></div><div><span style="font-size: xx-small; color: #0000ff;">$OUTPUT_Path = <span style="color: #ff0000;">$PSScriptRoot</span></span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">$msgbox.popup("★★★★★ 【WinMerge】出力先を確認ください ★★★★★")</span></div><div><span style="font-size: xx-small; color: #808080;">Write-Host "**************************************"</span></div><div><span style="font-size: xx-small; color: #808080;">Write-Host "【WinMerge】出力先パス&nbsp; : $OUTPUT_Path"</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#******************************</span></div><div><span style="font-size: xx-small; color: #808080;"># ■ HTMLパス取得（生成）</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><strong><span style="font-size: xx-small; color: #0000ff;">$HTML_File = "<span style="color: #ff0000;">$OUTPUT_Path\File_HTML_<span style="color: #0000ff;">$DayTime</span>.html</span>"</span></strong></div><div><span style="font-size: xx-small; color: #0000ff;">Get-ChildItem | Select-Object Name, Length | ConvertTo-Html &gt; $HTML_File</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">Write-Host "【WinMerge】出力HTML名&nbsp; : $HTML_File"</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#******************************</span></div><div><span style="font-size: xx-small; color: #808080;"># ■ WinMerge 比較実行</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><strong><span style="font-size: xx-small; color: #ff0000;">&amp; <span style="color: #0000ff;">$winMerge</span> /r /noninteractive /or <span style="color: #0000ff;">$HTML_File $PATH_L $PATH_R</span></span></strong></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #999999;">&nbsp; #******************************</span></div><div><span style="font-size: xx-small; color: #999999;">&nbsp; # ■ エクセル表示</span></div><div><span style="font-size: xx-small; color: #999999;">&nbsp; #-----------------------------</span></div><div><span style="font-size: xx-small; color: #999999;">&nbsp; # ## Start-Process "excel.exe" $HTML_File</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#******************************</span></div><div><span style="font-size: xx-small; color: #808080;"># ■ WinMerge比較結果を保存する</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">#【EXCELファイル名の設定】</span></div><div><strong><span style="font-size: xx-small; color: #0000ff;">$EXCEL_File = "<span style="color: #ff0000;">$OUTPUT_Path\File_Excel_<span style="color: #0000ff;">$DayTime</span>.xlsx</span>"</span></strong></div><div><span style="font-size: xx-small; color: #808080;">Write-Host "【WinMerge】出力EXCEL名 : $EXCEL_File"</span></div><div><span style="font-size: xx-small; color: #808080;">Write-Host "**************************************"</span></div><div><span style="font-size: xx-small; color: #808080;">Write-Host " "</span></div><div><span style="font-size: xx-small; color: #808080;">pause</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">#【EXCEL オブジェクト生成】</span></div><div><strong><span style="font-size: xx-small; color: #0000ff;">$excel = New-Object -ComObject Excel.Application</span></strong></div><div><strong><span style="font-size: xx-small; color: #0000ff;">$excel.Visible = $false</span></strong></div><div><strong><span style="font-size: xx-small; color: #0000ff;">$excel.DisplayAlerts = $false</span></strong></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">#【EXCEL ファイル保存処理】</span></div><div><strong><span style="font-size: xx-small; color: #0000ff;">try {</span></strong></div><div><strong><span style="font-size: xx-small; color: #0000ff;">&nbsp; $workbook = $excel.Workbooks.Open($HTML_File)</span></strong></div><div><strong><span style="font-size: xx-small; color: #0000ff;">&nbsp; $fileFormat = <span style="color: #ff0000;">51</span></span></strong></div><div><strong><span style="font-size: xx-small; color: #0000ff;">&nbsp; $workbook.SaveAs($EXCEL_File,$fileFormat)</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">&nbsp; Write-Host " "</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">&nbsp; Write-Host "【*** Excelファイル保存完了 ***】 $EXCEL_File" -ForegroundColor Green</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">&nbsp; Write-Host " "</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">}</span></strong></div><div><strong><span style="font-size: xx-small; color: #0000ff;">catch {</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">&nbsp; Write-Host " "</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">&nbsp; <span style="color: #0000ff;">Write-Error "<span style="color: #808080;">【*** ERROR ***】 :</span> $_" -ForegroundColor Red</span></span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">&nbsp; Write-Host " "</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">}</span></strong></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">#【EXCEL オブジェクト解放】</span></div><div><strong><span style="font-size: xx-small; color: #0000ff;">finally {</span></strong></div><div><strong><span style="font-size: xx-small; color: #0000ff;">&nbsp; if ($workbook) { $workbook.Close($false) }</span></strong></div><div><strong><span style="font-size: xx-small; color: #0000ff;">&nbsp; $excel.Quit()</span></strong></div><div><strong><span style="font-size: xx-small; color: #0000ff;">&nbsp; [System.Runtime.Interopservices.Marshal]::ReleaseComObject($excel) | Out-Null</span></strong></div><div><strong><span style="font-size: xx-small; color: #0000ff;">&nbsp; Remove-Variable excel</span></strong></div><div><strong><span style="font-size: xx-small; color: #0000ff;">}</span></strong></div>]]>
    </description>
    <category>PowerShell</category>
    <link>http://archives.blog-mmo.com/powershell/%E3%80%90powershell%E3%80%91winmarge</link>
    <pubDate>Wed, 29 Apr 2026 13:20:45 GMT</pubDate>
    <guid isPermaLink="false">archives.blog-mmo.com://entry/186</guid>
  </item>
    <item>
    <title>【LinuC-3 304試験 バージョン2.0 合格】</title>
    <description>
    <![CDATA[<div><span style="font-size: small; color: #999999;"><strong>【報告】</strong></span></div><div><span style="font-size: small; color: #999999;"><strong>　・2026/03/14（土）</strong></span></div><div><span style="font-size: small; color: #999999;"><strong>　　<span style="color: #0000ff;">LinuCレベル3 304 Virtualization &amp; High Availability</span> <span style="color: #ff0000;">合格</span></strong></span></div><div><span style="font-size: small; color: #999999;"><strong>　　　<a target="_blank" href="//archives.blog-mmo.com/File/67666bf4.png" title=""><span style="color: #999999;"><img src="//archives.blog-mmo.com/Img/1773551381/" alt="" /></span></a> </strong></span></div><div><span style="font-size: small; color: #999999;"><strong>&nbsp;<br />
【得点】</strong></span></div><div><span style="font-size: small; color: #999999;"><strong>　・600点（合格ライン 520点）</strong></span></div><div><span style="font-size: small; color: #999999;"><strong>&nbsp;</strong></span></div><div><span style="font-size: small; color: #999999;"><strong>【感想】</strong></span></div><div><span style="font-size: small; color: #999999;"><strong>　・よく分からん内容を問われる試験問題だった</strong></span></div><div><span style="font-size: small; color: #999999;"><strong>　・以下だけは覚えておくと点数稼げるかも</strong></span></div><div><span style="font-size: small;"><strong>　　　<span style="font-size: xx-small; color: #0000ff;">稼働率（可用性）を求める以下の計算式</span></strong></span></div><div><span style="font-size: small;"><strong>　　　　　<span style="font-size: xx-small; color: #0000ff;">MTBF&divide;(MTBF+MTTR)</span></strong></span></div><div><span style="font-size: small; color: #999999;"><strong>　　　<span style="font-size: xx-small;">※仮想化技術とは直接関係ないけど重要な知識</span></strong></span></div><div><span style="font-size: small; color: #999999;"><strong>&nbsp;</strong></span></div><div><span style="font-size: small; color: #999999;"><strong>【その他】</strong></span></div><div><span style="font-size: small; color: #999999;"><strong>　・次は考え中・・・</strong></span></div><div><span style="font-size: small; color: #999999;"><strong>&nbsp;</strong></span></div><div><span style="font-size: small; color: #999999;"><strong>【試験に役立つアドバイス】<br />
　・参考書籍はLinuC用が見つからず、LPICで代用</strong></span></div><div><span style="font-size: small; color: #999999;"><strong>　・Ping-t サイトで演習しまくる</strong></span></div>]]>
    </description>
    <category>管理者メモ</category>
    <link>http://archives.blog-mmo.com/%E7%AE%A1%E7%90%86%E8%80%85%E3%83%A1%E3%83%A2/%E3%80%90linuc%E3%80%91linuc-3%20304%E8%A9%A6%E9%A8%93%20%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B32.0</link>
    <pubDate>Sun, 15 Mar 2026 04:52:28 GMT</pubDate>
    <guid isPermaLink="false">archives.blog-mmo.com://entry/185</guid>
  </item>
    <item>
    <title>【仮想】保存／復元コマンド</title>
    <description>
    <![CDATA[<div><span style="font-size: xx-small;">#*****************************</span></div><div><span style="font-size: xx-small;"># 仮想マシン 保存＆復元</span></div><div><span style="font-size: xx-small;">#*****************************</span></div><div><span style="font-size: xx-small;">xl save&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; （停止して保存）</span></div><div><span style="font-size: xx-small;">xl restore&nbsp; &nbsp; &nbsp; （復元して起動）</span></div><div><span style="font-size: xx-small;">#-----------------------------</span></div><div><span style="font-size: xx-small;">virsh save&nbsp; &nbsp; &nbsp;（停止して保存）</span></div><div><span style="font-size: xx-small;">virsh restore （復元して起動）</span></div><div><span style="font-size: xx-small;">&nbsp;</span></div><div><span style="font-size: xx-small;">#*****************************</span></div><div><span style="font-size: xx-small;"># 仮想マシン スナップショット</span></div><div><span style="font-size: xx-small;">#*****************************</span></div><div><span style="font-size: xx-small;">virsh <span style="color: #0000ff;"><span style="color: #ff0000;"><strong>snapshot-create-as</strong></span>（作成）</span></span></div><div><span style="font-size: xx-small;">virsh <span style="color: #0000ff;"><strong><span style="color: #ff0000;">snapshot-revert&nbsp;</span></strong> &nbsp; &nbsp; （復元</span>）</span></div><div><span style="font-size: xx-small;">virsh <span style="color: #0000ff;"><span style="color: #ff0000;"><strong>snapshot-delete</strong></span>&nbsp; &nbsp; &nbsp;（削除）</span></span></div><div><span style="font-size: xx-small;">virsh <span style="color: #0000ff;"><strong><span style="color: #ff0000;">snapshot-list</span></strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;（一覧）</span></span></div><div><span style="font-size: xx-small;">#-----------------------------</span></div><div><span style="font-size: xx-small;"><span style="color: #808080;">QEMUﾓﾆﾀｺﾏﾝﾄﾞ</span> <span style="color: #0000ff;"><strong><span style="color: #ff0000;">savevm</span></strong> （作成）</span></span></div><div><span style="font-size: xx-small;"><span style="color: #808080;">QEMUﾓﾆﾀｺﾏﾝﾄﾞ</span> <span style="color: #0000ff;"><span style="color: #ff0000;"><strong>loadvm</strong></span>&nbsp; （適用）</span></span></div>]]>
    </description>
    <category>仮想化メモ</category>
    <link>http://archives.blog-mmo.com/%E4%BB%AE%E6%83%B3%E5%8C%96%E3%83%A1%E3%83%A2/%E3%80%90%E4%BB%AE%E6%83%B3%E3%80%91%E4%BF%9D%E5%AD%98%EF%BC%8F%E5%BE%A9%E5%85%83%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89</link>
    <pubDate>Mon, 02 Mar 2026 09:08:34 GMT</pubDate>
    <guid isPermaLink="false">archives.blog-mmo.com://entry/184</guid>
  </item>
    <item>
    <title>【仮想】接続／実行コマンド</title>
    <description>
    <![CDATA[<div><span style="font-size: xx-small;">#*****************************</span></div><div><span style="font-size: xx-small;"># 仮想マシン 接続</span></div><div><span style="font-size: xx-small;">#*****************************</span></div><div><span style="font-size: xx-small;">xl console&nbsp; &nbsp; &nbsp; &nbsp;（ｺﾝｿｰﾙ接続）</span></div><div><span style="font-size: xx-small;">#-----------------------------</span></div><div><span style="font-size: xx-small;">virsh console&nbsp; （ｺﾝｿｰﾙ接続）</span></div><div><span style="font-size: xx-small;">#-----------------------------</span></div><div><span style="font-size: xx-small;">vagrant <span style="color: #0000ff;"><strong>ssh</strong></span>&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">（SSH接続）</span></span></div><div><span style="font-size: xx-small;">&nbsp;</span></div><div><span style="font-size: xx-small;">#*****************************</span></div><div><span style="font-size: xx-small;"># コンテナ 接続</span></div><div><span style="font-size: xx-small;">#*****************************</span></div><div><span style="font-size: xx-small;">lxc-console&nbsp; &nbsp; （ｺﾝｿｰﾙ接続）</span></div><div><span style="font-size: xx-small;">#-----------------------------</span></div><div><span style="font-size: xx-small;">vzctl console&nbsp; （ｺﾝｿｰﾙ接続）</span></div><div><span style="font-size: xx-small;">vzctl <span style="color: #ff0000;"><strong>enter</strong></span>&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">（ｺﾝﾃﾅ接続）</span></span></div><div><span style="font-size: xx-small;">vzctl <strong><span style="color: #0000ff;">exec&nbsp;</span></strong> &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">（実行）</span></span></div><div><span style="font-size: xx-small;">vzctl <strong><span style="color: #0000ff;">exec2&nbsp;</span></strong> &nbsp; &nbsp;<span style="color: #0000ff;">（実行[戻り値]）</span></span></div><div><span style="font-size: xx-small;">#-----------------------------</span></div><div><span style="font-size: xx-small;">docker <strong><span style="color: #ff0000;">attach</span></strong> （ｺﾝｿｰﾙ接続）</span></div>]]>
    </description>
    <category>仮想化メモ</category>
    <link>http://archives.blog-mmo.com/%E4%BB%AE%E6%83%B3%E5%8C%96%E3%83%A1%E3%83%A2/%E3%80%90%E4%BB%AE%E6%83%B3%E3%80%91%E6%8E%A5%E7%B6%9A%EF%BC%8F%E5%AE%9F%E8%A1%8C%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89</link>
    <pubDate>Mon, 02 Mar 2026 09:07:03 GMT</pubDate>
    <guid isPermaLink="false">archives.blog-mmo.com://entry/183</guid>
  </item>
    <item>
    <title>【仮想】表示コマンド</title>
    <description>
    <![CDATA[<div><span style="font-size: xx-small;">#*****************************</span></div><div><span style="font-size: xx-small;"># 仮想マシン 一覧表示（情報）</span></div><div><span style="font-size: xx-small;">#*****************************</span></div><div><strong><span style="font-size: xx-small;">xl <span style="color: #ff0000;">list</span></span></strong></div><div><strong><span style="font-size: xx-small;">xl info</span></strong></div><div><span style="font-size: xx-small;"><strong>xl top&nbsp;</strong> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">（xentopと同じ）</span></span></div><div><span style="font-size: xx-small;">xl vcpu-list&nbsp; &nbsp;（仮想CPU情報）</span></div><div><span style="font-size: xx-small;">xl block-list&nbsp; （ﾌﾞﾛｯｸﾃﾞﾊﾞｲｽ情報）</span></div><div><span style="font-size: xx-small;">#-----------------------------</span></div><div><strong><span style="font-size: xx-small;">virsh <span style="color: #ff0000;">list</span></span></strong></div><div><span style="font-size: xx-small;"><strong>virsh dominfo</strong>&nbsp; &nbsp;（ドメイン情報）</span></div><div><span style="font-size: xx-small;"><strong>virsh vcpuinfo</strong>&nbsp; （仮想CPU情報）</span></div><div><span style="font-size: xx-small;">virsh net-list&nbsp; （ﾈｯﾄﾜｰｸ情報）</span></div><div><span style="font-size: xx-small;">virsh vol-list&nbsp; （ﾎﾞﾘｭｰﾑ情報）</span></div><div><span style="font-size: xx-small;">virsh pool-list （ﾌﾟｰﾙ情報）</span></div><div><span style="font-size: xx-small;">#-----------------------------</span></div><div><span style="font-size: xx-small;"><strong>vagrant status</strong>&nbsp; （状態表示）</span></div><div><span style="font-size: xx-small;">&nbsp;</span></div><div><span style="font-size: xx-small;">#*****************************</span></div><div><span style="font-size: xx-small;"># コンテナ 一覧表示（情報）</span></div><div><span style="font-size: xx-small;">#*****************************</span></div><div><strong><span style="font-size: xx-small;">lxc<span style="color: #ff0000;">-ls</span></span></strong></div><div><strong><span style="font-size: xx-small;">lxc-info</span></strong></div><div><span style="font-size: xx-small;">#-----------------------------</span></div><div><strong><span style="font-size: xx-small;">vzctl status</span></strong></div><div><span style="font-size: xx-small;">#-----------------------------</span></div><div><strong><span style="font-size: xx-small;">docker <span style="color: #ff0000;">ps</span></span></strong></div><div><strong><span style="font-size: xx-small;">docker info</span></strong></div>]]>
    </description>
    <category>仮想化メモ</category>
    <link>http://archives.blog-mmo.com/%E4%BB%AE%E6%83%B3%E5%8C%96%E3%83%A1%E3%83%A2/%E3%80%90%E4%BB%AE%E6%83%B3%E3%80%91%E8%A1%A8%E7%A4%BA%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89</link>
    <pubDate>Mon, 02 Mar 2026 09:05:59 GMT</pubDate>
    <guid isPermaLink="false">archives.blog-mmo.com://entry/182</guid>
  </item>
    <item>
    <title>【仮想】一時停止コマンド</title>
    <description>
    <![CDATA[<div><span style="font-size: xx-small;">#*****************************</span></div><div><span style="font-size: xx-small;"># 仮想マシン一時停止（再開）</span></div><div><span style="font-size: xx-small;">#*****************************</span></div><div><span style="font-size: xx-small;">xl <span style="font-size: xx-small; color: #ff0000;">pause</span></span><span style="font-size: xx-small;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="font-size: xx-small; color: #0000ff;">（一時停止）</span></div><div><span style="font-size: xx-small;">xl <span style="color: #ff0000;">unpause</span></span><span style="font-size: xx-small;">&nbsp; &nbsp; &nbsp; &nbsp;</span><span style="font-size: xx-small; color: #0000ff;">（再開）</span></div><div><span style="font-size: xx-small;">#-----------------------------</span></div><div><span style="font-size: xx-small;">virsh suspend</span><span style="font-size: xx-small;">&nbsp; </span><span style="font-size: xx-small; color: #0000ff;">（一時停止）</span></div><div><span style="font-size: xx-small;">virsh resume&nbsp; &nbsp; <span style="color: #0000ff;">（再開）</span></span></div><div><span style="font-size: xx-small;">#-----------------------------</span></div><div><span style="font-size: xx-small;">vagrant suspend</span><span style="font-size: xx-small;">&nbsp; </span><span style="font-size: xx-small; color: #0000ff;">（一時停止）</span></div><div><span style="font-size: xx-small;">vagrant resume</span><span style="font-size: xx-small;">&nbsp; &nbsp;&nbsp;</span><span style="font-size: xx-small; color: #0000ff;">（再開）</span></div><div><span style="font-size: xx-small;">&nbsp;</span></div><div><span style="font-size: xx-small;">#*****************************</span></div><div><span style="font-size: xx-small;"># コンテナ一時停止（再開）</span></div><div><span style="font-size: xx-small;">#*****************************</span></div><div><span style="font-size: xx-small;">lxc<span style="color: #ff0000;">-freeze</span></span><span style="font-size: xx-small;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span><span style="font-size: xx-small; color: #0000ff;">（一時停止）</span></div><div><span style="font-size: xx-small;">lxc<span style="color: #ff0000;">-unfreeze</span></span><span style="font-size: xx-small;">&nbsp; &nbsp;&nbsp;</span><span style="font-size: xx-small; color: #0000ff;">（再開）</span></div><div><span style="font-size: xx-small;">#-----------------------------</span></div><div><span style="font-size: xx-small;">vzctl suspend</span><span style="font-size: xx-small;">&nbsp;&nbsp;</span><span style="font-size: xx-small; color: #0000ff;">（一時停止）</span></div><div><span style="font-size: xx-small;">vzctl start</span><span style="font-size: xx-small;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="font-size: xx-small; color: #0000ff;">（再開）</span></div><div><span style="font-size: xx-small;">#-----------------------------</span></div><div><span style="font-size: xx-small;">docker <span style="font-size: xx-small; color: #ff0000;">pause</span></span><span style="font-size: xx-small;">&nbsp; &nbsp; &nbsp;&nbsp;</span><span style="font-size: xx-small; color: #0000ff;">（一時停止）</span></div><div><span style="font-size: xx-small;">docker <span style="font-size: xx-small; color: #ff0000;">unpause</span></span><span style="font-size: xx-small;">&nbsp; </span><span style="font-size: xx-small; color: #0000ff;">（再開）</span></div>]]>
    </description>
    <category>仮想化メモ</category>
    <link>http://archives.blog-mmo.com/%E4%BB%AE%E6%83%B3%E5%8C%96%E3%83%A1%E3%83%A2/%E3%80%90%E4%BB%AE%E6%83%B3%E3%80%91%E4%B8%80%E6%99%82%E5%81%9C%E6%AD%A2%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89</link>
    <pubDate>Mon, 02 Mar 2026 09:05:02 GMT</pubDate>
    <guid isPermaLink="false">archives.blog-mmo.com://entry/181</guid>
  </item>
    <item>
    <title>【仮想】停止コマンド</title>
    <description>
    <![CDATA[<div><span style="font-size: xx-small;">#*****************************</span></div><div><span style="font-size: xx-small;"># 仮想マシン停止（強制終了）</span></div><div><span style="font-size: xx-small;">#*****************************</span></div><div><span style="font-size: xx-small;">xl shutdown</span></div><div><span style="font-size: xx-small;">xl destroy&nbsp; &nbsp;&nbsp;</span><span style="font-size: xx-small; color: #0000ff;">（強制終了）</span></div><div><span style="font-size: xx-small;">#-----------------------------</span></div><div><span style="font-size: xx-small;">virsh shutdown</span></div><div><span style="font-size: xx-small;">virsh destroy</span><span style="font-size: xx-small;">&nbsp; &nbsp;&nbsp;</span><span style="font-size: xx-small; color: #0000ff;">（強制終了）</span></div><div><span style="font-size: xx-small;">#-----------------------------</span></div><div><span style="font-size: xx-small;">vagrant <strong><span style="color: #ff0000;">halt</span></strong></span></div><div><span style="font-size: xx-small;">vagrant destroy</span><span style="font-size: xx-small;">&nbsp; &nbsp;&nbsp;</span><span style="font-size: xx-small; color: #0000ff;">（強制終了）</span></div><div><span style="font-size: xx-small;">&nbsp;</span></div><div><span style="font-size: xx-small;">#*****************************</span></div><div><span style="font-size: xx-small;"># コンテナ停止（破棄）</span></div><div><span style="font-size: xx-small;">#*****************************</span></div><div><span style="font-size: xx-small;">lxc-stop</span></div><div><span style="font-size: xx-small;">lxc-destroy</span><span style="font-size: xx-small;">&nbsp; &nbsp;&nbsp;</span><span style="font-size: xx-small; color: #0000ff;">（強制終了）</span></div><div><span style="font-size: xx-small;">#-----------------------------</span></div><div><span style="font-size: xx-small;">vzctl stop</span></div><div><span style="font-size: xx-small;">vzctl <span style="color: #0000ff;"><strong>destroy</strong></span> (vzctl <span style="color: #0000ff;"><strong>delete</strong></span>)</span><span style="font-size: xx-small;">&nbsp; &nbsp;&nbsp;</span><span style="font-size: xx-small; color: #0000ff;">（強制終了）</span></div><div><span style="font-size: xx-small;">#-----------------------------</span></div><div><span style="font-size: xx-small;">docker stop</span></div><div><span style="font-size: xx-small;">docker <strong><span style="color: #ff0000;">kill</span></strong></span><span style="font-size: xx-small;">&nbsp; &nbsp;&nbsp;</span><span style="font-size: xx-small; color: #0000ff;">（強制終了）</span></div>]]>
    </description>
    <category>仮想化メモ</category>
    <link>http://archives.blog-mmo.com/%E4%BB%AE%E6%83%B3%E5%8C%96%E3%83%A1%E3%83%A2/%E3%80%90%E4%BB%AE%E6%83%B3%E3%80%91%E5%81%9C%E6%AD%A2%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89</link>
    <pubDate>Mon, 02 Mar 2026 09:04:03 GMT</pubDate>
    <guid isPermaLink="false">archives.blog-mmo.com://entry/180</guid>
  </item>
    <item>
    <title>【仮想】起動コマンド</title>
    <description>
    <![CDATA[<div><span style="font-size: xx-small;">#*****************************</span></div><div><span style="font-size: xx-small;"># 仮想マシン起動（再起動）</span></div><div><span style="font-size: xx-small;">#*****************************</span></div><div><span style="font-size: xx-small;">xl <strong><span style="color: #ff0000;">create</span></strong>&nbsp; &nbsp; <span style="color: #0000ff;">（作成し起動）</span></span></div><div><span style="font-size: xx-small;">xl reboot</span></div><div><span style="font-size: xx-small;">#-----------------------------</span></div><div><span style="font-size: xx-small;">virsh start</span></div><div><span style="font-size: xx-small;">virsh reboot</span></div><div><span style="font-size: xx-small;">virsh <span style="color: #ff0000;">autostart</span></span></div><div><span style="font-size: xx-small;">#-----------------------------</span></div><div><span style="font-size: xx-small;">vagrant <strong><span style="color: #ff0000;">up&nbsp; &nbsp;&nbsp;</span></strong></span><span style="color: #0000ff; font-size: xx-small;">（作成し起動）</span></div><div><span style="font-size: xx-small;">&nbsp;</span></div><div><span style="font-size: xx-small;">#*****************************</span></div><div><span style="font-size: xx-small;"># コンテナ起動（再起動）</span></div><div><span style="font-size: xx-small;">#*****************************</span></div><div><span style="font-size: xx-small;">lxc-start</span></div><div><span style="font-size: xx-small;">lxc-restart</span></div><div><span style="font-size: xx-small;">#-----------------------------</span></div><div><span style="font-size: xx-small;">vzctl start</span></div><div><span style="font-size: xx-small;">vzctl restart</span></div><div><span style="font-size: xx-small;">#-----------------------------</span></div><div><span style="font-size: xx-small;">docker start</span></div><div><span style="font-size: xx-small;">docker restart</span></div><div><span style="font-size: xx-small;">docker <strong><span style="color: #ff0000;">run</span></strong>&nbsp; &nbsp;<span style="color: #0000ff;">（作成し起動）</span></span></div>]]>
    </description>
    <category>仮想化メモ</category>
    <link>http://archives.blog-mmo.com/%E4%BB%AE%E6%83%B3%E5%8C%96%E3%83%A1%E3%83%A2/%E3%80%90%E4%BB%AE%E6%83%B3%E3%80%91%E8%B5%B7%E5%8B%95%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89</link>
    <pubDate>Mon, 02 Mar 2026 09:03:06 GMT</pubDate>
    <guid isPermaLink="false">archives.blog-mmo.com://entry/179</guid>
  </item>

    </channel>
</rss>