0%

Linux 服务器介绍和使用
常用 Linux 版本分析
常用工具/概念/使用方式
以前和现在的服务器(托管和云平台)
服务器配置
部署项目

阅读全文 »

nginx 的 403 Forbidden errors 表示你在请求一个资源文件但是nginx不允许你查看。
403 Forbidden 只是一个HTTP状态码,像404,200一样不是技术上的错误。
哪些场景需要返回403状态码的场景?

阅读全文 »

Debian / Ubuntu 14.04 +

CentOS用户请使用这个脚本:CentOS/Debian/Ubuntu系统 TCP-BBR 一键安装脚本

本脚本只在 Debian 7 / Debian 8 / Ubuntu 14.04 / Ubuntu 16.04 (均 x64位) 这几个系统中测试过脚本可以正常运行(Vultr)!

强烈推荐 Debian 7 x64,这个是我一直使用的系统,我的脚本在这个系统上面出错率最低。

至于为什么不支持 CentOS 等系统,主要是我不怎么用其他的系统,就不做支持了。
阅读全文 »

挂起后无法唤醒,一直黑屏。好像N卡普遍会有这个问题。为了这个破问题找了很多方法,网上很多说升级内核、升级显卡驱动还有些其它的方法都试过也没用,还把系统弄崩过。后来在外网找到一个不算完美的解决方法,就是把nvidia的挂起与休眠服务给停了。具体代码
sudo systemctl stop nvidia-suspend.service
sudo systemctl stop nvidia-hibernate.service
sudo systemctl stop nvidia-resume.services
udo systemctl disable nvidia-suspend.service
sudo systemctl disable nvidia-hibernate.service
sudo systemctl disable nvidia-resume.service
sudo rm /lib/systemd/system-sleep/nvidia
然后重启电脑。

Another way to squash all your commits is to reset the index to master:

1
2
3
4
git checkout yourBranch
git reset $(git merge-base master $(git branch --show-current))
git add -A
git commit -m "one commit on yourBranch"

This isn’t perfect as it implies you know from which branch “yourBranch” is coming from.
Note: finding that origin branch isn’t easy/possible with Git (the visual way is often the easiest, as seen here).

Note: git branch --show-current has been introduced with Git 2.22 (Q1 20219).

EDIT: you will need to use git push --force

Karlotcha Hoa adds in the comments: For the reset, you can do

1
git reset $(git merge-base master $(git rev-parse --abbrev-ref HEAD))

[That] automatically uses the branch you are currently on.
And if you use that, you can also use an alias, as the command doesn’t rely on the branch name.

sschoof adds in the comments:

Since my default branch is called main and my search had multi times brought me here:
To copy it for my next time

1
git reset $(git merge-base main $(git rev-parse --abbrev-ref HEAD))
阅读全文 »

1
2
3
4
5
6
7
8
git checkout dev
git pull
git reset $(git merge-base master $(git branch --show-current))
git add -A
git commit -m "rebase commit"


git push --force