自动设置token
为了简化操作,有时候需要postman
在请求接口后自动设置token
,方法如下
打开postman
,在一个请求下面点击Tests
,输入以下代码
1 | var responseData = responseBody; |
原文链接: http://www.jiliuke.com/page/2/index.html
版权声明: 转载请注明出处.
为了简化操作,有时候需要postman
在请求接口后自动设置token
,方法如下
打开postman
,在一个请求下面点击Tests
,输入以下代码
1 | var responseData = responseBody; |
原文链接: http://www.jiliuke.com/page/2/index.html
版权声明: 转载请注明出处.
在debian查看SSD寿命
Wear_Leveling_Count
和SSD_Life_Left
1 | sudo smartctl -a /dev/sdb |
smartctl
展示不同wear leveling count
是 磨损均衡计数(WLC)的意思,当前值代表的剩余耐力,以百分比表示,意味着它从100开始减少。
SSD_Life_Left
代表着SSD的生命周期还剩下多少
Percentage Used Endurance Indicator
1 | sudo smartctl -l devstat /dev/sdb |
Percentage Used Endurance Indicator
,单位是百分比,新的是0%
原文链接: http://www.jiliuke.com/page/2/index.html
版权声明: 转载请注明出处.
实际应用中会出现需要减少导出的备份体积,然后在本地导入再开发,可以大幅缩短导入等待时间,方法如下
1 | sed '/INSERT INTO `tablelog1`/d' xxxx.sql | sed '/INSERT INTO `tablelog2`/d' | sed '/INSERT INTO `tablelog3`/d' | sed '/INSERT INTO `tablelog4`/d' | sed '/INSERT INTO `tablelog5`/d' > reduced.sql |
原文链接: http://www.jiliuke.com/page/2/index.html
版权声明: 转载请注明出处.
一些有用mysql tips
1 | #统计所有数据库从大到小排列 |
原文链接: http://www.jiliuke.com/page/2/index.html
版权声明: 转载请注明出处.
magento2 在运行的时候会不断在项目中var/log中记录日志,时间久后就会产生巨大的log日志,所以有必要每天切割日志保存,利于日志分析和减少磁盘开销。
1.首先确定当前的项目名称(magento2)和项目路径(/var/www/magento2),项目执行用户www
2.sudo vim /etc/logrotate.d/magento2
3.拷贝以下内容到/etc/logrotate.d/magento2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 {
daily
missingok
rotate 365
maxage 365
compress
copytruncate
prerotate
# logrotate fails if the .1 file already exists, which only
# ever happens if the last copytruncate failed, or during the
# first run after delaycompress is disabled. When this script
# runs, older logs have already been rotated, so it's safe to
# rotate an unexpected log.1 file into log.2.gz. Sometimes the
# argument already has a .1 suffix, so strip it.
[ -e "${1%.1}.1" ] && sudo -u -g bash -c "gzip --best < \"${1%.1}.1\" > \"${1%.1}.2.gz\"" && rm "${1%.1}.1"
true
endscript
notifempty
create 0640 www www
su www www
lastaction
chown www:www -R /var/www/magento2/var/log/*.log
# fix files with broken permissions
chown www:www -R /var/www/magento2/var/log/*.log.[0-9]*.gz 2>/dev/null || true
endscript
}
4.测试
1 | 强制执行 |
原文链接: http://www.jiliuke.com/page/2/index.html
版权声明: 转载请注明出处.
1 | curl: (60) SSL certificate problem: certificate has expired |
由于服务器curl证书问题导致无法正确访问https站点
1 | #红帽系系统 |
原文链接: http://www.jiliuke.com/page/2/index.html
版权声明: 转载请注明出处.
首先,到nvdia官网下载对应显卡的linux驱动
https://www.nvidia.com/Download/index.aspx?lang=en-us
一般对应的下载文件会在~/Downloads
下,将它重新命令nvidia.sh便于后面引用。
接下来请按照以下步骤执行。
卸载nvidia
开源驱动和闭源驱动
1 | sudo apt autoremove nvidia-* |
禁止nouveau
驱动
1 | sudo dedit /etc/modprobe.d/blacklist.conf |
执行以上代码打开blacklist.conf
文件后复制以下内容并保存关闭
1 | blacklist nouveau |
给blacklist.conf
添加执行权限
1 | sudo chmod +x /etc/modprobe.d/blacklist.conf |
blacklist nouveau是禁用nouveau第三方驱动,之后不需要改回来,由于nouveau是构建在内核中的,所以要执行下面代码集成到内核中
1 | sudo update-initramfs -u |
好了,到现在为止,前期工作已经完成。
重启
可以运行以下命令
1 | reboot |
重启后查看nouveau
有没有运行,没有输出则代表禁用生效
1 | lsmod | grep nouveau |
同时按住ctrl+alt+F2
键,进入tty2
。输入当前用户名点击enter
然后再输入密码点击enter
进入。
导航到Downloads
目录,为nvidia.sh
添加执行权限。
1 | cd ~/Downloads && chmod +x nvidia.sh |
关闭图形界面
1 | sudo systemctl stop lightdm |
安装显卡驱动
1 | sudo sh nvidia.sh |
请注意接下来的步骤,一定要完成相同,否则将造成无法登陆图形界面
注意英文字母中出现大写的“DKMS”选择Yes
注意英文中出现“32-bit”选择Yes
注意英文中出现“nvidia-xconfig”一定要选择No
输入reboot
重启电脑,安装完成
参考视频
原文链接: http://www.jiliuke.com/page/2/index.html
版权声明: 转载请注明出处.
1 | !/bin/bash |
原文链接: http://www.jiliuke.com/page/2/index.html
版权声明: 转载请注明出处.
1 | //file vendor/magento/framework/HTTP/Adapter/Curl.php after line 26 |
1 | //file vendor/magento/zendframework1/library/Zend/Http/Client.php after line 1089 |
原文链接: http://www.jiliuke.com/page/2/index.html
版权声明: 转载请注明出处.
打包后安装出现双图标
desktop中添加StartupWMClass=xxx
xxx通过终端中执行xprop WM_CLASS点击应用程序获取。
原文链接: http://www.jiliuke.com/page/2/index.html
版权声明: 转载请注明出处.