分类 技术记录 下的文章

知乎现在官方推的账号简直是让人辣眼睛,一天天的推的都是什么东西,还要付费才能看,付费看个鬼啊,现在随便编个故事都能卖钱了麽。

写了个油猴脚本,屏蔽一些官方账号发送的内容,需要先安装油猴才能使用。

脚本内容如下:

// ==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();
    });
})();

更新系统

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

从github换到flarum,捣鼓了下,记录一些问题。

使用的docker安装的,比较省事,直接pull下来处理就行了,下面是相关配置文件

docker-compose.yml

version: "3"

services:
  flarum:
    image: registry.cn-hangzhou.aliyuncs.com/flarumchina/nginx-flarum:latest
    container_name: flarum
    ports:
      - 80:8888
      - 443:443
    env_file:
      - ./flarum.env
    volumes:
      - ./assets:/flarum/app/public/assets
      - ./extensions:/flarum/app/extensions
      - ./nginx:/etc/nginx/conf.d
      - ./cert:/etc/nginx/cert
      - ./nginx.conf:/etc/nginx/nginx.conf
    depends_on:
      - mysql
    restart: always

  mysql:
    image: mysql:5.7
    container_name: flarum-mysql
    ports:
      - 3306:3306
    environment:
      - MYSQL_ROOT_PASSWORD=root password
      - MYSQL_DATABASE=flarum
      - MYSQL_USER=flarum
      - MYSQL_PASSWORD=your password
    volumes:
      - ./db:/var/lib/mysql
    restart: always

- 阅读剩余部分 -