Skip to content

Instantly share code, notes, and snippets.

@1gg
1gg / bashReplace.sh
Created September 30, 2021 20:42
bash batch replace in filenames
for f in *; do echo mv \'"$f"\' \'"${f/mp4/pdf}"\'; done
for f in *; do echo mv \'"$f"\' \'"${f/pdf/mp4}"\'; done
for f in *; do mv \'"$f"\' \'"${f/pdf/mp4}"\'; done
@1gg
1gg / gist:55b5b9fcc5a29495abcd7ad96e01f761
Created January 27, 2021 01:20
百度网盘linux版客户端下载地址
https://issuecdn.baidupcs.com/issue/netdisk/LinuxGuanjia/3.3.2/baidunetdisk_3.3.2_amd64.deb
http://issuecdn.baidupcs.com/issue/netdisk/LinuxGuanjia/3.0.1/baidunetdisk_linux_3.0.1.2.deb
https://issuecdn.baidupcs.com/issue/netdisk/LinuxGuanjia/3.5.0/baidunetdisk_3.5.0_amd64.deb
@1gg
1gg / rclone_schedule.cron
Created July 1, 2020 19:19
rclone crontab bash
#!/bin/bash
# RCLONE UPLOAD CRON TAB SCRIPT
# Type crontab -e and add line below (without # )
# * * * * * bash /home/user/rclone_schedule.cron >/dev/null 2>&1
if pidof -o %PPID -x "rclone_schedule.cron"; then
exit 1
fi
LOGFILE="rclone_schedule.cron.log"
@1gg
1gg / check_folder_size_cpu.sh
Created February 25, 2019 15:41
check_folder_size_cpu.sh
#!/bin/bash
sizingFolder="/home/user"
watchFolder="/home/user/deluge/watch"
currentFolderSize=$(du -s "$sizingFolder" | awk '{ print $1}')
sizeThreshold=545706008
currentCPUUsage=$(top -b -n 1 -p $(pgrep -d',' deluged) | grep deluged | awk '{ print $9}')
currentCPUUsage=${currentCPUUsage%%.*}
CPUThreshold=100
torrentLink=$1
torrentName=$2
@1gg
1gg / rename_torrent_by_tracker.sh
Last active December 29, 2018 10:37
rename single tracker torrent file by its tracker and folder name
#!/bin/bash
mkdir renamed
for file in $PWD/*.torrent; do
# echo $file
#transmission-show $file>> ti.txt
name=$(transmission-show $file|grep ' Name'| grep -Po '.*Name: \K.*')
#echo $name
tracker=$(transmission-show $file |grep -v Comment |grep 'http'| grep -Po '\/\/(.*?)\/'| grep -Po '[^\/]+(?=\/)')
# echo $tracker
tracker="${tracker} - "
@1gg
1gg / bencode.py
Created September 1, 2018 10:16 — forked from rmax/bencode.py
bittorrent format encoder/decoder that I found somewhere in the internet
# The contents of this file are subject to the Python Software Foundation
# License Version 2.3 (the License). You may not copy or use this file, in
# either source code or executable form, except in compliance with the License.
# You may obtain a copy of the License at http://www.python.org/license.
#
# Software distributed under the License is distributed on an AS IS basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
@1gg
1gg / 编译安装qb
Last active January 17, 2020 15:18
非一键
#Required dependencies
#General required dependencies
sudo apt-get install libboost-dev libboost-system-dev build-essential
sudo apt-get install libboost-system-dev libboost-chrono-dev libboost-random-dev libssl-dev libgeoip-dev
sudo apt-get install git pkg-config automake libtool
#Qt5 libraries
sudo apt-get install qtbase5-dev qttools5-dev-tools
#Python (Run time only dependency, for the search engine)
sudo apt-get install python
// ==UserScript==
// @name U2 大量派發紅包腳本
// @version 0.0.5
//
// @description 在 U2 大量派發紅包的好工具
// @author a0000778
//
// @downloadURL https://share.a0000778.name/userscript/U2/gift.user.js
// @updateURL https://share.a0000778.name/userscript/U2/gift.meta.js
//
# rutorrent config: [filter red-FL]
# upload-type = exec
# upload-command = /bin/bash
# upload-args = /path/to/script/dl.sh $(TorrentUrl)
#!/bin/bash
fl="&usetoken=1"
#for test
@1gg
1gg / RSS filters
Last active August 26, 2018 14:32
CHD:
/-CHD|OneHD|CHDBits/
/-CHDHKTV|-CHDPad/
TTG:
/TTG|-KOS|WiKi|TAiCHi|DUALiTY|NGB/