CentOS 使用 Remi 源安装 PHP8 时将配置放入 /etc/ 而不是 /opt/ 关键点:不要直接 yum install php81-php-* 这样会安装到 /opt 目录,而应该启用 php81 后,依旧使用 yum install php-* 来安装(别加 php8 前缀)。 # CentOS 7 yum install epel-release yum-utils yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm #或 yum install https://mirrors.tuna.tsinghua.edu.cn/remi/enterprise/remi-rel...
2012/07/9 浏览数(9,936)
<template> <div id="app"> <router-view /> </div> </template> <script> export default { data() { return { waterMarkConfig: { width: 340, height: 240, content: '这里是水印内容,可以是 git commit id 或 process.env.NODE_ENV', font: '14px PingFang SC, sans-serif', ...
2022/09/26 浏览数(31)
yum install ImageMagick 批量压缩图片大小 # 将宽度大于 800 的图片处理成宽为 800 的图片 find ./ -type f -regextype 'posix-egrep' -iregex '.*\.(jpg|png|gif)' | while read line do echo $line convert -resize '800>' $line $line done # 多行转成一行: # bash: find ./ -type f -regextype 'posix-egrep' -iregex '.*\.(jpg|png|gif)'...
2022/08/10 浏览数(61)
启用防火墙 systemctl start firewalld firewall-cmd --add-service=http --permanent firewall-cmd --add-service=https --permanent firewall-cmd --remove-port=3306/tcp --permanent firewall-cmd --reload 启用交换空间 swap 分区 dd if=/dev/zero of=/swapfile bs=1024k count=8192 mkswap /swapfile swapon /swapfile echo "/swapfile swap swap defaults 0 0" >> /etc/fstab 软件源 ...
2022/07/11 浏览数(80)
安装Download URL Rewrite Module 2.1 /web.config <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="http2https" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input=&q...
2022/06/16 浏览数(100)
不推荐使用本文的方法,建议使用 props 和 emit 方法来自:stackoverflow.com/questions/55316490,在用这个方法前可以先试试 this.$refs[‘子组件’].doSth(),比下文的方法简单。 子组件 export default { methods: { doSth() { console.log('子组件的 doSth 方法'); }, }, mounted() { let self = this; self.$emit('callback', { doSth: () =&...
2022/05/24 浏览数(101)
# app/Providers/AppServiceProvider.php public function boot() { DB::listen(function ($query) { $location = collect(debug_backtrace())->filter(function ($trace) { return !str_contains($trace['file'], 'vendor/'); })->first(); // grab the first element of non vendor/ calls $bindings = implode(", ", $query->bindings); // format t...
2022/05/7 浏览数(98)
生成版本号配置的文件 hooks.js const packageInfo = require('./package.json'); const fs = require('fs'); const gitHEAD = fs.readFileSync('.git/HEAD', 'utf-8').trim(); const ref = gitHEAD.split(': ')[1]; let version = packageInfo.version; let commitId = ref ? fs.readFileSync('.git/' + ref, 'utf-8').trim() : gitHEAD; let date = (new Date()).toISOString(); let result = ` module.exports = {...
2022/04/19 浏览数(136)
驱动来自 blackPantherOS/rtl8192fu(代码被清了,历史记录里还有,拉下来后 git reset –hard 即可) 下载 安装后需要重启 开机后如果没有出现 WiFi 设备而是多了一个 CD-ROM 的话,执行: usb_modeswitch -v 0bda -p a192 -KW # usb_modeswitch 不会开机自动运行可以参考这个: # mv /lib/udev/rules.d/40-usb_modeswitch.rules /lib/udev/rules.d/61-usb_modeswitch.rules # sudo udevadm control --reload-rule...
2022/04/13 浏览数(130)
.env APP_VERSION=v2.0.1 beta app/Http/Kernel.php protected $middleware = [ // ... \App\Http\Middleware\Version::class, // 在 http header 中返回当前接口的 Git 版本 ]; app/Http/Middleware/Version.php <?php namespace App\Http\Middleware; use Closure; use Illuminate\Http\Request; class Version { /** * 在 header 中添加项目 Git 库的 commit id * * @param...
2022/04/12 浏览数(129)
function dodash(callsign = '') { var sign = callsign.match(/[a-z0-9]+/)[0].toUpperCase(); var hash = 0x73e2; var i = 0; while (i < sign.length) { var f = sign[i].charCodeAt(); hash ^= f<<8; if (sign[i + 1]) { var s = sign[i+1].charCodeAt(); hash ^= s; } i += 2; } return Math.abs(hash); } var code = dodash('BZ0ZZZ'); co...
2021/03/29 浏览数(158)
const packageInfo = require('./package.json'); const fs = require('fs'); const gitHEAD = fs.readFileSync('.git/HEAD', 'utf-8').trim(); const ref = gitHEAD.split(': ')[1]; let version = packageInfo.version; let commitId = ''; if (ref) { commitId = fs.readFileSync('.git/' + ref, 'utf-8').trim(); } else { commitId = gitHEAD; } console.log(version, commitId); fs.readFile('./...
2020/12/28 浏览数(115)
介绍 laravel-nestedset(Nested Set Model) 安装 composer require kalnoy/nestedset 用法 // database/migrations/2020_08_10_155445_create_category_table.php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateCategoryTable extends Migration { public function up() { Schema::create('categor...
2020/12/28 浏览数(235)
点击返回顶部
  1. 留言
  2. 联系方式