july notes

pull/4/head
gotbletu 11 years ago
parent cfa1e5ca61
commit 9c06a9af56

@ -0,0 +1,73 @@
#!/bin/bash
# Video demo at: http://www.youtube.com/watch?v=TyDX50_dC0M
# by: Rhomboid
# http://www.reddit.com/r/commandline/comments/18yp5b/bash_script_to_update_multiple_blocklists/c8j6v5a
# Edit by: gotbletu
# https://www.youtube.com/user/gotbletu
# https://twitter.com/gotbletu
# Transmission does not allow multiple blocklist by default or is not simple.
# This script merges multiple blocklist into one file.
# Be sure to restart your bt client/daemon to use the new iplist.
# Make sure to enable the blocklist and keep the url empty in your config file.
# Example:
# "blocklist-enabled": true,
# "blocklist-url": "",
# Do P2P Blocklists Keep You Safe?
# http://torrentfreak.com/do-p2p-blocklists-keep-you-safe/
# TLDR: 75-80% safe; not 100% fullproof
# Some suggested blocklist:
# http://www.iblocklist.com/lists.php
# Bluetack list
# level1 # General default list.
# level2 # Labs or researchers.
# level3 # The paranoids list.
# bt_bogon # Unallocated addresses.
# bt_dshield # known hackers
# bt_hijacked # spammers
# bt_microsoft # bill gates
# bt_templist # Suspected bad peers.
# bt_spyware # Suspected spy/malware.
# TBG list
# ijfqtofzixtwayqovmxn # primary threat; anti p2p company
# ecqbsykllnadihkdirsh # General Corporate Ranges
# ewqglwibdgjttwttrinl # Bogon by TBG; Unallocated addresses
# tbnuqfclfkemqivekikv # Hijacked by TBG; spammers
## jcjfaxgyyshvdbceroxf # Business ISPs
set -e
# blocklist to download from
URLS=(
http://list.iblocklist.com/?list=bt_level1
http://list.iblocklist.com/?list=bt_level2
http://list.iblocklist.com/?list=bt_level3
http://list.iblocklist.com/?list=bt_bogon
http://list.iblocklist.com/?list=bt_dshield
http://list.iblocklist.com/?list=bt_hijacked
http://list.iblocklist.com/?list=bt_microsoft
http://list.iblocklist.com/?list=bt_templist
http://list.iblocklist.com/?list=bt_spyware
http://list.iblocklist.com/?list=ijfqtofzixtwayqovmxn
http://list.iblocklist.com/?list=ecqbsykllnadihkdirsh
http://list.iblocklist.com/?list=tbnuqfclfkemqivekikv
http://list.iblocklist.com/?list=ewqglwibdgjttwttrinl
)
# blocklist directory
DIR="$HOME/.config/transmission-daemon/blocklists"
# remove old blocklist
rm -f $DIR/extras*
# download new blocklist
wget "${URLS[@]}" -O - | gunzip | LC_ALL=C sort -u > "$DIR/extras-$(date +%d-%b-%R).txt"

@ -0,0 +1,26 @@
Notes for video: http://www.youtube.com/watch?v=OW-lKJDFOzc
add to ~/.tmux.conf
# vim keys in copy or choice mode
set-window-option -g mode-keys vi
# copying selection vim style
# http://jasonwryan.com/blog/2011/06/07/copy-and-paste-in-tmux/
# https://github.com/myfreeweb/dotfiles/blob/master/tmux.conf
bind-key Escape copy-mode # enter copy mode; default [
bind-key -t vi-copy Escape cancel # exit copy mode; or hit q
bind-key p paste-buffer # paste; default ]
bind-key -t vi-copy v begin-selection # begin visual mode
bind-key -t vi-copy V select-line # visual line
bind-key -t vi-copy y copy-selection # yank
bind-key -t vi-copy r rectangle-toggle # visual block toggle
# read and write and delete paste buffer ( xsel method)
# https://wiki.archlinux.org/index.php/Tmux#ICCCM_Selection_Integration
# ctrl+shift+v
bind-key < command-prompt -p "send to tmux:" "run-shell 'tmux set-buffer -- \"$(xsel -o -b)\"'"
bind-key > command-prompt -p "send to xsel:" "run-shell 'tmux show-buffer | xsel -i -b'"
bind-key + command-prompt "delete-buffer"

