Skip to content

Instantly share code, notes, and snippets.

View 2niuhe's full-sized avatar
🎯
Focusing

niu_he 2niuhe

🎯
Focusing
View GitHub Profile
@2niuhe
2niuhe / snow.py
Last active December 30, 2023 03:57
snow
import time
import random
import sys
def snow():
# Manually set the terminal size
h, w = 20, 80 # Adjust these values as needed
flakes = [" ", " ", "❄︎", "❅", "❆"]
# Initialize air space
@2niuhe
2niuhe / m3u8.sh
Created July 8, 2023 06:06
ffmpeg download m3u8 video
ffmpeg -i url -c copy -bsf:a aac_adtstoasc output.mp4
@2niuhe
2niuhe / pocket_view_original.js
Created April 9, 2023 05:42
pocket避免重定向直接查看原文
// ==UserScript==
// @name Pocket View Original/Pocket查看原文避免重定向
// @namespace http://tampermonkey.net/
// @author 2niuhe
// @version 1.0.0
// @description getpocket website view original pocket网站直接查看原文避免重定向
// @match https://getpocket.com/zh/saves
// @match https://getpocket.com/en/saves
// @match https://getpocket.com/saves
// @icon https://www.google.com/s2/favicons?sz=64&domain=getpocket.com
@2niuhe
2niuhe / ffmpeg_convert_file.sh
Created December 17, 2022 11:51
ffmpeg批量转换文件
#!/bin/bash
srcExt=$1
destExt=$2
srcDir=$3
destDir=$4
opts=$5
@2niuhe
2niuhe / vscode_config.md
Last active January 16, 2021 18:22
vscode相关的扩展和配置
  • 编辑和终端跳转快捷键
{
  "key": "ctrl+j",
  "command": "workbench.action.focusActiveEditorGroup",
  "when": "!terminalFocus"
},
{
  "key": "ctrl+k",
 "command": "workbench.action.terminal.focus",
@2niuhe
2niuhe / tianyan.py
Created June 28, 2020 16:31
天眼看小说爬虫
import git
import requests
import logging
import time
import json
import copy
from bs4 import BeautifulSoup
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
# create file handler which logs even debug messages
@2niuhe
2niuhe / jobs.sh
Created May 31, 2020 22:10
autorestart youtube-dl download job
#!/bin/sh
while [ 0 -eq 0 ]
do
echo "----------------------job begin--------------------"
youtube-dl -r 3072k -f bestvideo+bestaudio https://youtu.be/OsmQvg8ZEr4?list=PLIx8QniXH-rEkJPV4dH-KobXtEp0EIS7r
if [$? -eq 0];then
echo "---------------------job complete------------------"
break;
else
@2niuhe
2niuhe / ubuntu20.04配置.md
Last active December 7, 2022 14:02
Ubuntu20.04配置软件

Ubuntu20一些软件配置记录

换清华源

sudo mv /etc/apt/sources.list /etc/apt/sources.list.bak
#清华源
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
@2niuhe
2niuhe / CL收藏夹.js
Last active May 30, 2020 11:03
油猴脚本合集
// ==UserScript==
// @name CL社区收藏夹
// @namespace http://tampermonkey.net/
// @version 1.42
// @description 为社区帖子添加一个本地收藏夹,支持导入导出功能。支持图片批量下载。该插件在手机端几乎可以用网页替代社区客户端。支持手机和电脑浏览器Tampermonkey、暴力猴。
// @author niuhe
// @include http://*/htm_data/*
// @match https://*/htm_data/*
// @match http://*/htm_mob/*
// @match https://*/htm_mob/*
@2niuhe
2niuhe / termux_mxrig.md
Last active March 30, 2024 12:45
install XMRig on termux

Monero XMR mining via termux ;ubuntu

  1. install ubuntu in termux command; (ubuntu is optional)
pkg install update && upgrade
apt install git
apt install wget
apt install proot