<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>FreeBSD あれこれ</title>
        <description>FreeBSD をはじめ OS・サーバ・アプリケーション等の紹介サイト。</description>
        <link>https://freebsd.sing.ne.jp/</link>
        <lastBuildDate>Tue, 30 Nov 2021 03:23:39 +0000</lastBuildDate>
        <generator>FeedCreator 1.8</generator>
        <item>
            <title>PHP - よく使う関数 - その他</title>
            <link>https://freebsd.sing.ne.jp/lang/php/03/12.html</link>
            <description>1.　get_browser ブラウザの機能を取得するmixed get_browser ([ string $user_agent [, bool $return_array = false ]] )　この関数はブラウザの機能を取得するのですが、取得先は「browscap.ini」というファイルになります。　「browscap.ini」を取得して、「php.ini」にそのファイルの取得先を記述するのですが。　その手順については「FreeBSD - メンテナンス・トラブルシュート - php」をご参照ください。　設定を行ったうえで&lt;?phpprint($_SERVER['HTTP_USER_AGENT'] . &quot;\n&quot;);$browser = get_browser(null, true);print_r($browser);　というソースを書いて実行すると下記の結果が得られます（オプションの browscap.ini を使用）。Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.108 Safari/537.36Array(    [browser_name_regex] =&gt; ~^mozilla/5\.0 \(.*windows nt 10\.0.*win64. x64.*\).*applewebkit.*\(.*khtml.*like.*gecko.*\).*chrome/.* safari/.*$~    [browser_name_pattern] =&gt; Mozilla/5.0 (*Windows NT 10.0*Win64? x64*)*applewebkit*(*khtml*like*gecko*)*Chrome/* Safari/*    [parent] =&gt; Chrome Generic    [browser_bits] =&gt; 64    [platform] =&gt; Win10    [platform_version] =&gt; 10.0    [platform_description] =&gt; Windows 10    [platform_bits] =&gt; 64    [platform_maker] =&gt; Microsoft Corporation    [win64] =&gt; 1    [comment] =&gt; Chrome Generic    [browser] =&gt; Chrome    [browser_type] =&gt; Browser    [browser_maker] =&gt; Google Inc    [frames] =&gt; 1    [iframes] =&gt; 1    [tables] =&gt; 1    [cookies] =&gt; 1    [javascript] =&gt; 1    [cssversion] =&gt; 3    [aolversion] =&gt; 0    [device_name] =&gt; Windows Desktop    [device_type] =&gt; Desktop    [device_pointing_method] =&gt; mouse    [device_code_name] =&gt; Windows Desktop    [renderingengine_name] =&gt; Blink    [renderingengine_description] =&gt; a WebKit Fork by Google    [renderingengine_maker] =&gt; Google Inc    [browser_modus] =&gt; unknown    [version] =&gt; 0.0    [majorver] =&gt; 0    [minorver] =&gt; 0    [alpha] =&gt;     [beta] =&gt;     [win16] =&gt;     [win32] =&gt;     [backgroundsounds] =&gt;     [vbscript] =&gt;     [javaapplets] =&gt;     [activexcontrols] =&gt;     [ismobiledevice] =&gt;     [istablet] =&gt;     [issyndicationreader] =&gt;     [crawler] =&gt;     [isfake] =&gt;     [isanonymized] =&gt;     [ismodified] =&gt;     [device_maker] =&gt; unknown    [device_brand_name] =&gt; unknown    [renderingengine_version] =&gt; unknown)　ちなみに、上記は、これを読んでいる、あなたの環境になります。2.　memory_get_usage PHP に割り当てられたメモリの量を調べる　「memory_get_usage」という関数で表題の内容が調べられるらしい。int memory_get_usage ([ bool $real_usage = FALSE ] )　引数に「true」を与えると、システムが割り当てた実際のメモリの大きさ (未使用のページも含むもの) を取得するそうな。　引数を省略したり「false」を与えると使用したモリのみを報告するそうな。&lt;?phpclass myClass{	private $work = NULL;	public function __construct()	{		global $work;		for ($i=0; $i&lt;10000; $i++)		{			$work .= ' ';		}	}}print(&quot;割り当てメモリ[&quot;.number_format(memory_get_usage(true)).&quot;] 使用メモリ[&quot;.number_format(memory_get_usage()).&quot;]\n&quot;);$myclass = new myClass();print(&quot;割り当てメモリ[&quot;.number_format(memory_get_usage(true)).&quot;] 使用メモリ[&quot;.number_format(memory_get_usage()).&quot;]\n&quot;);unset($myclass);print(&quot;割り当てメモリ[&quot;.number_format(memory_get_usage(true)).&quot;] 使用メモリ[&quot;.number_format(memory_get_usage()).&quot;]\n&quot;);　これを実行すると以下の結果が得られます（結果は、あくまでも一例です）。割り当てメモリ[2,097,152] 使用メモリ[345,624]割り当てメモリ[2,097,152] 使用メモリ[358,032]割り当てメモリ[2,097,152] 使用メモリ[357,976]3.　parse_url URL を解釈し、その構成要素を返す　マニュアルは、「PHP: parse_url - Manual」です。　「Laravel」で@inject('request', 'Illuminate\Http\Request')　を書いておいて$request-&gt;url();　と混ぜて使うと大変便利。　「Laravel」内で、このサイトで、ここに@php$purl = parse_url($request-&gt;url());print_r($purl);@endphp　と書けば、下記のように出力されます。Array(    [scheme] =&gt; https    [host] =&gt; freebsd.sing.ne.jp    [path] =&gt; /lang/php/03/12.html)mixed get_browser ([ string $user_agent [, bool $return_array = false ]] )&lt;?phpprint($_SERVER['HTTP_USER_AGENT'] . &quot;\n&quot;);$browser = get_browser(null, true);print_r($browser);Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.108 Safari/537.36Array(    [browser_name_regex] =&gt; ~^mozilla/5\.0 \(.*windows nt 10\.0.*win64. x64.*\).*applewebkit.*\(.*khtml.*like.*gecko.*\).*chrome/.* safari/.*$~    [browser_name_pattern] =&gt; Mozilla/5.0 (*Windows NT 10.0*Win64? x64*)*applewebkit*(*khtml*like*gecko*)*Chrome/* Safari/*    [parent] =&gt; Chrome Generic    [browser_bits] =&gt; 64    [platform] =&gt; Win10    [platform_version] =&gt; 10.0    [platform_description] =&gt; Windows 10    [platform_bits] =&gt; 64    [platform_maker] =&gt; Microsoft Corporation    [win64] =&gt; 1    [comment] =&gt; Chrome Generic    [browser] =&gt; Chrome    [browser_type] =&gt; Browser    [browser_maker] =&gt; Google Inc    [frames] =&gt; 1    [iframes] =&gt; 1    [tables] =&gt; 1    [cookies] =&gt; 1    [javascript] =&gt; 1    [cssversion] =&gt; 3    [aolversion] =&gt; 0    [device_name] =&gt; Windows Desktop    [device_type] =&gt; Desktop    [device_pointing_method] =&gt; mouse    [device_code_name] =&gt; Windows Desktop    [renderingengine_name] =&gt; Blink    [renderingengine_description] =&gt; a WebKit Fork by Google    [renderingengine_maker] =&gt; Google Inc    [browser_modus] =&gt; unknown    [version] =&gt; 0.0    [majorver] =&gt; 0    [minorver] =&gt; 0    [alpha] =&gt;     [beta] =&gt;     [win16] =&gt;     [win32] =&gt;     [backgroundsounds] =&gt;     [vbscript] =&gt;     [javaapplets] =&gt;     [activexcontrols] =&gt;     [ismobiledevice] =&gt;     [istablet] =&gt;     [issyndicationreader] =&gt;     [crawler] =&gt;     [isfake] =&gt;     [isanonymized] =&gt;     [ismodified] =&gt;     [device_maker] =&gt; unknown    [device_brand_name] =&gt; unknown    [renderingengine_version] =&gt; unknown)int memory_get_usage ([ bool $real_usage = FALSE ] )&lt;?phpclass myClass{	private $work = NULL;	public function __construct()	{		global $work;		for ($i=0; $i&lt;10000; $i++)		{			$work .= ' ';		}	}}print(&quot;割り当てメモリ[&quot;.number_format(memory_get_usage(true)).&quot;] 使用メモリ[&quot;.number_format(memory_get_usage()).&quot;]\n&quot;);$myclass = new myClass();print(&quot;割り当てメモリ[&quot;.number_format(memory_get_usage(true)).&quot;] 使用メモリ[&quot;.number_format(memory_get_usage()).&quot;]\n&quot;);unset($myclass);print(&quot;割り当てメモリ[&quot;.number_format(memory_get_usage(true)).&quot;] 使用メモリ[&quot;.number_format(memory_get_usage()).&quot;]\n&quot;);割り当てメモリ[2,097,152] 使用メモリ[345,624]割り当てメモリ[2,097,152] 使用メモリ[358,032]割り当てメモリ[2,097,152] 使用メモリ[357,976]@inject('request', 'Illuminate\Http\Request')$request-&gt;url();@php$purl = parse_url($request-&gt;url());print_r($purl);@endphpArray(    [scheme] =&gt; https    [host] =&gt; freebsd.sing.ne.jp    [path] =&gt; /lang/php/03/12.html)</description>
            <pubDate>Mon, 29 Nov 2021 07:19:37 +0000</pubDate>
        </item>
        <item>
            <title>deepin - 20.3 - タスクマネージャー Conky</title>
            <link>https://freebsd.sing.ne.jp/linux/19/06/14.html</link>
            <description>1.　概要　「Conky」は優れた、タスクマネージャーです。　「Conky」に関する説明は、「Conky - Wikipedia」をご参照ください。2.　インストール　「root」ユーザ権限で。apt install -y conky3.　設定　ログインユーザで、下記のコマンドで、設定ファイルを作成して、編集します。mkdir -pv ~/.config/conkyconky --print-config &gt; ~/.config/conky/conky.confvi ~/.config/conky/conky.confconky.config = {    alignment = 'top_left',    background = false,    border_width = 1,　左上表示を右上表示、バックグラウンドモード・ダブルバッファリングを有効にします。conky.config = {    alignment = 'top_right',    background = true,    double_buffer = true,    border_width = 1,font = 'DejaVu Sans Mono:size=12',    gap_x = 5,    gap_y = 60,　フォントを少し小さめにして、左端の間隔を少し開けます。font = 'DejaVu Sans Mono:size=10',	gap_x = 10,	gap_y = 60,own_window_class = 'Conky',    own_window_type = 'desktop',    stippled_borders = 0,　背景の上、他のウィンドウの下へ透過して表示。own_window_class = 'Conky',    own_window_type = 'dock',    own_window_argb_visual = true,    own_window_argb_value  = 100,    own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',    stippled_borders = 0,${scroll 16 $nodename - $sysname $kernel on $machine | }　スクロールして、システム情報を表示しているところを、スクロールせずに、「システム情報」「ディストリビューション名」「Conky バージョン」を複数行に分けて表示します。${color grey}System :$color $sysname $kernel $machine${color grey}Release:$color ${execi 999999 lsb_release -ds}${color grey}Conky  :$color $conky_version4.　自動起動　ログイン時に、自動起動するように設定します。shcat - &lt;&lt; 'EOF' &gt;&gt;  ~/.config/autostart/conky.desktop[Desktop Entry]Exec=/usr/bin/sh -c &quot;sleep 3 &amp;&amp; /usr/bin/conky&quot;Icon=application-x-shellscriptName=conkyType=ApplicationVersion=1.0EOFexit　「sleep 5」は、ログインして、「Conky」が起動するまでの時間を秒単位で指定します。　デスクトップの速度に合わせて調整します。　ログインし直します。5.　表示　再ログインすると、「Conky」の表示が現れます。　確か、前回のバージョンでは、透過できていたのに、今回のバージョンでは、透過できなくなりました。apt install -y conkymkdir -pv ~/.config/conkyconky --print-config &gt; ~/.config/conky/conky.confvi ~/.config/conky/conky.confconky.config = {    alignment = 'top_left',    background = false,    border_width = 1,conky.config = {    alignment = 'top_right',    background = true,    double_buffer = true,    border_width = 1,font = 'DejaVu Sans Mono:size=12',    gap_x = 5,    gap_y = 60,font = 'DejaVu Sans Mono:size=10',	gap_x = 10,	gap_y = 60,own_window_class = 'Conky',    own_window_type = 'desktop',    stippled_borders = 0,own_window_class = 'Conky',    own_window_type = 'dock',    own_window_argb_visual = true,    own_window_argb_value  = 100,    own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',    stippled_borders = 0,${scroll 16 $nodename - $sysname $kernel on $machine | }${color grey}System :$color $sysname $kernel $machine${color grey}Release:$color ${execi 999999 lsb_release -ds}${color grey}Conky  :$color $conky_versionshcat - &lt;&lt; 'EOF' &gt;&gt;  ~/.config/autostart/conky.desktop[Desktop Entry]Exec=/usr/bin/sh -c &quot;sleep 3 &amp;&amp; /usr/bin/conky&quot;Icon=application-x-shellscriptName=conkyType=ApplicationVersion=1.0EOFexit</description>
            <pubDate>Mon, 29 Nov 2021 04:41:27 +0000</pubDate>
        </item>
        <item>
            <title>deepin - 20.3 - 開発環境 Visual Studio Code</title>
            <link>https://freebsd.sing.ne.jp/linux/19/06/13.html</link>
            <description>1.　概要　開発環境として「Visual Studio Code」を使用します。2.　インストール　「deepin-app-store」で、「visual studio code」を検索して、インストールします。3.　起動　「スタート」→「全てのカテゴリ」→「開発」→「Visual Studio Code」　日本語化後に起動した、直後の状態です。　2021年11月29日の時点で、下記のバージョンでした。</description>
            <pubDate>Mon, 29 Nov 2021 04:30:25 +0000</pubDate>
        </item>
        <item>
            <title>Linux - deepin - 20.3</title>
            <link>https://freebsd.sing.ne.jp/linux/19/06/</link>
            <description>目　次</description>
            <pubDate>Mon, 29 Nov 2021 04:30:09 +0000</pubDate>
        </item>
        <item>
            <title>deepin - 20.3 - 光ディスクライティング Brasero</title>
            <link>https://freebsd.sing.ne.jp/linux/19/06/12.html</link>
            <description>1.　概要　光ディスクライティングソフトとして「Brasero」を使用します。2.　インストール　「Synaptic」で、「brasero」を検索して、インストールします。3.　起動　「スタート」→「全てのカテゴリ」→「ビデオ」→ 「Brasero」　起動直後の状態です。　2021年11月29日の時点で、下記のバージョンでした。</description>
            <pubDate>Mon, 29 Nov 2021 04:11:59 +0000</pubDate>
        </item>
        <item>
            <title>deepin - 20.3 - ドキュメントビューア deepin-reader</title>
            <link>https://freebsd.sing.ne.jp/linux/19/06/11.html</link>
            <description>1.　概要　ドキュメントビューアとして「deepin-reader」を使用します。　「deepin-reader」は、デフォルトでインストールされています。2.　起動　「スタート」→「全てのカテゴリ」→「オフィス」→「Document Viewer」　起動直後の状態です。　ファイルを開いたところです。　日本語も綺麗に表示されています。　2021年11月29日の時点で、下記のバージョンでした。</description>
            <pubDate>Mon, 29 Nov 2021 04:09:23 +0000</pubDate>
        </item>
        <item>
            <title>deepin - 20.3 - メディアプレイヤー SMPlayer</title>
            <link>https://freebsd.sing.ne.jp/linux/19/06/10.html</link>
            <description>1.　概要　マルチメディアプレイヤーとして、「SMPlayer」を使用します。2.　インストール　「Synaptic」で、「smplayer」を検索して、インストールします。3.　起動　「スタート」→「全てのカテゴリ」→「ビデオ」→「SMPlayer」　起動直後の状態です。　ビデオコンテンツを再生してみました。　快適に再生できます。　2021年11月29日の時点で、下記のバージョンでした。</description>
            <pubDate>Mon, 29 Nov 2021 04:08:45 +0000</pubDate>
        </item>
        <item>
            <title>deepin - 20.2 - メディアプレイヤー SMPlayer</title>
            <link>https://freebsd.sing.ne.jp/linux/19/05/10.html</link>
            <description>1.　概要　マルチメディアプレイヤーとして「SMPlayer」を使用します。　前回は、「SMPlayer」をインストールして使ったら、コーデックが足りないらしく、ビデオコンテンツを再生しようとするとこけていました。　仕方なく、デフォルトでインストールされている、「deepin-movie」を使ったのですが、今回は「SMPlayer」が使えました。　実際は、一度、本体の「VirtualBox」がこけてしまったのですが、２留めからは、支障なく再生までできました。2.　インストール　「Synaptic」で、「smplayer」を検索して、インストールします。3.　起動　「スタート」→「ビデオ」→「SMPlayer」　起動直後の状態です。　ビデオコンテンツを再生してみました。　正常に再生できました。　2021年4月30日の時点で、下記のバージョンでした。</description>
            <pubDate>Mon, 29 Nov 2021 04:08:14 +0000</pubDate>
        </item>
        <item>
            <title>deepin - 20.3 - 基本操作 - パッケージ管理</title>
            <link>https://freebsd.sing.ne.jp/linux/19/06/03.html</link>
            <description>1.　概要　「deepin」には、デフォルトでインストールされる、公式のグラフィカルなパッケージ管理フロントエンドがないと思っていたら、「deepin-app-store」というのを見落としていました。　今回は、それも使ってみます。　ただし、いつものくせで「Synaptic」もインストールして使うこととします。　「Synaptic」の操作に関しては、「Linux - 共通事項 - パッケージ管理フロントエンド」をご参照ください。2.　Synaptic インストール　端末を開いて、「root」ユーザでapt install -y synaptic3.　Synaptic 起動　「スタート」→「全てのカテゴリ」→「システム」→「Synaptic パッケージマネージャ」　ログインユーザのパスワードを入力して　「確認」　初回起動時は、説明が表示されます。　「Close」　起動直後の状態です。　2021年11月26日の時点で、下記のバージョンでした。4.　deepin-app-store 起動　「スタート」→「全てのカテゴリ」→「システム」→「アプリストア」　起動直後の状態です。　2021年11月26日の時点で、下記のバージョンでした。apt install -y synaptic</description>
            <pubDate>Mon, 29 Nov 2021 00:53:43 +0000</pubDate>
        </item>
        <item>
            <title>deepin - 20.2 - 光ディスクライティング Brasero</title>
            <link>https://freebsd.sing.ne.jp/linux/19/05/12.html</link>
            <description>1.　概要　光ディスクライティングソフトとして「Brasero」を使用します。2.　インストール　「Synaptic」で、「brasero」を検索して、インストールします。3.　起動　「スタート」→「ビデオ」→ 「Brasero」　起動直後の状態です。　2021年4月30日の時点で、下記のバージョンでした。</description>
            <pubDate>Mon, 29 Nov 2021 00:51:21 +0000</pubDate>
        </item>
        <item>
            <title>deepin - 20.3 - 画像編集ソフト GIMP</title>
            <link>https://freebsd.sing.ne.jp/linux/19/06/09.html</link>
            <description>1.　概要　画像編集ソフトとして「GIMP」をインストールして使用します。2.　インストール　「Synaptic」で、「gimp」を検索して、インストールします。3.　起動　「スタート」→「全てのカテゴリ」→「グラフィックス」→「GIMP」　起動直後の状態です。　2021年11月29日の時点で、下記のバージョンでした。　操作については、「画像編集ソフト GIMP2」に掲載しています。　上記は簡単なものですので、詳細なものがほしい方は、各所に初歩の手引きから応用編までありますので、そちらを参考にしてください。</description>
            <pubDate>Mon, 29 Nov 2021 00:38:24 +0000</pubDate>
        </item>
        <item>
            <title>deepin - 20.3 - 基本操作 - オフィススイート LibreOffice</title>
            <link>https://freebsd.sing.ne.jp/linux/19/06/08.html</link>
            <description>1.　概要　オフィススイートとして「LibreOffice」がインストールされています。　日本語化されていないので、日本語化モジュールをインストールして使用します。2.　インストール　「Synaptic」で「libreoffice-l10n-ja」を検索して、インストールします。3.　起動　「スタート」→「全てのカテゴリ」→「オフィス」→ 「LibreOffice」　起動直後の状態です。　2021年11月29日の時点で、下記のバージョンでした。　操作方法等については「オフィススィート LibreOffice」をご参照ください。</description>
            <pubDate>Mon, 29 Nov 2021 00:30:12 +0000</pubDate>
        </item>
        <item>
            <title>deepin - 20.3 - 基本操作 - メールクライアント deepin-mail</title>
            <link>https://freebsd.sing.ne.jp/linux/19/06/07.html</link>
            <description>1.　概要　メールクライアントとして、何やら、「deepin-mail」というものがインストールされています。2.　起動　「スタート」→「全てのカテゴリ」→「インターネット」→「Mail」　初回起動時は「メールアカウント設定」が起動します。　起動直後の状態です。　2021年11月29日の時点で、下記のバージョンでした。　アカウントの設定や操作に関しては、「メールクライアント - deepin -mail」をご参照ください。</description>
            <pubDate>Mon, 29 Nov 2021 00:18:43 +0000</pubDate>
        </item>
        <item>
            <title>deepin - 20.3 - 基本操作 - ブラウザ Browser</title>
            <link>https://freebsd.sing.ne.jp/linux/19/06/06.html</link>
            <description>1.　概要　ブラウザとして、オリジナルの「Browser」がインストールされています。　実際、ロードモジュール名が「browser」です　こういう、固有名詞に一般名をつけるのは、見識を疑います。　デフォルトで日本語化されています、。2.　起動　「スタート」→「全てのカテゴリ」→「インターネット」→「ウェブ ブラウザ」　起動直後の状態です。　2021年11月29日の時点で、下記のバージョンでした。</description>
            <pubDate>Mon, 29 Nov 2021 00:08:11 +0000</pubDate>
        </item>
        <item>
            <title>deepin - 20.3 - 基本操作 - アンチウィルス ClamTk</title>
            <link>https://freebsd.sing.ne.jp/linux/19/06/05.html</link>
            <description>1.　概要　「ClamTk」は GUI で操作するアンチウィルスソフトです。2.　インストール　「Synaptic」で、「clamtk」を検索して、インストールします。3.　起動　「スタート」→「全てのカテゴリ」→「システム」→「ClamTk」　起動直後の状態です。　2021年11月29日の時点で、下記のバージョンでした。</description>
            <pubDate>Mon, 29 Nov 2021 00:08:10 +0000</pubDate>
        </item>
    </channel>
</rss>
