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

CSS如何给文字加上文字一半高度的背景色

 一般来说象这种效果实现还是比较有意思的

在文字下层加上一定高度的背景色,半透明,而且模糊。。。
 
话不多说,上代码:
CSS代码
  1. .text_bg {  
  2.   displayinline-block;  
  3.   positionrelative;  
  4.   z-index: 1;  
  5. }  
  6.   
  7. .text_bg::after {  
  8.   content'';  
  9.   positionabsolute;  
  10.   bottom: 0;  
  11.   left: 0;  
  12.   width: 100%;  
  13.   height: 40%;  
  14.   background-color#B6D16F;  
  15.   opacity: .7;  
  16.   z-index: -1;  
  17.   filter: blur(1px); /* 可选:模糊效果 */  
  18. }  
上述代码中最重要的其实就是那两个z-index。否则你会发现背景色其实压在了文字上方。
其他的基本上都是基本操作,只是额外用了一个:after的伪类。在当前这个例子里。用before和after的最终显示效果其实是一样的
 
 
 

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
然后一切正常
 

有时候你不得不说,CF还是挺不错的

 之前还在说用了CF后,连垃圾评论都没了。

结果,一通电话过来。说如果你再用CF,把IP指在国外,就直接取消备案了。然而CF国内版又用不起,也看了一下怎么个国内加速,还是有点繁琐,所以还是先暂时禁用吧。
其实用CF做代理的时候 ,还能享受直接https,现在我还得自己再配https。真烦人
而且,又开始收到垃圾评论了。
 
忍忍吧

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

10月回顾一下

之前本来有准备写内容,但不知道 怎么回事编辑器加载不出来直接报错,于是就放弃了。

10月没做什么事情,但大致流水账可以记一下:
1、Flutter 又重捡起来了,后面重心可能会在这一块 (安装个开发工具折腾了1天,主要是SDK更新,一更就死)
2、小程序 还在写,但下一波估计不用 UniAPP,可能会考虑Taro。
3、升级了操作系统到最新的,目前 没问题
4、又买了两台无忧。好象Zerotier会影响网速?准备重建一下planet。估计又要大折腾
 
新项目还是要上,老本没地儿吃了
 
Records:303912345678910»