This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from pprint import pprint as pp | |
from bleak import BleakScanner | |
from bleak.backends.scanner import AdvertisementData | |
async def main(): | |
print("scanning for 5 seconds, please wait...") | |
devices = await BleakScanner.discover(return_adv=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "test_helper" | |
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase | |
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome( | |
chromeOptions: { | |
args: %w(no-sandbox headless disable-gpu window-size=1280x800) | |
} | |
) | |
driven_by :selenium, using: :chrome, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveAdmin.register Post do | |
permit_params :uid, :name, :meta, :related_ids | |
form do |f| | |
f.semantic_errors # shows errors on :base | |
f.inputs do | |
f.input :uid | |
f.input :name | |
f.input :meta, as: :text # json,jsonb型をtextとして扱う | |
f.input :related_uids, as: :string # arrayをstringとして扱う |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bootstate=0 | |
title=Loading ESXi installer | |
timeout=5 | |
kernel=/tboot.b00 | |
kernelopt=runweasel noIOMMU ks=usb text nofb com2_baud=115200 com2_Port=0x2f8 tty2Port=com2 gdbPort=none logPort=none | |
modules=/b.b00 --- /jumpstrt.gz --- /useropts.gz --- /features.gz --- /k.b00 --- /chardevs.b00 --- /a.b00 --- /user.b00 --- /uc_intel.b00 --- /uc_amd.b00 --- /sb.v00 --- /s.v00 --- /ata_liba.v00 --- /ata_pata.v00 --- /ata_pata.v01 --- /ata_pata.v02 --- /ata_pata.v03 --- /ata_pata.v04 --- /ata_pata.v05 --- /ata_pata.v06 --- /ata_pata.v07 --- /block_cc.v00 --- /char_ran.v00 --- /ehci_ehc.v00 --- /elxnet.v00 --- /hid_hid.v00 --- /i40en.v00 --- /igbn.v00 --- /ima_qla4.v00 --- /ipmi_ipm.v00 --- /ipmi_ipm.v01 --- /ipmi_ipm.v02 --- /ixgben.v00 --- /lpfc.v00 --- /lsi_mr3.v00 --- /lsi_msgp.v00 --- /lsi_msgp.v01 --- /misc_cni.v00 --- /misc_dri.v00 --- /mtip32xx.v00 --- /ne1000.v00 --- /nenic.v00 --- /net_bnx2.v00 --- /net_bnx2.v01 --- /net_cdc_.v00 --- /net_cnic.v00 --- /net_e100.v00 --- /net_e100.v01 --- /net_enic.v00 --- /net_fcoe.v0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
POOL=${POOL:-zfsimages} | |
POOL_PATH=${POOL_PATH:-"/ztank/libvirt/images"} | |
ORIGINAL_IMAGE=${ORIGINAL_IMAGE:-CentOS-7-x86_64-GenericCloud.qcow2} | |
VM_NAME=${1} | |
VM_RAM=1024 | |
VM_CPU=1 | |
VM_DISK=${1}.qcow2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## **Updates to this file are now at https://github.com/giovtorres/virt-install-centos ** | |
# Take one argument from the commandline: VM name | |
if ! [ $# -eq 1 ]; then | |
echo "Usage: $0 <node-name>" | |
exit 1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python | |
# 一番強いハッシュ関数とランダムにソルトを選んでくれる | |
# python -c 'import crypt; print crypt.crypt("password")' | |
# 上に同じ | |
# python -c 'from crypt import crypt,mksalt; s=mksalt(); print crypt("password",s)' | |
# SHA-512指定,ソルトはランダム | |
#python -c 'from crypt import crypt,mksalt,METHOD_SHA512; s=mksalt(METHOD_SHA512); print crypt("password",s)' | |
import crypt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/etc/default/grub, /etc/sysconfig/grub は同一ファイル(スタティックリンクされてる) | |
- VGA(物理コンソール)@ tty0 | |
- 物理シリアル@ ttyS0 ← systemd@gettyで待ち受けるようにする | |
- 仮想シリアル@ ttyS1 ← grob,boot,systemd@getty | |
- GRUB_SERIAL_COMMAND | |
boot menuはこっちの設定が使われるので何もしないと9600で出力されることになりもっさりする?) | |
- GRUB_CMDLINE_LINUX | |
カーネルに渡す設定 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### NetworkManagerでネットワーク管理 | |
- 確認するときnmtui使えるのは大きいと思う | |
- セットアップはnmcliでやる | |
- 設定ファイルは/etc/sysconfig/network-scriptに入っている | |
- 設定ファイルを保存した時点で自動的にNetworkManagerが設定を行うので注意 | |
# デバイス確認 | |
nmcli device | |
nmcli connection show | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### virt-sysprep | |
- ディスクイメージへの書き込み権限が必要 | |
# リスト表示 | |
virt-sysprep --list-operations | |
# 一部だけ | |
virt-sysprep --enable ssh-hostkeys,udev-persistent-net -d centos7core | |
# 全部 |
NewerOlder