YAML,比JSON更适合作配置文件

很多项目使用JSON作为配置文件,最明显的例子就是npm和yarn使用的package.json文件.当然这更多的是因为JSON和JS千丝万缕的关系. 但是,JSON实际上是一种非常糟糕的配置语言.别误会我的意思,我其实是喜欢JSON的.它是 »

Author image 月杪 on #Linux,

用Nginx和rclone做Google Drive下载页

在写了在Linux上使用rclone挂载Google Drive等服务以后偶然想到能挂载Google Drive等一众网盘以后还能催生出很多玩法,其中一种就是与Nginx等Web server结合起来,做一个方便的下载页面. 准备 要实现下载页主要用 »

Author image 月杪 on #Linux,

用acme.sh签发Let's Encrypt证书

这几天用certbot签发Let’s Encrypt证书的时候发现了各种问题, 有Python版本问题以及pip源问题. 反正就是各种蠢 对我这样一个使用者来说Python制造的问题比它解决的问题还多 于是开始使用国人制作的shell工具 »

Stop DHCP From Changing resolv.conf

For DHCP users, there may be times when you need to edit /etc/resolv.conf to use other nameservers. Then, after a period of time (or after a system reboot), you discover that your changes to /etc/resolv.conf have been reverted. This tutorial shows three methods to stop DHCP from changing the /etc/resolv.conf on Debian or Ubuntu. Method 1: Change interface settings to static On a cloud vps, I do not suggest using this method. If you use this method, you may find that the reboot processing (until you can login through ssh) takes longer. First, we need to get the IP/netmask/gateway of the server. Run the following command. ifconfig | grep "inet addr" | head -n 1 | awk '{print $2, $4}' addr:1. »

Author image 月杪 on #Linux,

Google的新TCP拥塞算法BBR

更新:Debian9都发布好久了,用Debian9吧 不需要折腾内核就能直接开启BBR 上个月网友发现Google在GitHub上的项目Google/BBR. 前几天发现在几个Linux发行版中的候选版内核已经实装,而里面刚好也有Debian. 在 »

Author image 月杪 on #Linux,

Setup LetsEncrypt on Debian

Install LetsEncrypt Client git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt Obtain a Certificate Inside the nginx config, add this location block: location ~ /\.well-known/acme-challenge { root /var/www/html; } Reload Nginx: systemctl reload nginx Generate Certificate: cd /opt/letsencrypt ./letsencrypt-auto certonly -a webroot \ --webroot-path=/var/www/html \ -d example.com \ -d www.example.com »

为Linux手动添加swap空间

GCE建立的实例默认是没有swap的,所以如果需要swap的话就必须自己添加. 以下的操作都需要root权限 首先先建立一个分区 dd if=/dev/zero of=/var/swap bs=1024 count=1024000 这样就会创建/var/swap这么一个分区文件. 把这个分区变成swap分区。 mkswap /var/swap 使用这个swap分区。使其 »

Author image 月杪 on #Linux,