手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆
浏览模式: 标准 | 列表分类:Linux

Herd的dnsmasq无效的解决。。

 Mac下以前用valet,但由于都是命令行(其实也挺方便)。后面又出了Herd,用起来确实比原来舒服多了,至少使用不同版本的PHP时,就没啥大问题。

 
因为在使用了cf的tunnel试着做了一个穿透。。然后就带了不少妖问题:
1、cf默认过来的时候 就https了。应该是没设置好,然后vite的pnpm dev就不能用了。因为默认是http,然后用 basicSSL进行处理。还要弄本地自签名证书。。。。虽然内外网都可以访问了,但我本地反而卡了。
 
这点操作,还不如我以前用frpc(或者 zerotier/tailscale )。找一台公网映射过来。。然后开着XX,全局模式的时候 就是公网了。优点是开发的时候全本地,而且还能收到公网发过来的信息。
 
---
正因为现在这样,结果导致了一个大问题,那就是我在herd tld xx一个新的域名根时。全部无效。。。所以只能重装了。
MAC下因为没有一个完整的重装程序,所以需要参考官方进行几步:删除程序、删除Library/ApplicationSupport,删除/etc/reslover下的文件,清除defaults。
 
参考:https://herd.laravel.com/docs/1/troubleshooting/uninstalling
 

How to correct `git` reporting `detected dubious ownership in repository` without adding `safe.directory`

在部署项目的时候 。先git clone完项目后,再次使用git pull/git fetch的时候 ,就会报这个错误:

 
```
fatal: detected dubious ownership in repository at '/www/wwwroot/xxxcurrent'
To add an exception for this directory, call:
 
        git config --global --add safe.directory /www/wwwroot/xxx/current
 
```
如果不想动,直接 偷懒的话,就按上面的提示做就行了。找原因的时候 ,搜到了:https://stackoverflow.com/questions/73485958/how-to-correct-git-reporting-detected-dubious-ownership-in-repository-withou,但好象出问题的都是在wsl2下面。。
 
但我看下面的评论里有说:可能是因为拉代码的和实际提交的不是同一个人,所以会出现这个情况(https://github.blog/2022-04-18-highlights-from-git-2-36/#stricter-repository-ownership-checks.)官方也有介绍。
 
之前从来没遇到过,这个倒确实是在于,现在的git项目为了安全,提交的私钥和部署的不一样。所以在这个情况下,就可能会出现这样的问题了。
按提示加好就行了(偷懒的话,就 git config --global --add safe.directory '*' 就完事了)
 
 

Tags: git

tailscale fix: NO_PUBKEY 458CA832957F5868

 在Debian下,按照官方的教程进行gpg和source的添加时,在apt update时会报错 NO_PUBKEY的错误

1、添加GPG
curl -fsSL https://pkgs.tailscale.com/stable/debian/bookworm.noarmor.gpg | sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null
curl -fsSL https://pkgs.tailscale.com/stable/debian/bookworm.tailscale-keyring.list | sudo tee /etc/apt/sources.list.d/tailscale.list
2、UPDATE
sudo apt update
 
大概率情况下是报:
 The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 458CA832957F5868
Reading package lists... Done
W: GPG error: https://pkgs.tailscale.com/stable/debian bookworm InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 458CA832957F5868
 
--
出现这个问题,大部分是因为用tee生成文件的时候 ,权限不对,所以需要执行一下: chmod o+r /usr/share/keyrings/tailscale-archive-keyring.gpg
 
再进行sudo apt update,一切正常!
 

unoconv中文不正常的解决方案

 用unoconv将wod转成pdf的时候,中文乱码,这时候解决方案往往是上传中文字体到系统库并注册即可。

中文字体网上下载的地方一堆堆的,就不再赘叙了。
 主要就是注册 ,因为用到了mkfontscale之类的命令。但这不是系统自带的,需要安装,因为我用debian。于是:
XML/HTML代码
  1. # 使mkfontscale和mkfontdir命令正常运行  
  2. sudo apt-get install ttf-mscorefonts-installer  
  3. # 使fc-cache命令正常运行  
  4. sudo apt-get install fontconfig  
然后在相应的字体目录下运行 
mkfontscale
mkfontdir
fc-cache -fv        //更新字体缓存 
fc-list :lang-zh
然后一切正常
 

expect: spawn id exp3 not open

在尝试使用 envoy  尝试自动部署的时候,遇到了问题,即:如果我要自己创建一个新的域名,那只能上线去执行 lnmp vhost add 的命令。

为什么要使用 lnmp 呢?其实他对我的作用只有一个,多版本的 PHP。因为现在在线上,各种不同版本的 PHP 都在跑,有 PHP5.6 / PHP7.1 / PHP8.1估计后面还会有更多的版本。
 
于是,我就想着用 expect 来处理

sudo /usr/bin/expect<<EOF
spawn lnmp vhost add
expect {
    "Please enter domain" {send "{{$host}}\n";exp_continue}
    "Enter more domain name"  {send "\n";exp_continue}
    "Please enter the directory" {send "\n";exp_continue}
    "Allow Rewrite rule" {send "y\n";exp_continue}
    "Default rewrite" {send "laravel\n";exp_continue}
    "Enable PHP Pathinfo" {send "\n";exp_continue}
    "Allow access log" {send "\n";exp_continue}
    "Enable IPv6" {send "\n";exp_continue}
    "Enter your choice " {send "\n";exp_continue}
    "Add SSL Certificate" {send "\n";exp_continue}
    "Press any key to start" {send "\r"; exp_continue}
}
expect eof
EOF
但执行后一直报错:
[mpass]: expect: spawn id exp3 not open
[mpass]: while executing
[mpass]: "expect eof"
 
仔细查了半天,原来最后一句还用了 exp_continue。。expect 认为还没有执行完。所以。就行报错了。
将最后一个 exp_contiue 删除。再次执行,就正常了
XML/HTML代码
  1. @task('lnmp' ,['on'=>'dev'])  
  2.   
  3. @if($force)  
  4.     sudo rm -rf /usr/local/nginx/conf/vhost/{{$host}}.conf  
  5.     sudo rm -rf /home/wwwroot/{{$host}}  
  6. @endif  
  7. sudo /usr/bin/expect<<EOF  
  8. spawn lnmp vhost add  
  9. expect {  
  10.     "Please enter domain" {send "{{$host}}\n";exp_continue}  
  11.     "Enter more domain name"  {send "\n";exp_continue}  
  12.     "Please enter the directory" {send "\n";exp_continue}  
  13.     "Allow Rewrite rule" {send "y\n";exp_continue}  
  14.     "Default rewrite" {send "laravel\n";exp_continue}  
  15.     "Enable PHP Pathinfo" {send "\n";exp_continue}  
  16.     "Allow access log" {send "\n";exp_continue}  
  17.     "Enable IPv6" {send "\n";exp_continue}  
  18.     "Enter your choice " {send "\n";exp_continue}  
  19.     "Add SSL Certificate" {send "\n";exp_continue}  
  20.     "Press any key to start" {send "\r";}  
  21. }  
  22. expect eof  
  23. EOF  
  24. ls -lah /home/wwwroot/  
  25. @endtask  
这样就 OK 了

Tags: envoy, expect

Records:27412345678910»