BuyVM 挂载 Block Storage(数据盘)

查看硬盘列表: ls /dev/disk/by-id/ 返回硬盘列表 ata-QEMU_DVD-ROM_QM00004 scsi-0BUYVM_SLAB_VOLUME-8888 格式化硬盘: mkfs.ext4 -F /dev/disk/by-id/scsi-0BUYVM_SLAB_VOLUME-8888 挂载硬盘: mount -o discard,defaults /dev/disk/by-id/scsi-0BUYVM_SLAB_VOLUME-8888 /home 开机自动挂载: echo '/dev/disk/by-id/scsi-0BUYVM_SLAB_VOLUME-8888 /home ext4 defaults,nofail,discard 0 0' | tee -a /etc/fstab   红色是Block Storage(数据盘)名称,  蓝色是挂载到的目录,我是挂载到了/home 你可以根据自己需求修改.  

flutter 报错 Could not resolve io.flutter:flutter_embedding_release

 我是升级flutter后,所有项目都报错,先贴解决办法: flutter\packages\flutter_tools\gradle 目录下 aar_init_script.gradle resolve_dependencies.gradle flutter.gradle 以上三个文件中将 http://download.flutter.io 替换为: https://storage.googleapis.com/download.flutter.io   报错如下: flutter build apk The plugin `flutter_forbidshot` is built using an older version of the Android plugin API which assumes that it's running in a full-Flutter environment. It may have undefined behaviors when Flutter is integrated into an e...

flask Jinja2 template 模板 ' 编码问题

flask Jinja2 template 模板 &#39 编码问题 解决办法:  {{ errors|safe }} 或者 {{ errors | tojson | safe }} 推荐第一条

Cython编译 TypeError: func() takes no keyword arguments 深坑

 今天使用Flask写了个接口,本地测试正常,仿到服务器上就报错,而且是特定函数报错.TypeError: func() takes no keyword arguments 一直以为是关键词冲突了. 后来调试半天,最后定位到是cython的问题 下面的方法无效 setup ( name = 'xxxx', ext_modules = cythonize(["src/*.py"], compiler_directives={"always_allow_keywords": True}) ) 最终解决办法,给函数的参数一个默认值即可. # 原来 def func(a,b): pass # 修改后 def func(a=None, b=None): pass

layui 表格 时间戳转换 报错NaN-NaN-NaN NaN:NaN:NaN

 可能是时间戳 秒 和 毫秒之间 计算出现问题. {{layui.util.toDateString(d.site_up_time)}} 修改成: {{layui.util.toDateString(d.site_up_time*1000)}} 字段完整实例 ,{field:'site_up_time', title: '更新时间', templet : "<div>{{layui.util.toDateString(d.site_up_time*1000)}}</div>"}

layui表格(Table)下添加可更新拉选择框select

 添加CSS 防止下拉框被遮挡 <style> /* 防止下拉框下拉值被遮盖*/ .layui-table-cell { overflow: visible; } .layui-table-box { overflow: visible; } .layui-table-body { overflow: visible; } /* 调整高度 */ td .layui-form-select{ margin-top: -10px; margin-left: -15px; margin-right: -15px; } </style> 表, <table class="layui-hide" id="data" lay-filter="data"></table> 自定义模板: <script type="text/html" id="rule_type_Tpl"> &l...

layui表格(Table)动态添加行

直接上代码吧.在需要动态添加的事件里放如下代码 var tabledata = table.cache["data"]; //获取现有数据 tabledata.push({ "rule_type": "2" ,"rule_val": "" ,"time_type": "3" ,"time_val": "4" ,"expires_val": "7" ,"expires_type": "2" })//添加数据,  字段名对应值.  不要初始值的话 留空即可. #下面表格需要重载一下 才会刷新显示. table.reload("data", { data: tabledata, })

flask模板使用layui前端框架语法冲突

 大致报错如下吧. {{ 很容易冲突.  File "D:\soft\Python27\lib\site-packages\jinja2\environment.py", line 804, in _load_template template = self.loader.load(self, name, globals) File "D:\soft\Python27\lib\site-packages\jinja2\loaders.py", line 125, in load code = environment.compile(source, name, filename) File "D:\soft\Python27\lib\site-packages\jinja2\environment.py", line 591, in compile self.handle_exception(exc_info, source_hint=source_hint) File "D:\sof...

Let’s Encrypt 报错 ERR_SSL_PROTOCOL_ERROR

非常奇怪的一个问题,另外一台vps 正常试用的Let's Encrypt 免费ssl证书,挪到另外一台机器上就报错 ERR_SSL_PROTOCOL_ERROR listen 443; 修改为: listen 443 ssl http2; 即可正常,

debian phantomjs error while loading shared libraries: libfontconfig.so.1: cannot open shared

 debian error while loading shared libraries: libfontconfig.so.1: cannot open shared 解决办法 apt-get install libfontconfig1