avatar
童琦杰
  1. link 创建symlink ln -s path-of-source-file path-of-destination-folder process 显示所有进程信息 ps -ef top Shift+M: 内存占用从大到小排列 查询端口占用进程 lsof -i :30100 杀死进程(等同于Ctrl+C) kill -s 2 process-id 根据进程名获取PID ps -ef | grep name | grep -v grep | awk '{print $2}' systemd 重新加载systemd配置 systemctl daemon-reload 查看systemctl日志 journalctl -u service-name.service 如无内容返回,检查systemd-journald.service是否正常运行 设置systemctl日志最大占用磁盘空间 journalctl --vacuum-size=1024M 查询正在运行的服务 systemctl --type=service --state=running nginx 重新加载nginx配置 /etc/init.d/ng
  2. 创建索引 curl --request PUT 'http://localhost:9200/logging' 创建成功响应 {"acknowledged":true,"shards_acknowledged":true,"index":"logging"} 删除索引 curl --request DELETE 'http://localhost:9200/logging' 删除成功响应 {"acknowledged":true} 设置字段动态映射 curl --request PUT 'http://localhost:9200/logging/_mapping' \ --header 'Content-Type: application/json' \ --data-raw '{ "dynamic": true }' 设置成功响应 {"acknowledged":true} 创建字段 keyword类型字段 curl --request PUT 'http://localhost:9200/logging/_mapping' \ --header 'Content-Type: application/js
  3. 安装文档: https://github.com/loic-sharma/BaGet?tab=readme-ov-file#getting-started 通过nginx反向代理配置授权访问 server { location / { auth_basic "authorization"; auth_basic_user_file /etc/nginx/secrets/baget.htpasswd; proxy_pass http://localhost:9000/; } } 修改nuget配置,设置访问用户名和密码 windows: %appdata%\NuGet\NuGet.Config mac: $HOME/.nuget/NuGet/NuGet.Config //codefile: $HOME/.nuget/NuGet/NuGet.Config <?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <add key="Baget" value="your_baget_url" /> </packageSources
  4. 登录 psql postgres 退出 postgres=# \q 查询用户 postgres=# \du 创建用户postgres postgres=# CREATE USER postgres WITH ENCRYPTED PASSWORD 'password'; 创建数据库testdb postgres=# CREATE DATABASE "testdb"; 授予用户权限 postgres=# GRANT ALL PRIVILEGES ON DATABASE "testdb" TO postgres;
  5. 创建Solution文件,文件名为demo-solution.sln dotnet new sln --name demo-solution 创建src目录 mkdir src 创建Console应用项目作为App入口 dotnet new console --output src/DemoSolution.WebApp --framework net6.0 --use-program-main 将Console应用添加到Solution中 dotnet sln demo-solution.sln add src/DemoSolution.WebApp 添加依赖包 dotnet add src/DemoSolution.WebApp package package-name --version 1.0.0 配置文件夹输出 <Project Sdk="Microsoft.NET.Sdk"> <ItemGroup> <None Include="Configuration\**\*;"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <
  6. 使用RVM管理多版本Ruby 安装RVM: GPG keys gpg2 --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB \curl -sSL https://get.rvm.io | bash -s stable //codefile: $Home/.zshrc export PATH=$PATH:$HOME/.rvm/bin 使用RVM安装Ruby: rvm install [Version] 使用homebrew安装Ruby brew install ruby rvm mount [/opt/homebrew/Cellar/ruby/3.3.0] 使用RVM切换不同版本Ruby 查询可用版本 rvm list 使用指定版本Ruby rvm use [Version]
  7. 安装 sudo dpkg -i gitlab-ce_9.2.5-ce.0_amd64.deb sudo gitlab-ctl reconfigure 如需重启服务 sudo gitlab-ctl restart 备份 sudo gitlab-rake gitlab:backup:create 默认备份文件位置: /var/opt/gitlab/backups 备份配置文件及密匙: /etc/gitlab/gitlab.rb、/etc/gitlab/gitlab-secrets.json 恢复 sudo cp gitlab.rb /etc/gitlab/gitlab.rb sudo cp gitlab-secrets.json /etc/gitlab/gitlab-secrets.json sudo cp 1622265010_2021_05_29_9.2.5_gitlab_backup.tar /var/opt/gitlab/backups/ sudo gitlab-ctl stop unicorn sudo gitlab-ctl stop sidekiq sudo gitlab-ctl status sud
  8. Ubuntu下安装配置Trojan服务 sudo apt-get install trojan 配置文件路径: /etc/trojan/config.json local_port: 服务端监听端口,默认443 password: 密码设置 ssl.cert: SSL证书 ssl.key: SSL证书私钥 //codefile:/etc/trojan/config.json { "run_type": "server", "local_addr": "0.0.0.0", "local_port": 443, "remote_addr": "127.0.0.1", "remote_port": 80, "password": [ "password" ], "log_level": 1, "ssl": { "cert":"/path/to/cert", "key": "/path/to/key", "key_password": "", "cipher": "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-
  9. 下载M3U8视频并存为MP4格式 ffmpeg -i [https://host/path/to/xxx.m3u8] [output.mp4] 将MP3格式转化为M3U8 ffmpeg -i [input.mp3] -c:a libmp3lame -b:a 128k -map 0:0 -f segment -segment_time 10 -segment_list [output.m3u8] -segment_format mpegts [%03d.ts] 将MP4格式转化为M3U8 ffmpeg -i [input.mp4] -f segment -segment_time 10 -segment_format mpegts -segment_list [output.m3u8] -c copy -bsf:v h264_mp4toannexb -map 0 [%04d.ts] 转成H264编码 ffmpeg -i [input.mp4] -c:v libx264 -preset slow -crf 22 -c:a copy [output.mp4]
  10. /element-name 获取元素名为element-name的根元素。理论上一个合法的XML文件只会有一个根元素。 <!-- this element matched --> <element-name> <parent> <element-name></element-name> </parent> </element-name> //element-name 获取当前元素下所有元素名为element-name的元素。 <root> <parent> <!-- this element matched --> <element-name> <!-- this element matched --> <element-name></element-name> </element-name> <!-- this element matched --> <element-name></element-name> </parent> </root> . 获取当前元素。 .. 获取当前元素的父元素。 * 获取当前元素下所有元素。 //parent/element-name[1] 获取第一个元素名为element-
© 2015-2022 tongqijie.com 版权所有沪ICP备17000682号