忘记root密码如何在grub界面修改
修改系统root密码此方法适用于忘记linux系统root密码时,进入到grub界面修改root密码
进入grub界面
选择当前操作系统,按下e键
找到linux开头的行
1linux /boot/vmlinuz-linux root-UUID=d474f2-e6a2-4cc3-9899-aa98af13 rw quiet
在后面添加init=/bin/bash后变成
1linux /boot/vmlinuz-linux root-UUID=d474f2-e6a2-4cc3-9899-aa98af13 rw quiet init=/bin/bash
按下ctrl+x
进入单用户模式
挂载文件系统
1mount -n -o remount,rw /
修改密码
1passwd
启动到正常模式
1exec /sbin/init
如何使用cloudflare zero trust
Cloudflare Zero Trust利用内网穿透,暴露本地服务到对应域名。
相比于frp,不需要自备服务器,使用cloudflare免费服务即可
安装
repo安装
1apt install cloudflare
package安装
https://github.com/cloudflare/cloudflared/releases
去官网下载对应版本
1dpkg -i cloudflared.deb
token官网dashboard页面,点击Zero Trust
Access页面下的Tunnels
就可以看到自己的token
1sudo cloudflared service install your_token
一个主机帐户token只需要安装一个token,一个token可以创建多个tunnel为多个端口提供服务
一个cloudflare帐户只有一个token
tunnel每个主机安装好token后,可以自己创建多个tunnel,这些tunnel就是为要暴露的端口提供服务的
点击create tunnel ==> public hostname
...
如何自建邮件服务器
创建邮件服务器用最简单的方式创建邮件服务器
以centos8为例子
修改域名服务器记录值
登录至域名管理界面
修改MX记录值,将记录值设置为mail server IP
也可以设置为该服务器的domain name
A记录
A记录设置www.jumhorn.com和jumhorn.com同时能解析到,要添加以下两条A记录
12@ 记录值 your IP\* 记录值 your IP
TXT记录
必须设置该记录,来防止SPF反垃圾邮件过滤
1v=spf1 ip4:101.35.162.40 -all
使用nslookup查看记录修改1234567891011# 查看A记录,这两条是不一样的nslookup www.jumhorn.comnslookup jumhorn.com# 查看TXTnslookup -q=txt jumhorn.com# 查看MXnslookup -q=mx jumhorn.com# 查看NSnslookup -q=ns jumhorn.com# 反向DNS查询nslookup ip
修改主机sendmail.mc配置
安装工具
1234 ...
云服务之数据库推荐
云数据库MySQL
planetscale
需要加密连接,直接使用网页端连接,选择branch目前还点不进去 只能自己修改url
https://app.planetscale.com/jumhorn/daily/main/console
SQLPub
免费500M空间
Free MySQL Hosting
5M免费空间,支持phpMyAdmin
postgreSQL
ElephantSQL
20M免费空间
Redis
Redis
30M免费空间
MongoDB
MongoDB
512MB to 5GB of storage
在dockerhub上创建debian docker,备份自己的主机
debian docker image使用了9年半的笔记本坏了,笔记本一直用的debian系统,现在又不想买笔记本,又离不开debian系统
所以在此制作docker镜像并推送到dockerhub,来纪念我使用过的debian(bullseye)
software
gnome/xfce/kde
vncserver
novnc
Dockerfile以下是ChatGPT的例子
1234567891011121314# 基础镜像FROM debian:bullseye-slim# 安装必要的软件包RUN apt-get update && apt-get install -y \ x11vnc \ websockify \ novnc# 配置novnc服务的端口号EXPOSE 8080# 运行novnc服务CMD ["websockify", "--web=/usr/share/novnc/", "8080", "--", "x11vnc&qu ...
如何下载网页上的视频
用浏览器直接下载视频和音频学会这项技能的学习资料不是javascript,不是chrome debug
而是http协议
https://developer.mozilla.org/zh-CN/docs/Web/HTTP
下载音频使用bing translator为例子
https://cn.bing.com/translator
F12打开浏览器调试界面,打开network标签页,并清空该标签页
firefox直接类型选择media,chrome需要all
输入文本,点击试听,浏览器会播放一段音频
找到对应语音的post请求
目前是v1那个请求,右键copy as cURL
terminal中复制刚才的命令并加上–output tts.mp3
完成下载即可
浏览器直接播放该音频
在刚下载好的音频目录,启动http服务器1python3 -m http.server
浏览器console标签页12audio = new Audio("http://localhost:8000/tts.mp3");audio.play();
下载视频目前可行的通用方法是 ...
如何用github action完成定时任务
github action使用github action所创建的虚拟机
创建github action在项目上方Actions点击后,创建一个workflow即可
本质上就是在项目中建立.github/workflow/*.yaml文件
建立虚拟机shell
Hello World
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Quick StartCreate a new post1$ hexo new "My New Post"
More info: Writing
Run server1$ hexo server
More info: Server
Generate static files1$ hexo generate
More info: Generating
Deploy to remote sites1$ hexo deploy
More info: Deployment
如何使用不同方式发送http请求
http请求发送http请求,通过命令行或者代码方法
> https://curlconverter.com
cURL123curl -H "Content-Type:text/html" www.google.com # headcurl www.google.com?cmd="ls -al" # getcurl --data "param1=value1¶m2=value2" www.google.com # post
javascript fetch123456789101112131415161718//headfetch('http://www.google.com', { headers: { 'Content-Type': 'text/html' }});// getfetch('http://www.google.com?cmd=ls -al' ...