Web端屏蔽知乎盐选等账号
知乎现在官方推的账号简直是让人辣眼睛,一天天的推的都是什么东西,还要付费才能看,付费看个鬼啊,现在随便编个故事都能卖钱了麽。
写了个油猴脚本,屏蔽一些官方账号发送的内容,需要先安装油猴才能使用。
脚本内容如下:
// ==UserScript==
// @name 知乎账号回答屏蔽工具
// @namespace https://hmilyld.com/
// @version 0.1
// @description 屏蔽知乎盐选等账号
// @author Hmilyld
// @match https://www.zhihu.com/*
// @require https://cdn.bootcdn.net/ajax/libs/jquery/1.10.0/jquery.min.js
// @grant none
// ==/UserScript==
(function () {
'use strict';
//需要屏蔽的用户
var users = [
"盐选科普","故事档案局","盐选推荐","真实故事计划"
]
if ($('#ProfileMain').length > 0) {
new MutationObserver(function (mutations) {
remove_item();
}).observe(document.getElementById('ProfileMain'), {
childList: true,
subtree: true,
})
}
if ($('#QuestionAnswers-answers').length > 0) {
new MutationObserver(function (mutations) {
remove_item();
}).observe(document.getElementById('QuestionAnswers-answers'), {
childList: true,
subtree: true,
})
}
function remove_item() {
$.each(users, function (idx, item) {
$("meta[content='" + item + "']").closest(".List-item").hide();
})
}
remove_item();
})();
屏蔽落伍论坛指定发帖人的帖子
天天看到某人的帖子烦的不行,顺手写了个油猴的脚本,添加上指定人的href就可以了,只屏蔽帖子列表,帖子内容页的信息不会屏蔽。
// ==UserScript==
// @name 落伍发帖人屏蔽器
// @namespace https://hmilyld.com/
// @version 0.1
// @description 根据发帖人屏蔽发帖人所发的帖子信息
// @author Hmilyld
// @match https://www.im286.net/forum-1-*.html
// @require https://cdn.bootcdn.net/ajax/libs/jquery/1.10.0/jquery.min.js
// @grant none
// ==/UserScript==
(function() {
'use strict';
//href替换为想屏蔽的人就行了,替换后直接看不到该人发送的任何帖子
$("a[href='space-uid-****.html']").each(function(idx, dom){
$(dom).closest("tbody").hide();
});
})();
LNMP VPS自动备份网站发送邮件
lnmp官方自带的有backup.sh脚本,但是该脚本只能上传ftp,不能发送邮件,稍微修改了下,然后可以自己发送到指定邮箱,省事了,定时任务需要cron配合。
安装mutt
yum install -y mutt
创建.muttrc
set envelope_from=yes
set from="backup@hmilyld.com"
set realname="hmilyld"
set use_from=yes
云服务器初始化
更新系统
yum update
添加用户
adduser hmilyld
passwd hmilyld
安装zsh及oh-my-zsh
yum install zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
安装zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
安装nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
修改~/.zshrc配置文件
export ZSH="/home/用户名/.oh-my-zsh"
ZSH_THEME="gentoo"
plugins=(git z zsh-autosuggestions)
source $ZSH/oh-my-zsh.sh
alias ll='ls -la'
alias python='python3'
export NVM_NODEJS_ORG_MIRROR=http://npm.taobao.org/mirrors/node
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
刷新~/.zshrc配置
source ~/.zshrc
安装node及npm
nvm install stable