Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
Aniverse committed Jan 12, 2018
1 parent 75e0879 commit 74a5257
Show file tree
Hide file tree
Showing 35 changed files with 360 additions and 0 deletions.
174 changes: 174 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,177 @@ EOF
source ~/.zshrc
```



export PATH=~/bin/ffmpeg2/bin:$PATH

cd ~/makemkv-oss-1.10.9
./configure --prefix=$HOME/bin

PKG_CONFIG_PATH=~/bin/ffmpeg2/lib/pkgconfig ./configure --prefix=$HOME/bin



cd ~/makemkv-oss-1.10.9



./configure --prefix=$HOME/bin/ffmpeg2 --enable-static --disable-shared --enable-pic --disable-yasm
make -j24
make install DEST_HOME=$HOME


wget -O ffmpeg.tar.gz https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz

mkdir -p ~/bin && bash
wget -qO ~/ffmpeg.tar.gz https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz
tar xf ~/ffmpeg.tar.gz && cd && rm -rf ffmpeg-*-64bit-static/{manpages,presets,readme.txt}
cp ~/ffmpeg-*-64bit-static/* ~/bin
chmod 700 ~/bin/{ffmpeg,ffprobe,ffmpeg-10bit,qt-faststart}
cd && rm -rf ffmpeg{.tar.gz,-*-64bit-static}





### 一些编译安装时的选项
```
./configure --prefix=$HOME/bin
make -j24
make install DEST_HOME=$HOME
echo "PATH=~/bin:$PATH" > ~/.bashrc
source ~/.bashrc
```

### 改变 rTorrent 的版本
```
rtversion="0.9.3_w0.13.3"
rtversion="0.9.6_w0.13.6"
rtversion="0.9.4_w0.13.4"
echo -n "${rtversion}" > ~/private/rtorrent/.version
pkill -fu "$(whoami)" 'SCREEN -S rtorrent'
screen -S rtorrent rtorrent
```

### ruTorrent 升级到 3.8
```
cd ~/www/$(whoami).$(hostname -f)/public_html/
gclone https://github.com/Novik/ruTorrent.git
cp -r rutorrent/conf/* ruTorrent/conf/
cp rutorrent/.ht* ruTorrent/
rm -rf rutorrent/ && mv ruTorrent rutorrent && cd
```

### 安装 Node.js 与 Flood
```
mkdir -p ~/bin
wget -qO ~/node.js.tar.gz https://nodejs.org/dist/v8.7.0/node-v8.7.0-linux-x64.tar.xz
tar xf ~/node.js.tar.gz --strip-components=1 -C ~/
cd && rm -rf node.js.tar.gz
rm -rf ~/node/apps
mkdir -p ~/node/apps
git clone --depth=1 -b v1.0.0 --single-branch https://github.com/jfurrow/flood.git ~/node/apps/flood
cp ~/node/apps/flood/config.template.js ~/node/apps/flood/config.js
sed -i "s|floodServerHost: '127.0.0.1'|floodServerHost: ''|g" ~/node/apps/flood/config.js
sed -i "s|floodServerPort: 3000|floodServerPort: $(shuf -i 10001-32001 -n 1)|g" ~/node/apps/flood/config.js
sed -i "s|secret: 'flood'|secret: '$(< /dev/urandom tr -dc '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' | head -c20; echo;)'|g" ~/node/apps/flood/config.js
sed -i "s|socket: false|socket: true|g" ~/node/apps/flood/config.js
sed -i "s|socketPath: '/tmp/rtorrent.sock'|socketPath: '$HOME/private/rtorrent/.socket'|g" ~/node/apps/flood/config.js
npm install --production --prefix ~/node/apps/flood
npm run build --prefix ~/node/apps/flood
screen -dmS flood npm start --prefix ~/node/apps/flood/ && echo http://$(id -u -n).$(hostname -f):$(sed -rn 's/(.*)floodServerPort: (.*),/\2/p' ~/node/apps/flood/config.js)
```




### 改变 Deluge 的版本
DEVERSION=1.3.13
wget -qO ~/deluge-tmp.tar.gz http://download.deluge-torrent.org/source/deluge-"${DEVERSION}".tar.gz
mkdir ~/deluge-tmp && tar xf ~/deluge-tmp.tar.gz --strip-components=1 -C ~/deluge-tmp && cd ~/deluge-tmp/
python setup.py install --user
cd && rm -rf ~/deluge-tmp*



### 通过 SSH 修改 ruTorrent、Deluge WebUI、qBittorrent WebUI 的密码

ANUSER=$(whoami)
ANPASS=


wget -qO ~/bin/deluge.userpass.py https://github.com/Aniverse/inexistence/raw/master/00.Installation/script/special/deluge.userpass.py
wget -qO ~/bin/qbittorrent.userpass.py https://github.com/Aniverse/inexistence/raw/master/00.Installation/script/special/qbittorrent.userpass.py


sed -i "s/RPCUSERNAME/${ANUSER}/g" /root/.config/transmission-daemon/settings.json
sed -i "s/RPCPASSWORD/${ANPASS}/g" /root/.config/transmission-daemon/settings.json

cp -f "${local_packages}"/template/config/qBittorrent.conf /root/.config/qBittorrent/qBittorrent.conf
cp -f "${local_packages}"/template/systemd/qbittorrent.service /etc/systemd/system/qbittorrent.service

QBPASS=$(python "${local_packages}"/script/special/qbittorrent.userpass.py ${ANPASS})
sed -i "s/SCRIPTUSERNAME/${ANUSER}/g" /root/.config/qBittorrent/qBittorrent.conf
sed -i "s/SCRIPTQBPASS/${QBPASS}/g" /root/.config/qBittorrent/qBittorrent.conf

sed -i 's|"download_location": "$(pwd)/Downloads"|"download_location": "$(pwd)/private/deluge/data"|g' ~/.config/deluge/core.conf
sed -i 's|"autoadd_location": "$(pwd)/Downloads"|"autoadd_location": "$(pwd)/private/deluge/watch"|g' ~/.config/deluge/core.conf




DWSALT=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
DWP=$(python "${local_packages}"/script/special/deluge.userpass.py ${ANPASS} ${DWSALT})
echo "${ANUSER}:${ANPASS}:10" > /root/.config/deluge/auth
sed -i "s/delugeuser/${ANUSER}/g" /root/.config/deluge/core.conf
sed -i "s/DWSALT/${DWSALT}/g" /root/.config/deluge/web.conf
sed -i "s/DWP/${DWP}/g" /root/.config/deluge/web.conf



start
deluged
check running
pgrep -fu "$(whoami)" "deluged"
stop
kill "$(pgrep -fu "$(whoami)" "deluged")"
restart
kill "$(pgrep -fu "$(whoami)" "deluged")" && sleep 3 && deluged
kill (force stop)
kill -9 "$(pgrep -fu "$(whoami)" "deluged")"




BHE4hv8Muchxd8LV


【盒子名称】Feral Hosting Neon SSD (hippolytus)
【盒子类型】共享盒子
【IP】共享 IPv4,无 IPv6
【CPU】Intel Xeon E5 2680 V3 双路,24C48T
【内存】256GB
【硬盘】保证至少 150GB 可用,SSD RAID0
(可以超用但不建议长期这么做)
【网速】共享 20Gbps,无限流量
【软件】
Deluge 1.3.15 / 1.3.13
rTorrent 0.9.6 / 0.9.4 / 0.9.3 with ruTorrent 3.8 / flood
qBittorrent 3.3.7 / 3.3.11 / 3.3.16
Transmission 2.84
Flexget
BBR

【技术支持】看心情
【原价】15 英镑
【转租价格】80 RMB(用到 2018.02.01 12:00 UTC+8)

注:不要问我有没有其他盒子可以出租,有的话我会发帖吧的




19 changes: 19 additions & 0 deletions app/deluge.userpass.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env python
#
# Deluge password generator
#
# deluge.password.py <password> <salt>
#
#

import hashlib
import sys

password = sys.argv[1]
salt = sys.argv[2]

s = hashlib.sha1()
s.update(salt)
s.update(password)

print s.hexdigest()
Binary file removed app/qbittorrent.3.3.11/libQt5Core.so.5
Binary file not shown.
Binary file removed app/qbittorrent.3.3.11/libQt5Network.so.5
Binary file not shown.
Binary file removed app/qbittorrent.3.3.11/libQt5Xml.so.5
Binary file not shown.
Binary file removed app/qbittorrent.3.3.11/libicudata.so.55
Binary file not shown.
Binary file removed app/qbittorrent.3.3.11/libicui18n.so.55
Binary file not shown.
Binary file removed app/qbittorrent.3.3.11/libicuuc.so.55
Binary file not shown.
Binary file removed app/qbittorrent.3.3.11/libpcre16.so.3
Binary file not shown.
Binary file removed app/qbittorrent.3.3.11/libproxy.so.1
Binary file not shown.
Binary file removed app/qbittorrent.3.3.11/libtorrent-rasterbar.so.8
Binary file not shown.
Binary file removed app/qbittorrent.3.3.16/libboost_system.so.1.55.0
Binary file not shown.
150 changes: 150 additions & 0 deletions app/qbittorrent.autoremove.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
# -*- coding: UTF-8 -*-
from qbittorrent import Client
import time
import requests
from time import sleep
import ConfigParser
import os
import sys
import re

class my_qBittorrent(object):
def __init__(self,config):
self.config = config
username = self.config.get('global','webui_username')
password = self.config.get('global','webui_password')
webui_url = self.config.get('global','webui_url')
self.torrentHash = []
self.torrentData = []
self.client = Client(webui_url)
self.client.login(username, password)
self.getTorrentInfo()
self.getTorrentSeedTime()

def getTorrentInfo(self):
self.torrents = self.client.torrents(filter = 'completed')
for torrent in self.torrents:
self.torrentHash.append(torrent['hash'])
return

def getTorrentSeedTime(self):
for torrentHash in self.torrentHash:
torrentDict = {'hash':torrentHash,'info':self.client.get_torrent(torrentHash)}
self.torrentData.append(torrentDict)
return

def deleteTorrentPerm(self,torrentHash):
self.client.delete_permanently(torrentHash)
return

def getSingleTorrentInfo(self,torrentHash):
torrentDict = {'hash':torrentHash,'info':self.client.get_torrent(torrentHash)}
return torrentDict

def seedTimeFilter(self,torrentHash,seedTime=1):
seedTimeConv = seedTime*3600
torrentInfo = self.getSingleTorrentInfo(torrentHash)
seedingTime = torrentInfo['info']['seeding_time']
if seedingTime > seedTimeConv:
return True
return False

def trackerFilter(self,torrentHash,trackers = None):
#add the tracker exception
if trackers:
pattern = re.compile(r',+\s*')
trackers = pattern.split(trackers)
for tracker in trackers:
rawInfo = self.client.get_torrent_trackers(torrentHash)
torrentTracker = rawInfo[0]['url']
if tracker in torrentTracker:
return True
return False

def addedTimeFilter(self,torrentHash,addedTime = 1):
#default day
torrentInfo = self.getSingleTorrentInfo(torrentHash)
addedTimeConv = addedTime*24*3600
timeElapsed = torrentInfo['info']['time_elapsed']
if timeElapsed > addedTimeConv:
return True
return False

def integratedFilterAndExecute(self,torrentHash,tacker = None, lowerLimit = None):
seed_time = self.config.getint('filter','seeding_time')
if not lowerLimit:
if not self.trackerFilter(torrentHash, tracker = tacker):
if self.seedTimeFilter(torrentHash, seedTime = seed_time):
self.deleteTorrentPerm(torrentHash)

else:
if not self.trackerFilter(torrentHash, tracker = tacker):
if self.seedTimeFilter(torrentHash, seedTime = seed_time) and self.filterUploadSpeed(torrentHash, lowerLimit = lowerLimit):
self.deleteTorrentPerm(torrentHash)

def Traversal(self):
tracker = self.config.get('filter','exception_tracker')
lowerLimit = self.config.get('filter','upload_speed')
for torrentHash in self.torrentHash:
self.integratedFilterAndExecute(torrentHash,tracker,lowerLimit = lowerLimit)

def getUploadSpeed(self,torrentHash):
torrentInfo = self.getSingleTorrentInfo(torrentHash)
torrentUpSpeed = torrentInfo['up_speed']
return torrentUpSpeed

def filterUploadSpeed(self,torrentHash,lowerLimit = None):
torrentUpSpeed = self.getUploadSpeed(torrentHash)
if lowerLimit:
if torrentUpSpeed < lowerLimit:
return True
else:
return False
return False


def parserConfig(pathToConfig):
config_path = os.path.expanduser(pathToConfig)
config = ConfigParser.SafeConfigParser()

if os.path.isfile(config_path):
config.read(config_path)
else:
configDir = os.path.dirname(config_path)
if not os.path.isdir(configDir):
os.makedirs(configDir)

config.add_section('global')
config.set('global', 'webui_url', '')
config.set('global', 'webui_username', '')
config.set('global','webui_password','')

config.add_section('filter')
config.set('filter', 'seeding_time', '')
config.set('filter','exception_tracker','')
config.set('filter','upload_speed')

with open(config_path,'w') as f:
config.write(f)

print('Please edit the configuration file: %s' % pathToConfig)
sys.exit(2)

return config

def main():
config = parserConfig('~/.qBautoremove/config')
while 1:
try:
newclient = my_qBittorrent(config)
newclient.Traversal()
except requests.exceptions.ConnectionError:
continue
time.sleep(300)

if __name__ == '__main__': main()





17 changes: 17 additions & 0 deletions app/qbittorrent.userpass.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env python
#
# qBittorrent password generator
#
# qbittorrent.password.py <password>
#
#

import hashlib
import sys

password = sys.argv[1]

s = hashlib.md5()
s.update(password)

print s.hexdigest()
Loading

0 comments on commit 74a5257

Please sign in to comment.