git-hexo
Hexo 作为基于 Node.js 的静态博客框架,其性能优化有一些特定的方法。以下是针对 Hexo 博客加载速度慢的常见原因及优化方案: 一、Hexo 自身配置优化 启用静态资源压缩Hexo 默认生成的文件未压缩,可通过插件优化: 安装插件: 12npm install hexo-neat --save # 压缩 HTML/CSS/JSnpm install hexo-image-slim --save # 图片压缩 配置 _config.yml: 12345678910111213141516171819# hexo-neat 配置neat_enable: trueneat_html: enable: true exclude:neat_css: enable: true exclude: - '*.min.css'neat_js: enable: true mangle: true output: compress: exclude: -...
vite-plus
vite常用插件总结rollup-plugin-remove-others-console这个插件是我自己开发的,在生产环境中可以根据 git 作者信息移除非自己的 console 语句,无任何配置负担,优化开发体验~安装 1npm install rollup-plugin-remove-others-console --save-dev 配置 123456import { defineConfig } from 'vite';import removeConsole from 'rollup-plugin-remove-others-console';export default defineConfig({ plugins: [removeConsole()],}); vite-tsconfig-paths安装 1npm install vite-tsconfig-paths --save-dev 配置 123456import { defineConfig } from...
go语言代码如何传入npm包
1. 创建go项目使用go mod tidy 初始化项目 1go mod tidy 2. 创建package.json1npm init 3.在package.json写命令1234"scripts": { "start": "go run main.go", "build": "go build -o index.js -ldflags=\"-s -w\""} 4. 上传npm包1npm publish 5. 使用npm包1npm install go-npm-xyj 6. 使用npm包12const goNpmXyj = require('go-npm-xyj');goNpmXyj.main(); “publishConfig”: { “registry”: “https://registry.npmjs.org“}
ffmpeg的一些简单用法
如何在视频中提取音频 1ffmpeg -i input_video.mp4 -vn -acodec libmp3lame -q:a 2 output_audio.mp3 -i 输入文件 -vn 不处理视频 -acodec libmp3lame 使用libmp3lame编码器 -q:a 2 设置音频质量为2 output_audio.mp3 输出文件 如何给一段音频添加背景音乐 1. 将背景音乐音量设置为0.51ffmpeg -i background_audio.mp3 -af "volume=0.5" background_audio_quiet.mp3 background_audio.mp3 背景音乐 background_audio_quiet.mp3 背景音乐音量设置为0.5 2. 将背景音乐和音频混合1ffmpeg -i input_audio.mp3 -i background_audio_quiet.mp3 -filter_complex amix=inputs=2:duration=longest ...
使用vite配置rollup
1.安装依赖确保安装Vite 1npm install vite --save-dev 安装和Rollup相关的依赖 1npm install @rollup/plugin-commonjs @rollup/plugin-node-resolve rollup --save-dev plugin-commonjs用于处理CommonJS 模块 plugin-node-resolve用于解析模块路径 2.创建 Rollup 配置文件在根目录创建rollup.config.js文件,内容如下: 123456789101112131415import { defineConfig } from 'rollup';import resolve from '@rollup/plugin-node-resolve';import commonjs from '@rollup/plugin-commonjs';export default defineConfig({ input:...
nginx配置https访问
https证书怎么获取,教程很多,就不在这里说了,主要记录一下如何开启nginx的https服务,以及配置http转发https. 第一步,打开nginx配置文件nginx.conf.打开https服务1234567891011121314151617#server {# listen 443 ssl;# server_name localhost;# ssl_certificate cert.pem;# ssl_certificate_key cert.key;# ssl_session_cache shared:SSL:1m;# ssl_session_timeout 5m;# ssl_ciphers HIGH:!aNULL:!MD5;# ssl_prefer_server_ciphers on;# location / {# root html;# index index.html index.htm;# ...
如何实现软路由功能
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455#!/bin/bash# Script to set up network sharing with static IP# Define network interfaces and IP addressesLAN_INTERFACE="eth0"WIFI_INTERFACE="wlan0"LAN_IP="192.168.0.1"DHCP_RANGE="192.168.0.10,192.168.0.50,12h"# Enable IP forwardingsysctl net.ipv4.ip_forward=1# Set up iptables rulesiptables -A POSTROUTING -t nat -o $WIFI_INTERFACE -j MASQUERADEiptables -A...
反向ssh
什么是ssh?SSH 为 Secure Shell 的缩写,SSH 为建立在应用层基础上的安全协议。SSH 是较可靠,专为远程登录会话和其他网络服务提供安全性的协议。 什么是ssh反向连接?反向连接是指主机A(受控端)主动连接主机B(控制端),在主机A和主机B之间建立一个远程连接,通过这个连接主机B可以主动的向主机A发送一些请求。 应用场景 平时我们登录远程服务器,一般使用ssh登录远程服务器 现在我们想通过远程服务器反向操作登录本地PC,但由于一般本地PC没有公网IP,导致远程服务器使用正常ssh命令无法登录PC,这个时候就需要使用ssh反向连接功能。 操作步骤 使用ps -ef | grep sshd 确定主机A,和主机B都运行了sshd。如果没有运行sshd,则需要执行sudo apt-get install openssh-server 安装openssh-server 主机A执行命令与服务器建立连接:ssh -CqTfnN -R :11111:localhost:22...
docker run的命令讲解
当我们运行一个docker run 的时候,里面有许多命令,如果需要加卷来映射本地路径需要怎么做,下面图解一条相对完整的docker命令: 1docker run -d --name webl -p 80:80 -v /usr/share/nginx/html nginx /usr/share/nginx/html下产生新的目录html 运行的端口为80
css动画的属性及基础用法
css3出现以后,css的动画就使用的特别广泛,下面是我在使用css3动画的一些理解。 css3动画的基础用法123456789@keyframes 动画名称{ 动画的操作属性}使用动画的标签{ animation-name:动画名称;/*需要执行的动画的名字*/ animation-duration: 3s;/*所需要的时间*/ animation-iteration-count: infinite;/* 执行次数*/ ...













