# 202310 ## prusa slicerでreplicator 2x rev0.1 ``` ; start gcode M73 P0 ; enable build progress G162 X Y F3000 ; home XY maximum G161 Z F1200 ; home Z minimum ;G92 Z-5 ; set Z to -5 G1 Z0 ; move Z to 0 G161 Z F100 ; home Z slowly M132 X Y Z A B ; recall home offsets M135 T0; ADD BY HASHIMOTO G1 X-130 Y-75 Z30 F9000 ; move to wait position off table G130 X20 Y20 Z20 A20 B20 ; lower stepper Vrefs while heating ; M126 Sfan_speed_pwm ;M140 S{bed_temperature[0]} T0 ; ;M104 S{temperature[0]} T0 ;M104 S{temperature[1]} T1 M133 T0 ; stabilize extruder temperature G130 X127 Y127 Z40 A127 B127 ; default stepper Vrefs G92 A0 B0; zero extruder ;G1 X-100 Y-70 F9000 ;G1 Z0.3 F6000 ;G1 X-90 Y-70 E24 F2000 ;G1 X-100 Y-70 F180 ;G1 X-110 Y-70 F5000 ;G1 Z0.5 F100 ; start comment out1 G1 Z0.3 ; position nozzle ;G1 E25 F300 ; purge nozzle G1 X-120 Y-70 Z0.15 F1200 ; slow wipe G1 X-115 Y-65 Z0.5 F1200 ; lift ; end comment out1 G92 A0 B0; zero extruder M73 P1 ;@body (notify GPX body has started) ; end of start gcode ; **** Replicator 2 end.gcode **** M73 P100 ; end build progress G1 Z155 F1000 ; send Z axis to bottom of machine M140 S0 T0 ; cool down HBP M104 S0 T0 ; cool down right extruder M104 S0 T1 ; cool down left extruder M127 ; stop blower fan G162 X Y F3000 ; home XY maximum M18 ; disable stepper M72 P1 ; play Ta-Da song ; **** end of end.gcode **** ``` ## clang-format - `find * | grep -E ".*(\.ino|\.cpp|\.c|\.h|\.hpp|\.hh)$" | xargs clang-format -i -style=LLVM` - `find . | grep -E ".*(\.ino|\.cpp|\.c|\.h|\.hpp|\.hh)$" | xargs clang-format -i -style=LLVM` ## EMAX 2806-100KV - リアクションホイールにつかえそうなBLDC. - ジンバル用あたりを探すといいっぽい.KV値は100くらいの低めのやつを狙う. ## [GitHub - 771-8bit/SerialMonitorEssential](https://github.com/771-8bit/SerialMonitorEssential) ## [Webcam Motion Capture - Webカメラだけで指・手のトラッキング](https://webcammotioncapture.info/ja/#download) ## [GitHub - openstatusHQ/openstatus: 🏓 The open-source monitoring platform 🏓](https://github.com/openstatusHQ/openstatus) ## [GitHub - joaojacome/bitwarden-ssh-agent: Small python script to load bitwarden-store ssh keys into ssh-agent](https://github.com/joaojacome/bitwarden-ssh-agent) ## [タスクランナーとしてのmakeを使う際の工夫と注意点 - KAYAC engineers' blog](https://techblog.kayac.com/make-as-task-runner) ## [Lipo/Li-ion充放電制御回路の実験 - VIVITABLOG](https://blog.vivita.io/entry/2023/07/13/091546) ## [The Twelve-Factor App (日本語訳)](https://12factor.net/ja/) ## 手が動かないときの対処法 - taskを簡単な順にならべて簡単なほうからやる - 簡単じゃないと思ったら分割して小さくする - くりかえし ## [libvirt: The virtualization API](https://libvirt.org/) - [libvirt: Network XML format](https://libvirt.org/formatnetwork.html) ## [Welcome - Klipper documentation](https://www.klipper3d.org/) ## [Hammerspoon](https://www.hammerspoon.org/) ## [Claude](https://claude.ai/) ## GKE upgrade ``` export GKE_CHANNEL=REGULAR export GKE_VER=1.25.10-gke.2700 export GKE_REGION=asia-northeast1 export GKE_CLUSTER=my-dev-master export GKE_NODEPOOL=my-dev-pool gcloud container get-server-config --flatten="channels" --filter="channels.channel=${GKE_CHANNEL}" --format="yaml(channels.channel,channels.validVersions)" --region=${GKE_REGION} gcloud container clusters list gcloud container node-pools list --cluster=${GKE_CLUSTER} --region=${GKE_REGION} kubectl get nodes gcloud container clusters upgrade ${GKE_CLUSTER} --master --cluster-version ${GKE_VER} --region=${GKE_REGION} gcloud container clusters upgrade ${GKE_CLUSTER} --node-pool=${GKE_NODEPOOL} --cluster-version ${GKE_VER} --region=${GKE_REGION} ``` ## netbox v3.5.9 -> 3.6.xのマイグレーションでコケる - 原因はindexがなかったから. - [netbox/netbox/extras/migrations/0094_tag_object_types.py at v3.6.0 · netbox-community/netbox · GitHub](https://github.com/netbox-community/netbox/blob/v3.6.0/netbox/extras/migrations/0094_tag_object_types.py) - `RenameIndex` of fields `('content_type', 'object_id')` をしたいのに,indexないのでErrorになっていた. - Indexを貼って再度migrationをしたら通った.migration後のindex nameをみるとちゃんとrename後の `extras_tagg_content_717743_idx` となっているので想定通りっぽそう. ``` netbox-docker-netbox-1 | ⚙️ Applying database migrations netbox-docker-netbox-1 | 🧬 loaded config '/etc/netbox/config/configuration.py' netbox-docker-netbox-1 | 🧬 loaded config '/etc/netbox/config/extra.py' netbox-docker-netbox-1 | 🧬 loaded config '/etc/netbox/config/logging.py' netbox-docker-netbox-1 | 🧬 loaded config '/etc/netbox/config/plugins.py' netbox-docker-netbox-1 | Operations to perform: netbox-docker-netbox-1 | Apply all migrations: account, admin, auth, circuits, contenttypes, core, dcim, django_rq, extras, ipam, sessions, social_django, taggit, tenancy, users, virtualization, wireless netbox-docker-netbox-1 | Running migrations: netbox-docker-netbox-1 | Applying users.0004_netboxgroup_netboxuser... OK netbox-docker-netbox-1 | Applying account.0001_initial... OK netbox-docker-netbox-1 | Applying dcim.0173_remove_napalm_fields... OK netbox-docker-netbox-1 | Applying dcim.0174_device_latitude_device_longitude... OK netbox-docker-netbox-1 | Applying dcim.0174_rack_starting_unit... OK netbox-docker-netbox-1 | Applying dcim.0175_device_oob_ip... OK netbox-docker-netbox-1 | Applying dcim.0176_device_component_counters... OK netbox-docker-netbox-1 | Applying dcim.0177_devicetype_component_counters... OK netbox-docker-netbox-1 | Applying dcim.0178_virtual_chassis_member_counter... OK netbox-docker-netbox-1 | Applying dcim.0179_interfacetemplate_rf_role... OK netbox-docker-netbox-1 | Applying dcim.0180_powerfeed_tenant... OK netbox-docker-netbox-1 | Applying dcim.0181_rename_device_role_device_role... OK netbox-docker-netbox-1 | Applying extras.0093_configrevision_ordering... OK netbox-docker-netbox-1 | Traceback (most recent call last): netbox-docker-netbox-1 | File "/opt/netbox/netbox/./manage.py", line 10, in netbox-docker-netbox-1 | execute_from_command_line(sys.argv) netbox-docker-netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line netbox-docker-netbox-1 | utility.execute() netbox-docker-netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 436, in execute netbox-docker-netbox-1 | self.fetch_command(subcommand).run_from_argv(self.argv) netbox-docker-netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/management/base.py", line 412, in run_from_argv netbox-docker-netbox-1 | self.execute(*args, **cmd_options) netbox-docker-netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/management/base.py", line 458, in execute netbox-docker-netbox-1 | output = self.handle(*args, **options) netbox-docker-netbox-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ netbox-docker-netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/management/base.py", line 106, in wrapper netbox-docker-netbox-1 | res = handle_func(*args, **kwargs) netbox-docker-netbox-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ netbox-docker-netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/management/commands/migrate.py", line 356, in handle netbox-docker-netbox-1 | post_migrate_state = executor.migrate( netbox-docker-netbox-1 | ^^^^^^^^^^^^^^^^^ netbox-docker-netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/migrations/executor.py", line 135, in migrate netbox-docker-netbox-1 | state = self._migrate_all_forwards( netbox-docker-netbox-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ netbox-docker-netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards netbox-docker-netbox-1 | state = self.apply_migration( netbox-docker-netbox-1 | ^^^^^^^^^^^^^^^^^^^^^ netbox-docker-netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/migrations/executor.py", line 252, in apply_migration netbox-docker-netbox-1 | state = migration.apply(state, schema_editor) netbox-docker-netbox-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ netbox-docker-netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/migrations/migration.py", line 132, in apply netbox-docker-netbox-1 | operation.database_forwards( netbox-docker-netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/migrations/operations/models.py", line 1042, in database_forwards netbox-docker-netbox-1 | raise ValueError( netbox-docker-netbox-1 | ValueError: Found wrong number (0) of indexes for extras_taggeditem(content_type_id, object_id). netbox=# \d extras_taggeditem Table "public.extras_taggeditem" Column | Type | Collation | Nullable | Default -----------------+---------+-----------+----------+----------------------------------------------- id | bigint | | not null | nextval('extras_taggeditem_id_seq'::regclass) object_id | integer | | not null | content_type_id | integer | | not null | tag_id | bigint | | not null | Indexes: "extras_taggeditem_pkey" PRIMARY KEY, btree (id) Foreign-key constraints: "extras_taggeditem_tag_id_d48af7c7_fk" FOREIGN KEY (tag_id) REFERENCES extras_tag(id) DEFERRABLE INITIALLY DEFERRED netbox=# create index on extras_taggeditem (content_type_id, object_id); CREATE INDEX netbox=# \d extras_taggeditem Table "public.extras_taggeditem" Column | Type | Collation | Nullable | Default -----------------+---------+-----------+----------+----------------------------------------------- id | bigint | | not null | nextval('extras_taggeditem_id_seq'::regclass) object_id | integer | | not null | content_type_id | integer | | not null | tag_id | bigint | | not null | Indexes: "extras_taggeditem_pkey" PRIMARY KEY, btree (id) "extras_taggeditem_content_type_id_object_id_idx" btree (content_type_id, object_id) Foreign-key constraints: "extras_taggeditem_tag_id_d48af7c7_fk" FOREIGN KEY (tag_id) REFERENCES extras_tag(id) DEFERRABLE INITIALLY DEFERRED netbox=# netbox-docker-netbox-1 | ⚙️ Applying database migrations netbox-docker-netbox-1 | 🧬 loaded config '/etc/netbox/config/configuration.py' netbox-docker-netbox-1 | 🧬 loaded config '/etc/netbox/config/extra.py' netbox-docker-netbox-1 | 🧬 loaded config '/etc/netbox/config/logging.py' netbox-docker-netbox-1 | 🧬 loaded config '/etc/netbox/config/plugins.py' netbox-docker-netbox-1 | Operations to perform: netbox-docker-netbox-1 | Apply all migrations: account, admin, auth, circuits, contenttypes, core, dcim, django_rq, extras, ipam, sessions, social_django, taggit, tenancy, users, virtualization, wireless netbox-docker-netbox-1 | Running migrations: netbox-docker-netbox-1 | Applying users.0004_netboxgroup_netboxuser... OK netbox-docker-netbox-1 | Applying account.0001_initial... OK netbox-docker-netbox-1 | Applying dcim.0173_remove_napalm_fields... OK netbox-docker-netbox-1 | Applying dcim.0174_device_latitude_device_longitude... OK netbox-docker-netbox-1 | Applying dcim.0174_rack_starting_unit... OK netbox-docker-netbox-1 | Applying dcim.0175_device_oob_ip... OK netbox-docker-netbox-1 | Applying dcim.0176_device_component_counters... OK netbox-docker-netbox-1 | Applying dcim.0177_devicetype_component_counters... OK netbox-docker-netbox-1 | Applying dcim.0178_virtual_chassis_member_counter... OK netbox-docker-netbox-1 | Applying dcim.0179_interfacetemplate_rf_role... OK netbox-docker-netbox-1 | Applying dcim.0180_powerfeed_tenant... OK netbox-docker-netbox-1 | Applying dcim.0181_rename_device_role_device_role... OK netbox-docker-netbox-1 | Applying extras.0093_configrevision_ordering... OK netbox-docker-netbox-1 | Applying extras.0094_tag_object_types... OK netbox-docker-netbox-1 | Applying extras.0095_bookmarks... OK netbox-docker-netbox-1 | Applying extras.0096_customfieldchoiceset... OK netbox-docker-netbox-1 | Applying extras.0097_customfield_remove_choices... OK netbox-docker-netbox-1 | Applying extras.0098_webhook_custom_field_data_webhook_tags... OK netbox-docker-netbox-1 | Applying ipam.0067_ipaddress_index_host... OK netbox-docker-netbox-1 | Applying tenancy.0011_contactassignment_tags... OK netbox-docker-netbox-1 | Applying virtualization.0035_virtualmachine_interface_count... OK netbox-docker-netbox-1 | Applying virtualization.0036_virtualmachine_config_template... OK netbox=# \d extras_taggeditem Table "public.extras_taggeditem" Column | Type | Collation | Nullable | Default -----------------+---------+-----------+----------+----------------------------------------------- id | bigint | | not null | nextval('extras_taggeditem_id_seq'::regclass) object_id | integer | | not null | content_type_id | integer | | not null | tag_id | bigint | | not null | Indexes: "extras_taggeditem_pkey" PRIMARY KEY, btree (id) "extras_tagg_content_717743_idx" btree (content_type_id, object_id) Foreign-key constraints: "extras_taggeditem_tag_id_d48af7c7_fk" FOREIGN KEY (tag_id) REFERENCES extras_tag(id) DEFERRABLE INITIALLY DEFERRED netbox=# ``` ## [RedisInsight | The Best Redis GUI](https://redis.com/redis-enterprise/redis-insight/) - [GitHub - RedisInsight/RedisInsight: Redis GUI by Redis](https://github.com/redisinsight/redisinsight) ## [Headless UI - Unstyled, fully accessible UI components](https://headlessui.com/) ## [The Open Graph protocol](https://ogp.me/) ## [OpenGraph - Preview Social Media Share and Generate Metatags - OpenGraph](https://www.opengraph.xyz/) ## [NextAuth.js](https://next-auth.js.org/) ## [Google Analytics](https://tagmanager.google.com/) ## [systemd についての Tips - Vがいる日々](https://vlike-vlife.netlify.app/posts/systemd_tips#_footnotedef_1) ## ESP8266とESP32の5V tolerantについて - ESP3266はEspressif公式のdocumentに5V tolerantである旨の記述がされていた. - ESP32ではその記載は削除されていた. - このためmakerのなかではESP32のIOは5V tolerantではないのではないかという議論がされていた. - 結論から言えばESP32もIO 5V tolerantのよう. - documentに5V tolerantである旨の記載をしたところ,電源として5Vを供給する人間が後を絶たなかったため,記載を削除したらしい. - [ESP8266 | http://hackaday.com/2016/07/28/ask-hackaday-is-the-esp8266-5v-tolerant/](https://www.facebook.com/groups/1499045113679103/permalink/1731855033731442/) > Teo Swee Ann: i can reply officially here: it is 5V tolerant at the IO. while the supply voltage is at 3.3V. > Teo Swee Ann: ESP32 and ESP8285 are both 5V tolerant as well. > Teo Swee Ann: Chris Gimson the reason is too many users took it to mean that the chip is 5 V tolerant. When we say 5 V tolerant, we are only referring to the IOs. So some users mistook this to make that they can power the chip entirely off the 5 V supply. The correct usage is to use 5 V open for these 5 V tolerant pins, and only via only drain configuration. ## ESP32 ### General - pin17-22(GPIO6-11)は内部でSPI Flashに接続されているため通常GPIOとしては利用しない.External Flashを使うならここを利用する. - pin4-7(GPIO34-36, 39)はOPEN_DRAIN, 入力専用ポート ### pin mode - このへんが選べる ``` //GPIO FUNCTIONS #define INPUT 0x01 // Changed OUTPUT from 0x02 to behave the same as Arduino pinMode(pin,OUTPUT) // where you can read the state of pin even when it is set as OUTPUT #define OUTPUT 0x03 #define PULLUP 0x04 #define INPUT_PULLUP 0x05 #define PULLDOWN 0x08 #define INPUT_PULLDOWN 0x09 #define OPEN_DRAIN 0x10 #define OUTPUT_OPEN_DRAIN 0x13 #define ANALOG 0xC0 //Interrupt Modes #define DISABLED 0x00 #define RISING 0x01 #define FALLING 0x02 #define CHANGE 0x03 #define ONLOW 0x04 #define ONHIGH 0x05 #define ONLOW_WE 0x0C #define ONHIGH_WE 0x0D ``` - ref: [arduino-esp32/cores/esp32/esp32-hal-gpio.h at master · espressif/arduino-esp32 · GitHub](https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-gpio.h) ## [MkDocs](https://www.mkdocs.org/) ## [Specification Archives | PMBus](https://pmbus.org/specification-archives/) ## MQTT - [MQTT CLI - GitHub](https://hivemq.github.io/mqtt-cli/) - [GitHub - hivemq/mqtt-cli: MQTT CLI is a useful command line interface for connecting various MQTT clients supporting MQTT 5.0 and 3.1.1](https://github.com/hivemq/mqtt-cli) ``` docker run -it --rm hivemq/mqtt-cli shell ``` - [MQTTブローカーmosquittoをDockerで利用する #mqtt - Qiita](https://qiita.com/kino15/items/0ef252b10100b2ee2f05) - [MQTTX: Your All-in-one MQTT Client Toolbox](https://mqttx.app/) ## さまざまな思考実験/ジレンマ/パラドックス - [思考実験 - Wikipedia](https://ja.wikipedia.org/wiki/%E6%80%9D%E8%80%83%E5%AE%9F%E9%A8%93) - [パラドックス - Wikipedia](https://ja.wikipedia.org/wiki/%E3%83%91%E3%83%A9%E3%83%89%E3%83%83%E3%82%AF%E3%82%B9) - [ジレンマ - Wikipedia](https://ja.wikipedia.org/wiki/%E3%82%B8%E3%83%AC%E3%83%B3%E3%83%9E) - [前後即因果の誤謬 - Wikipedia](https://ja.wikipedia.org/wiki/%E5%89%8D%E5%BE%8C%E5%8D%B3%E5%9B%A0%E6%9E%9C%E3%81%AE%E8%AA%A4%E8%AC%AC) - [ゲーム理論 - Wikipedia](https://ja.wikipedia.org/wiki/%E3%82%B2%E3%83%BC%E3%83%A0%E7%90%86%E8%AB%96) ## [Autonomy – Open-source PLC Software](https://autonomylogic.com/) ## [Welcome to OpenPLC | OpenPLCProject](https://openplcproject.gitlab.io/) ## [pool.ntp.org: the internet cluster of ntp servers](https://www.ntppool.org/ja/) ## [GitHub - BurntSushi/xsv: A fast CSV command line toolkit written in Rust.](https://github.com/BurntSushi/xsv) ## growi upgrade - refs - [Growi 4.5.8から5.1.3までアップグレードした時の記録 #Growi - Qiita](https://qiita.com/paichi81@github/items/0342ba291b5874728e90) - [Growi 4.5から5.0へアップグレード - Scribble](https://scribble.washo3.com/growi4.5to5.0.html) - mongo db upgrade - ref: [Upgrade a Standalone to 6.0 — MongoDB Manual](https://www.mongodb.com/docs/manual/release-notes/6.0-upgrade-standalone/) - 基本的に `db.adminCommand({getParameter: 1, featureCompatibilityVersion: 1})` を確認して - `db.adminCommand({setFeatureCompatibilityVersion: "5.0"})` であげたいversionにする.再度上のコマンドで設定結果を確認. - dockerなら下記 ``` # docker-compose exec mongo bash # mongosh # db.adminCommand({getParameter: 1, featureCompatibilityVersion: 1}) {"featureCompatibilityVersion": {"version": "3.6"}, "ok": 1} # db.adminCommand({setFeatureCompatibilityVersion: "4.4"}) ``` - 3.6 -> 6.0とかはむりで,3.6 -> 4.4 -> 5.0 -> 6.0と踏む必要があるのでmongodbをあげるたびに上記を繰り返してstepを踏んであげていく.dockerだとver指定して再起動しつつ上の手順を踏めばok. - upgrade pathについてはmongoのdocs参照 - 基本的にgrowi自体のverと付随してmongodb verを考慮してあげていけばok.今回はupgrade後にgrowi admin consoleでv5形式へのupgradeをして完了. ## dockerでvolumeを移行する - tl;dr - docker volumeのあるdirをinspectでさがしてtarとかでかためてもっていく - ``` $ docker volume ls $ docker volume inspect {volume_name} ``` してpathがわかる. そのpathにいって `tar -cvf hoge huga` とかでかためてscpしてもっていく. 移行先ではあらかじめvolumeをたてて(空でいいので)おいて,いったんstopさせておいて(data整合性のため),inspect先のdirで既存のものをrmして持ってきてtarを展開してすりかえるのが楽そう. - ref: [ボリュームの利用 | Docker ドキュメント](https://matsuand.github.io/docs.docker.jp.onthefly/storage/volumes/#backup-restore-or-migrate-data-volumes) - これはコンテナ内でマウントして同じことやってるだけで,inspectしてホスト側でやっても実質同じ. ## [Sapient.ai - Unit Test Generation With AI](https://www.sapient.ai/) ## [ScyllaDB | Monstrously Fast + Scalable NoSQL](https://www.scylladb.com/) ## [GitHub - sindresorhus/quick-look-plugins: List of useful Quick Look plugins for developers](https://github.com/sindresorhus/quick-look-plugins)