WSL2で開発中のWebアプリをスマホで即座に動作確認したい スマホとPCが同一のWifiに接続している状態でスマホのブラウザから http://<PCのIPアドレス>:<Webアプリのポート> にアクセスして動作確認出来ることがよく知られています。 私は普段PC向けの業務システムやライブラリを作っているのでこの方法を使う機会がほとんどないのですが、久しぶりにスマホでの確認が必要になりました。 開発環境がWSL2の場合に固有処理が必要だったのでメモ代わりに公開しておきます。 WSL2固有処理だけ知りたい人のための結論 PowerShellを管理者権限で開いてください。 以下を1行ずつ入力してもいいし、ps1ファイルに書いて実行でもいいはずです。 私はPowerShellに慣れてないので1行ずつ打ち込んでます。 開始 $ports = @(3000, 8000) # Webアプリで使うポート
Windowsのレジストリなどを見ると、波カッコ「{}」に囲まれた16進数の羅列を見ることがある。これをGUID(Globally Unique Identifier)という。GUIDは、Windowsでユニークな識別子として使われる128bit(16バイト)の数値である。GUIDは、WindowsのAPIで作成することができ、他のマシンで作られたGUIDであっても、衝突することが極めてまれで、事実上起こらないと考えてもよいレベルのものだ。 Windows Terminalではプロファイルの識別にGUIDを利用している。GUIDは多くの場合、波カッコに囲まれた5つの16進数として表示される Windowsでは、オブジェクトやクラスの定義などに使われる。数値なので比較が容易で検索処理などを高速化できる。 このGUIDは、UUIDと呼ばれる識別子の一種だ。Windowsでは、UUIDの一部をG
PowerShellのGet-CimInstanceコマンドを使うと、コマンドラインからUSBデバイスなどを検索で見つけることができる USBデバイスについて調べたくなることがある。簡単な方法としては、コントロールパネルのデバイスマネージャーがあるが、デバイスを探す場合は目視となるため、どうも面倒なことが多い。最近では、ラップトップやタブレットなどの内蔵デバイスもUSB接続になっていることがあり、マウスやキーボードのようにケーブルがつながっているものだけがUSBデバイスとして存在するわけでもない。 USBデバイスをコマンドラインで調べる コマンドラインから簡単にUSBデバイスを調べるには、PowerShellのGet-CimInstanceコマンドが利用できる。このとき、以下の表のようなクラスを指定することで各種のUSB関連情報を得ることが可能だ。 まず、すべてのデバイスは、「Win32_
ファイルやフォルダーの利用者をリソースモニターで検索する プロセスが掴んでいるファイルを調べる 補足:コマンドで同じようなことをやる 補足:その他諸々 某所で書いたら意外に皆さん知らなかったようなので書いておきます。Windowsでファイルを削除したり名称変更しようとすると、別のプログラムが使っているので変更できない、といったエラーが出る事があります。こういう場合、後述の方法で「誰がファイルを掴んでいるのか」を調べられるかもしれません。 (あくまでローカル環境での話ですので、ネットワーク越しに掴まれているものや、インフラの運用で役立つ情報というわけではありません。ご了承ください) ファイルやフォルダーの利用者をリソースモニターで検索する リソースモニターという、タスクマネージャーの高機能版のようなツールがWindowsには標準搭載されています。これで、CPUタブにある「関連付けられたハンド
自宅のネットワークなどで、接続しているPCを全部見つけたいことがある。エクスプローラーのネットワークから見つけることもできるが、スクリプトなどで処理したい場合に手入力するのは面倒だ。そんなときには、PowerShellのGet-NetNeighborコマンドが利用できる。 PowerShellのGet-NetNeighborコマンドは、ネットワーク内の通信により得たIPアドレスを出力できる。ただし、大量の出力があるので、不要なものを排除する必要がある Get-NetNeighborでアクセス可能なIPアドレスを探す LAN内のネットワークノードを探すのは面倒な処理だ。たとえば、クラスCのプライベートネットワークならノード数は多くても254個なので、すべてのアドレスに対して、Pingコマンドを実行して応答の有無でノードの存在を確認することも不可能ではない。しかし、実際にスクリプトを書くとなる
WSLを使ってCドライブ上のファイルを実行するとどうしても遅くなってしまうことを知り、PowerShellに”推し変”しようと決意しました。とはいえ、デフォルトのPowerShellは個人的には使いづらく感じてしまい推せる気がしなかったので、PowerShellを自分好みの”いい子”にして推す方法を選びました。 想定している対象読者 ・WSLと最近うまくいっていない方 ・PowerShellと仲良くなれない方 ・PowerShellと仲は良いけど、もっと仲良くなりたい方 とりあえず環境構築 1.Windows Terminalのインストール インストールはこちらから 2.必要なフォントのインストール こちらからCascadia Code PLまたはCascadia Mono PLをインストールして、Windows Terminalのフォントとして設定する必要があります。設定はWindows
開発環境構築用のメモを自分用に書き残しておく。 GUIアプリケーション この辺りを入れる。 Google Chrome Google日本語入力 1Password 4 Dropbox Docker Desktop for Windows 未だに購読版に移行せず買い切り版の1Password 4を利用している。 Windows + Vを利用するとクリップボード履歴を有効化できるので、済ませておく。 Google日本語入力の設定 HENKANキーでIMEを有効化 MUHENKANキーでIMEを無効化 というキー設定を普段利用しているのでそのように設定する。 直接入力 入力文字なし 変換前入力中 変換中 以上の4つのモードについて、それぞれキー設定のエントリを追加する。 Windowsライセンス認証 Windows 10 Pro 64bit辺りをライセンスキー無しでインストールしていると思うので
序論 WSL2 では起動時に systemd を自動スタートさせたり、/etc/rc.local によるスタートアップスクリプトの実行ができません。 Windowsスケジューラにスクリプトを登録するなど、回避策はありますが、筆者はなるべく Linux 環境内で設定を完結させたいと考えていました。 そのような訳で、WSL2 で Docker を使いたい場合、起動時にいちいち以下のようなコマンドを打っていました。 # dockerデーモン起動 $ sudo service docker start # WSL2 には cgroup 用ディレクトリがデフォルトで作られていないため作成しておく ## これをしておかないと Docker でプロセスのグループ化が必要になったときにエラーが起きる $ sudo mkdir -p /sys/fs/cgroup/systemd $ sudo mount -
◆ Live配信スケジュール ◆ サイオステクノロジーでは、Microsoft MVPの武井による「わかりみの深いシリーズ」など、定期的なLive配信を行っています。 ⇒ 詳細スケジュールはこちらから ⇒ 見逃してしまった方はYoutubeチャンネルをご覧ください 【5/21開催】Azure OpenAI ServiceによるRAG実装ガイドを公開しました 生成AIを活用したユースケースで最も一番熱いと言われているRAGの実装ガイドを公開しました。そのガイドの紹介をおこなうイベントです!! https://tech-lab.connpass.com/event/315703/ こんにちは、サイオステクノロジー武井(Twitter:@noriyukitakei)です。今回は、第4回シリーズで、WSL2、Visual Studio Code、Docker、Windows Terminalなどの
WSL2とVirtual Boxは同時使用できません エラーもなにも表示されず、仮想サーバも動作します。しかし、ubuntuのインストールが正常に完了しません。CentOSもうまくインストールできません。 動いてるんだけど、正常じゃないという非常にやな状況になります。 VirtualBox 6.1.12 の場合です 解決策 Virtualboxを使う時は、WSLを停止させる 以上 半日溶かしました。あ~もっと早くWSLを疑えばよかった。 同時に使えるようになってくれ。 気づかずハマるひといると思う(拡散希望!) 追加情報 VirtualBox 6.1.16 で改善されている事を確認しました。WSL2有効の状態で、ubuntu 20のVM起動できました。 Windows10のVMを起動してみたら、起動途中で止てるのではないかと思うくらい起動時間が長く、起動後も動作が非常に遅いです。軽い処理の
Nintendo Switchの純正プロコンを異次元レベルの操作性に!使わない理由がない革新的アダプター
HomeNewsMicrosoftWindows 10 quietly got a built-in network sniffer, how to use Microsoft has quietly added a built-in network packet sniffer to the Windows 10 October 2018 Update, and it has gone unnoticed since its release. A packet sniffer, or network sniffer, is a program that monitors the network activity flowing over a computer down to an individual packet level. This can be used by network a
「Windows 10ミニTips」は各回の作成時点で最新のWindows 10環境を使用しています。 Windows 10のHyper-V仮想マシンを起動するには、基本的にHyper-Vマネージャーを使用しなければならない。だが、とある方法を使えば仮想マシンへの直接アクセスが可能だ。 vmconnect.exeのショートカットファイルを作成する Windows 10 Pro以上のエディションを使っている方ならば、Hyper-Vを使う場面は少なくないかもしれない。ネットワークを分断したサンドボックス環境や実験環境など利用用途は多い。だが、Windows 10でHyper-V仮想マシンを起動するには「Hyper-Vマネージャー」の起動が必要だ。Windows PowerShell経由も可能だが、コマンドラインから操作するため少々冗長になってしまう。 標準のHyper-V仮想マシン管理ツールで
メイン著者記事としてはご無沙汰しておりますmorimorihogeです。 今年もTechRachoではアドベントカレンダー特集ということで、普段あまり記事を書く機会がなくて表に出ないメンバーにも記事を書いてもらえる運びとなりました。クリスマスまではアドベントカレンダー特集進行のTechRachoをお楽しみ下さい。 今回は最近メイン開発環境をMacからWindowsに移行したので、そのあたりの感想や設定の勘所などをまとめてみたいと思います。 なぜMacから移行するのか? 僕はOS XのIntel Macが出たころからのMacユーザー(当時はまだRosettaとかがありました)で、かれこれ10年以上Macを使い続けてきました。多分Webシステム開発用途でMacを使い始めたという人の中では古参の方なのではないでしょうか。 というわけで、なんで移行するの?という話からぽえみーに綴ってみようと思いま
かつては色々な方法が有りましたが、Windows 10 (April 2018 Update以降) 現在においては特に追加で入れなくてもOS標準で以下のコマンドが使えるようになっています。 ssh (ssh-keygen等も含む) sftp scp tar curl Windows 10にはLinuxのほぼフル機能が使えるWSL(Windows Subsystem for Linux)が有りますがそれを導入せずとも利用できます。唐突にLinux/Unixサーバーに接続してあれこれしたくなった時にも十分対応できそうな感じですね。 コマンドプロンプトのコードページ設定が932(ANSI/OEM 日本語 Shift-JIS)のままでもUTF-8なサーバーに接続してUTF-8なテキストファイルは普通に編集できるので普通に実用可能かと思います。 whereコマンドで探してみると C:\Windows
OneDriveのサインイン画面 OneDriveを使う予定もないのに、Windows 10へのサインイン後、OneDriveのサインインを要求する画面が表示されるような場合は、OneDriveの無効化やアプリの削除を行えばよい。 Microsoftのクラウドストレージサービス「OneDrive」は、OneDriveに新規登録(Microsoftアカウントを作成)すると、無料で5GBの容量まで写真/ファイル/フォルダが保存でき、それらのファイルなどを他のPCやスマートフォン、他のユーザーと共有し、どこからでもアクセスできる便利な機能だ。OneDriveについての詳細は、下記の記事を参照してほしい。 Windows 8以降、OneDriveがWindows OSに統合され、デフォルトで利用できるようになった。そのため、Windows 10にサインインするたびに、OneDriveアプリへのサイ
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く