@ -0,0 +1,34 @@
Notes for video: http://www.youtube.com/watch?v=f1jrm8gFpO0
add to ~/.tmux.conf
#-------- Mouse {{{
#------------------------------------------------------
# mouse to highlight and copy; to paste use prefix + ]
# http://awhan.wordpress.com/2012/04/18/tmux-copy-paste-with-mouse/
# temporarily allow regular terminal copy mode while mouse mode is enable
# visual line: shift+mouse
# visual block: ctrl+shift+mouse <-- only works on some terminals
# visual block: ctrl+mouse <-- (while mouse mode is disable) only works on some terminals
# toggle mouse on/off
# http://tangledhelix.com/blog/2012/07/16/tmux-and-mouse-mode/
bind-key m \
set-option -g mode-mouse on \;\
set-option -g mouse-resize-pane on \;\
set-option -g mouse-select-pane on \;\
set-option -g mouse-select-window on \;\
display-message 'Mouse: ON'
bind-key M \
set-option -g mode-mouse off \;\
set-option -g mouse-resize-pane off \;\
set-option -g mouse-select-pane off \;\
set-option -g mouse-select-window off \;\
display-message 'Mouse: OFF'
# }}}

@ -1,21 +1,38 @@
# this is notes for video: http://www.youtube.com/watch?v=ee4XzWuapsE
#-------- Transmission CLI {{{
#------------------------------------------------------
# lightweight torrent daemon, has option for cli, webui, ncurses, and gui frontend
# demo video: http://www.youtube.com/watch?v=ee4XzWuapsE
# WebUI: http://localhost:9091/transmission/web/
# http://192.168.1.xxx:9091/transmission/web/
tsm-clearcompleted() {
transmission-remote -l | grep 100% | grep Done | \
awk '{print $1}' | xargs -n 1 -I % transmission-remote -t % -r ;}
tsm() { transmission-remote --list ;}
tsm-altspeedenable() { transmission-remote --alt-speed ;}
tsm-altspeeddisable() { transmission-remote --no-alt-speed ;}
# numbers of ip being blocked by the blocklist
# credit: smw from irc #transmission
tsm-count() { echo "Blocklist rules:" $(curl -s --data \
'{"method": "session-get"}' localhost:9091/transmission/rpc -H \
"$(curl -s -D - localhost:9091/transmission/rpc | grep X-Transmission-Session-Id)" \
| cut -d: -f 11 | cut -d, -f1) ;}
# demo video: http://www.youtube.com/watch?v=TyDX50_dC0M
tsm-blocklist() { $PATH_SCRIPTS/blocklist.sh ;} # update blocklist
tsm-daemon() { transmission-daemon ;}
tsm-quit() { killall transmission-daemon ;}
tsm-altspeedenable() { transmission-remote --alt-speed ;} # limit bandwidth
tsm-altspeeddisable() { transmission-remote --no-alt-speed ;} # dont limit bandwidth
tsm-add() { transmission-remote --add "$1" ;}
tsm-askmorepeers() { transmission-remote -t"$1" --reannounce ;}
tsm-pause() { transmission-remote -t"$1" --stop ;}
tsm-start() { transmission-remote -t"$1" --start ;}
tsm-purge() { transmission-remote -t"$1" --remove-and-delete ;} # will delete data also
tsm-remove() { transmission-remote -t"$1" --remove ;} # does not delete data
tsm-pause() { transmission-remote -t"$1" --stop ;} # <id> or all
tsm-start() { transmission-remote -t"$1" --start ;} # <id> or all
tsm-purge() { transmission-remote -t"$1" --remove-and-delete ;} # delete data also
tsm-remove() { transmission-remote -t"$1" --remove ;} # leaves data alone
tsm-info() { transmission-remote -t"$1" --info ;}
tsm-speed() { while true;do clear; transmission-remote -t"$1" -i | grep Speed;sleep 1;done ;}
# https://github.com/fagga/transmission-remote-cli
# demo video: http://www.youtube.com/watch?v=hLz7ditUwY8
tsm-ncurse() { transmission-remote-cli ;}
#}}}

Loading…
Cancel
Save