OpenWRT 实现HP1020打印机网络共享

1、下载HP1020固件文件sihp1020.dl文件至/etc目录

2、在USB热拔插触发目录下建立触发脚本:VI /etc/hotplug.d/usb/Printer-HP1020

#!/bin/sh set -e # 固件路径 FIRMWARE=/etc/sihp1020.dl # 打印机路径,可以从OpenWRT的USB打印机界面中中查看 DEVICE=/dev/usb/lp0 # Debug Log File LOGFILE=/tmp/hp1020 if [ "$PRODUCT" = "3f0/2b17/100" -a "$ACTION" = "bind" -a "$DEVTYPE" = "usb_device" ]; then echo "$(date): USB printer binded. Trying to upload firmware..." >> $LOGFILE cat $FIRMWARE > $DEVICE echo "$(date): Success. Done." >> $LOGFILE exit fi

加入首次启动 local startup /etc/rc.local

cat /etc/sihp1020.dl >> /dev/usb/lp0

3、实现效果:

打印机开机后触发USB热插拔事件,HP1020打印机绿灯常亮并立即进行自检,然后红灯绿灯交替闪烁再次自检,随后绿灯常亮

出处: https://www.pizzayy.com/openwrt-实现hp1020打印机网络共享.html?doing_wp_cron=1714973122.5799219608306884765625

How to Resolve “Package crypto/ecdh is not in GOROOT” Error in Linux

Have you encountered the “Package crypto/ecdh is not in GOROOT” error while working with Go in Linux? This error can be frustrating, but it’s typically due to misconfigurations or outdated Go installations. In this quick guide, we’ll walk you through the steps to resolve this issue.

Uninstall Go

If you suspect that your current Go installation is causing the problem, you can uninstall it before re-installing the latest version. Use the following commands:

  1. Remove the golang-go package:

$ sudo apt-get remove golang-go

2. Remove the golang-go dependencies:

$ sudo apt-get remove — auto-remove golang-go

3. Uninstall the existing Go package:

$ sudo rm -rvf /usr/local/go

Install the New Go Version

Now, let’s install the latest Go version:

  1. Download the Go archive:

$ wget https://dl.google.com/go/go1.21.3.linux-amd64.tar.gz

2. Extract the archive file:

$ sudo tar -xvf go1.21.3.linux-amd64.tar.gz

3. Place the extracted Go directory in the desired location (e.g., /usr/local):

$ sudo mv go /usr/local

Set Up Go Environment Variables

To configure Go properly, you need to set up environment variables:

  1. Set GOROOT to the Go installation location:

$ export GOROOT=/usr/local/go

2. Define GOPATH as your Go workspace directory:

$ export GOPATH=$HOME/go

3. Add Go binary paths to your PATH:

$ export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

4. Reload environment variables:

$ source ~/.profile

Verify Your Go Installation

Finally, verify your Go installation to ensure it’s working correctly:

$ go version

With these steps, you should have successfully resolved the “Package crypto/ecdh is not in GOROOT” error and updated your Go installation to the latest version. Your Go environment should now be correctly configured and ready for your projects. Happy coding!