Reference: https://mp.weixin.qq.com/s/34lQ4vxtc5KBUIADFfz3Ow
https://jackyu.cn/tech/push-lets-encrypt-cert-to-aliyun-cdn/
https://www.dothedev.com/blog/django-admin-list_filter/
I tried to retrieve data using the BigIntegerField ID in Django, but the returned queryset was empty.
After trying several times, I found that all of the IDs became 6977919360329322000, …
家里一个连接信息板的小显示器是某宝上买的电子垃圾, 经常重启树莓派后显示“无信号”, 像碰运气一样拔插电源成功.
今天实在受不了, 网上查了下,
vim /boot/config.txt 里把 config_hdmi_boost = 前面的注释去掉, 重启, 搞定.
上一行的注释里写着门板大一样的一行说明: “uncomment to increase signal to HDMI, if you have interference, blanking, or no display”.
apt autoremove --purge
能放出不少个G.
打印Sql语句之, print(queryset.query)
发现Group by 条件不只是把category列进去了, 还把另外一个字段A也列了进去, 原来是是模型里用了字段A默认排序, 给自动加到这来了.
清空默认排序, 改成如下语句即可:
queryset = MyModel.objects.all().values('category').order_by().annotate(total_amount=Sum('amount'))看来要开始教Python了(主要是我对Scratch没兴趣), 另外弄一张卡把他的Raspberry Pi 400装个RetroPie弄成游戏机激发一下?
https://blog.cnscud.com/docker/2021/11/17/docker-buildx.html
关键命令:
docker buildx version docker buildx create --name mybuilder(or whatever name) docker buildx use mybuilder(or whatever name)docker buildx ls docker buildx build --platform linux/amd64,linux/arm64 -t dockerhub.domain.com/laonanblog:1.0 . …
打算开发一个小小的物联网JS SDK, 想想现在都是所谓的“现代JS框架当道", 琢磨着做成npm包
我艹添加一个依赖, node_modules里多出几十个文件夹...
docker exec -i registry_name sh -c "registry garbage-collect /etc/docker/registry/config.yml -m"
注意: 会把所有镜像都删掉...如果不是实在硬盘没空间了, 别这么手残.
ref: https://blog.csdn.net/qq_36522728/article/details/108485470
error: gpg failed to sign the data
pkill gpg-agent $ gpg-agent --daemon $ git commit ...参考: https://stackoverflow.com/questions/39494631/gpg-failed-to-sign-the-data-fatal-failed-to-write-commit-object-git-2-10-0
清华的pip镜像貌似要比阿里云的同步得及时一点.
https://mirrors.tuna.tsinghua.edu.cn/help/pypi/
开发模式安装 pip install -e ./ # 指向有setup.py那个目录
打包上传: https://packaging.python.org/en/latest/tutorials/packaging-projects/ 直接去官网看文档, 比在中文互联网里查那些只言片语的教程节约时间.
发现一个有趣的把整型id转成唯一字符串的实现,
有趣的不是这种实现, 而是他们居然把各种语言(有些非常冷门的)的实现都拉到一块来了 https://hashids.org/
step 1.
ssh-keygenstep 2.
ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.1.100step 3.
ssh root@192.168.1.100远程执行命令
ssh root@192.168.1.100 "df -h"多条
ssh root@192.168.1.100 "pwd; cat hello.txt"Failed to Setup IP tables: Unable to enable SKIP DNAT rule: (iptables failed: iptables --wait -t nat -I DOCKER -i br-ad68cff97c8e -j RETURN: iptables: No chain/target/match by that name.
systemctl …
新版的树莓派OS ntp服务各种报错, 不知道为什么.
改装rdate
sudo apt-get install rdate #树莓派第一次使用需要安装rdate
sudo /usr/bin/rdate -s time.nist.gov #/usr/bin/ 是命令默认所在目录;-s 表示将获取的时间保存到本地;time.nist.gov 是美国标准技术院的服务器
crontab -e #添加到定时执行
#在打开的文件中,添加如下语句
0 12,22 * * * sudo /usr/bin/rdate -s time.nist.gov …
试了网上N多方法都不行,
https://github.com/RaspAP/raspap-webgui 这个很好用也傻瓜化, 但是我不想要这么重, 又PHP又啥的一大堆, 我只要连上我的一个Web应用就好了.
hostapd的文章也看了N多, 一次都配置不成功.
最后参考一个用热点来当诱骗器搞坏事文章里弄成功了, 不用hostapd, 直接通过wpa_supplicant 来实现.
怎么用树莓派制作一个流氓热点: https://jerryryle.github.io/rogueportal/
跟文中的步骤不一样的是, 我不用他的web应用, 略过nginx那一节, 保留了ssh通道, 并且给热点设置了密码.
----------------- 防止链接失效, 记录下关键步骤 ------------------
安装必要的包:
sudo apt install dnsmasq iptables-persistent macchanger …