最新版はこちら。 突っ込みは各日付の BBS エントリのほか、 メール (nakano@st.seikei.ac.jp) や フォーム からどうぞ。 なおスパム除けのため、BBS 機能には 緩い認証を入れて います。 検索エンジンから来た方は、エンジンの方のキャッシュを見るか、 下の簡易検索を試してみてください。
|
Namazu for hns による簡易全文検索 詳しくは 詳細指定/ヘルプを参照して下さい |
||||||||||||||||||||||||||||||||||||||||||||||
Welcome to the Python installation manager configuration helper. ******************************************************************************** Windows is not configured to allow paths longer than 260 characters. Python and some other apps can exceed this limit, but it requires changing a system-wide setting, which may need an administrator to approve, and will require a reboot. Some packages may fail to install without long path support enabled. Update setting now? [y/N]に対して Y と入力。これは admin 権限がいる。リブートが必要と書いてあるけどしなかった気が(したかな?)
******************************************************************************** The global shortcuts directory is not configured. Configuring this enables commands like python3.14.exe to run from your terminal, but is not needed for the python or py commands (for example, py -V:3.14). We can add the directory (C:\Users\nakano\AppData\Local\Python\bin) to PATH now, but you will need to restart your terminal to use it. The entry will be removed if you run py uninstall --purge, or else you can remove it manually when uninstalling Python. Add commands directory to your PATH now? [y/N]と
******************************************************************************** You do not have the latest Python runtime. Install the current latest version of CPython? If not, you can use 'py install default' later to install. Install CPython now? [Y/n]にもそれぞれ Y と入力。
view online help? [y/N]が出たので Y と答えたら、 4. Using Python on Windows が表示された。
C:\Users\nakano>python3 --version Python 3.14.2と出たので、これでインストールは完了した模様。らくちん。
C:\Users\nakano> python3 -iも動いた。
C:\Users\nakano>pip install pyvisa 'pip' は、内部コマンドまたは外部コマンド、 操作可能なプログラムまたはバッチ ファイルとして認識されていません。となる。ChatGPT さんに聞いてみたら、いまの公式推奨は python3 -m pip で使う方式らしいのでそうする。
C:\Users\nakano>python3 -m pip install pyvisa Collecting pyvisa Downloading pyvisa-1.15.0-py3-none-any.whl.metadata (7.1 kB) Collecting typing_extensions>=4.0.0 (from pyvisa) Downloading typing_extensions-4.15.0-py3-none-any.whl.metadata (3.3 kB) Downloading pyvisa-1.15.0-py3-none-any.whl (179 kB) Downloading typing_extensions-4.15.0-py3-none-any.whl (44 kB) Installing collected packages: typing_extensions, pyvisa [....] WARNING: The scripts pyvisa-info.exe and pyvisa-shell.exe are installed in 'C:\Users\nakano\AppData\Local\Python\pythoncore-3.14-64\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. Successfully installed pyvisa-1.15.0 typing_extensions-4.15.0ということで PATH 絡みの警告は出たけど大丈夫っぽい。
U:\common\archive\WinDriverに置いておいた。これもインストールには PC の管理者権限がいる。
import pyvisa
import sys
from time import sleep
class R6144:
def __init__(self, rm, visaId):
try:
self.R6144 = rm.open_resource(visaId) #R6144
except:
print("Cannot connect to R6144")
while True:
key = input("Press Enter to exit.")
if not key:
break
sys.exit()
print("R6144 is ready for Voltage Output Op.")
def sendcmd(self, cmdstr):
self.R6144.write(cmdstr)
def VoltStr(arg1):
if arg1[0] not in "+-":
print("Error: argument must start with + or -")
sys.exit(1)
try:
value = float(arg1)
except ValueError:
print("Error: invalid numeric value")
sys.exit(1)
if not -2.0 <= value <= 2.0:
print("Error: value out of range (-2 to +2)")
sys.exit(1)
return format(value, "+.3f")
if len(sys.argv) < 2:
print("Usage: python3 R6144.py [+|-] volt_val")
sys.exit(1)
vout = VoltStr(sys.argv[1])
print(vout)
rm = pyvisa.ResourceManager()
r6144 = R6144(rm, 'GPIB0::10::INSTR')
r6144.sendcmd(f"V5 D{vout}V") # V5 can output -16 ~ +16 V
r6144.sendcmd("E")
sleep(3)
r6144.sendcmd("H")
R6144.py
として置いておいた。
sudo mount -rt ext4 /dev/sdc2 /mnt/mnt_sdc2でマウントし、
sudo rsync -aHAXv --numeric-ids --info=progress2 \ --ignore-errors --partial --dry-run \ --exclude='/proc/*' --exclude='/sys/*' --exclude='/dev/*' \ --exclude='/run/*' --exclude='/tmp/*' --exclude='/mnt/*' \ --exclude='/lost+found/*' --exclude='/home/nakano/Dropbox/*' \ /mnt/mnt_sdc2/ /opt/backup_atom/で中身をバックアップ。
sudo mount -rwt vfat /dev/sdc1 /mnt/mnt_sdc2/boot/efichroot する
sudo mount --bind /dev /mnt/mnt_sdc2/dev sudo mount --bind /proc /mnt/mnt_sdc2/proc sudo mount --bind /sys /mnt/mnt_sdc2/sys sudo mount --bind /run /mnt/mnt_sdc2/run sudo chroot /mnt/mnt_sdc2 /bin/bashその後 grub-install を実行
# grub-install --target=x86_64-efi --efi-directory=/boot/efi \ --bootloader-id=debian --recheck Installing for x86_64-efi platform. grub-install: warning: EFI variables cannot be set on this system. grub-install: warning: You will have to complete the GRUB setup manually. Installation finished. No error reported.この段階で chroot を抜け、下流から /mnt/mnt_sdc2 まで umount し、 SSD を取り外して NUC に再接続。
update-grubしておき、usb を抜いて NUC を起動したら、grub コンソールが立ち上がった。
grub> ls (hd0) (hd0,gpt1) (hd0,gpt2) (hd0,gpt3)という具合で、
grub> ls (hd0,gpt2)/でちゃんと /etc や /boot が見えて、 /boot に vmlinuz-*-amd64 と initrd.img-*-amd64 が入っていることも確認できた。
grub> set root=(hd0,gpt2) grub> linux /boot/vmlinux-6.12.57+deb13-amd64 root=/dev/sda2 ro grub> initrd /boot/initrd.img-6.12.57+deb13-amd64 grub> bootすると、ちゃんと trixie のシステムが起動した。
sudo grub-install --target=x86_64-efi \ --efi-directory=/boot/efi --bootloader-id=debian --recheck sudo update-grub sudo efibootmgr -c -d /dev/sda -p 1 -L "debian" -l '\EFI\debian\grubx64.efi'して installer usb も抜いて再起動したら、 普通に debian のログインプロンプトが出た。やれやれ。
sudo grub-efi-check.sh pre (upgrade) sudo grub-efi-check.sh postという感じで使うとよいそうです。
C:\Users\nakano>teamsbootstrapper.exe -p
{
"success": true
}
という感じで。にゃーん。
surf(nakano) ~ [71] sudo passwd nakano passwd: Permission denied passwd: password unchangedとなるのであった。
[snip] # here are the per-package modules (the "Primary" block) password [success=2 default=ignore] pam_unix.so obscure yescrypt # password [success=1 default=ignore] pam_ldap.so minimum_uid=1000 try_first_pass # here's the fallback if no module succeeds password requisite pam_deny.so # prime the stack with a positive return value if there isn't one already; # this avoids us returning an error just because nothing sets a success code # since the modules above will each just jump around password required pam_permit.so # and here are more per-package modules (the "Additional" block) # end of pam-auth-update configになっていて、pam_unix.so が「成功したら 2 行 skip」になっていて、pam_permit.so を通過しなかったからである、ということらしい。たぶんだけど、bookworm→trixie で、pam_unix.so の挙動が変わったんですかねえ。