投稿者: chombo

  • タオルフック

     台所でタオルを使うのにシンク下の扉にかけていたが、隙間ができるのと美しくないのでタオルフックを購入した。

     以前プラスチック製でV字型の溝に挟み込むタイプを使っていたが、経年変化でプラスチックが半分に割れて利用できなくなっていた。

     Amazaonでのレビューはいまいちだったが、メーカーの姿勢が気に入り購入してみた。

     到着した製品は、少し指に引っかかる感じでバリが残っているみたいだったので目の細かいやすりで削って滑らかにしておいた。

     以前使っていたプラスチック製よりしっかり挟み込んでくれる気がする。

  • WordPress TwrntyTwentyテーマにサイドバーを追加

    画面の横にペインがないと何となく落ち着かない。

    2020年現在最新のテーマTwentyTwentyにサイドバーを追加した。

    C:\xampp\htdocs\wordpress\wp-content\themes\<テーマ名>\functions.php に以下を追加

    function my_theme_widgets_init() {
        register_sidebar( array(
            'name'          => 'Main Sidebar',
            'id'            => 'main-sidebar',
        ) );
    }
    add_action( 'widgets_init', 'my_theme_widgets_init' );

    index.phpに以下を追加

    <?php get_sidebar(); ?>

    sidebar.phpを以下で作成

    <div id="primary-sidebar" class="primary-sidebar widget-area" role="complementary">
      <?php dynamic_sidebar( 'main-sidebar' ); ?>
    </div><!-- #primary-sidebar -->

    外観-カスタマイズで追加CSSに以下を追加。

    /* サイドバーを左に表示 */
    #primary-sidebar {
    	float: left;
    	padding-top: 0rem;
    	padding-right:1rem;
    	width:30%;
    	min-width: 140px;
    }
    

    なぜか見出しの文字が大きすぎるのでサイズを指定した。

    /* 投稿の見出し文字の大きさ */
    .entry-title {
    	font-size: 3.2rem;
    }
    /* サイドバーの見出し文字の大きさ */
    .widgettitle {
    	font-size: 2.5rem;
    }

    ついでにカレンダーに特定の日付にハイライトを付ける。

    /* カレンダーの日付の色 */
    .widget_calendar #today {
    	margin-bottom: 0;
    	background-color: #689F38;
    }
    .widget_calendar a {
    	font-weight: bold;
    }
  • AWS Lightsailでサーバーを構築-スケールアップ編

    AWS Lightsailの無料使用期間が終わったので、インスタンスのスケールアップを行った。

    メモリが512MBでは動かないことはないが、たまにフリーズすることもある。メモリを1GBのプランにスケールアップした。

    スナップショットの作成

    https://lightsail.aws.amazon.com/ls/docs/ja_jp/articles/prepare-windows-based-instance-and-create-snapshot

    インスタンスの管理でインスタンスを停止する
    スナップショットを作成する
    インスタンスを開始し、Ec2LaunchSettingsを実行する
    Administrator PasswordはRandomを選択し、Shutdown with Sysprepボタンを押す。
    SysprepはPC固有情報を削除するらしい。

    https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/sysprep--system-preparation--overview
    Removes PC-specific information from the Windows image, including the PC’s security identifier (SID). This allows you to capture the image and apply it to other PCs. This is known as generalizing the PC.
    Uninstalls PC-specific drivers from the Windows image.
    Prepares the PC for delivery to a customer by setting the PC to boot to OOBE.
    Allows you to add answer file (unattend) settings to an existing installation.

    インスタンスが停止したら再度スナップショットを作成する
    最新のスナップショットから新規インスタンスを作成
    ホーム-ネットワークから静的パブリックIPアドレスを新しいインスタンスに振りなおす
    旧インスタンスのスナップショットを2つとも削除する
    旧インスタンスを削除する
    新インスタンスのファイアーフォールを設定する
    DNSを設定する -DNSは静的パブリックIPアドレスに紐づいているので不要

    コンピューター名を変更する