Skip to content

Instantly share code, notes, and snippets.

View hvmonteiro's full-sized avatar

Hugo Monteiro hvmonteiro

View GitHub Profile
@hvmonteiro
hvmonteiro / get-showrss-info.sh
Last active March 29, 2020 20:25
Quick dirty script to download showrss.info list and send it to transmission torrent
#!/bin/bash
USERID="12345"
TRACKERS_FILE="/tmp/showrss.info"
TRANSMISSION_BIN="/storage/.kodi/addons/service.downloadmanager.transmission/bin/transmission-remote"
TRACKERS_LIBFILE="/var/media/storage/backups/get-showrss-info.data"
curl -s 'http://showrss.info/user/${USERID}.rss?magnets=true&namespaces=true&name=null&quality=null&re=null' | grep -o '<enclosure url="[^"]*' | grep -o '[^"]*$' > "$TRACKERS_FILE"
#sed 's/&/\\&/g;s/;/\\;/g'
touch "$TRACKERS_LIBFILE"
@hvmonteiro
hvmonteiro / transmission-purge-completed.sh
Last active June 12, 2024 05:35
Script that allows the auto removal of downloaded/completed torrents from transmission BitTorrent daemon in OpenELEC/Kodi.
#!/bin/sh
# Originaly based on script https://community.wd.com/t/guide-auto-removal-of-downloads-from-transmission-2-82/93156
# adapted for OpenELEC Kodi
# port, username, password
SERVER="9091 --auth transmission:transmission"
# use transmission-remote to get torrent list from transmission-remote list
# use sed to delete first / last line of output, and remove leading spaces
@hvmonteiro
hvmonteiro / outlook_macro_read+cleanup+archive.vbs
Last active February 28, 2019 14:45
Outlook macro to read selected items, clean up folder and archive items.
'Outlook VB Macro to Unread, CleanUp Folder & subFolders
' and Archive Selected items
Private Sub CleanUpAllFolders()
Dim objExpl As Explorer
Set objExpl = ActiveExplorer
objExpl.CommandBars.ExecuteMso ("ThreadCompressFolderRecursive")
End Sub
@hvmonteiro
hvmonteiro / config
Created January 29, 2018 14:48
Terminator terminal configuration file with all keybinds disabled
[global_config]
enabled_plugins = TerminalShot, LaunchpadCodeURLHandler, APTURLHandler, Logger, MavenPluginURLHandler, LaunchpadBugURLHandler
title_font = Sans 10
title_inactive_fg_color = "#ffffff"
title_transmit_bg_color = "#494949"
title_use_system_font = False
[layouts]
[[default]]
[[[child1]]]
parent = window0
@hvmonteiro
hvmonteiro / setup-linux-user-console.sh
Last active March 29, 2020 19:57
Setup a user console in Linux
#!/bin/bash
#
# Description: This script will setup a customized user console in Linux
# based on my gists (https://gist.github.com/hvmonteiro)
# - .bashrc
# - .jshintrc
# - .LS_COLORS
# - .lessfilter
# - .config/terminator/config
# - .ssh/config
@hvmonteiro
hvmonteiro / firefox-stdin
Created July 19, 2017 17:37
Make Firefox read from "stdin" in Linux
echo '<h1>hello, world</h1>' |firefox "data:text/html;base64,$(base64 -w 0 <&0)"
@hvmonteiro
hvmonteiro / mdview.sh
Created July 19, 2017 17:36
markdown viewer in linux command line
function mdview {
markdown "$1" | lynx -stdin
}
@hvmonteiro
hvmonteiro / is_tcp_port_active.sh
Last active February 23, 2017 12:10
Linux: Test TCP Port when there is no telnet available
# Copy/paste directly into bash shell or source a file with the function below:
# --- cut here ---
is_tcp_port_active () {
if [ "$1" == "" -o "$2" == "" ]; then
echo -e "\n usage: is_tcp_port_active <hostname> <port>\n"
return 1
fi
HOST=$1;
PORT=$2;
echo "$HOST:$PORT";
@hvmonteiro
hvmonteiro / package.js
Created February 22, 2017 14:54
Get electron-download pre-compiled binnaries for every platform to local cache directory.
const download = require('electron-download');
var downloadVersion = '1.4.15';
if (process.argv > 2) {
var downloadVersion = process.argv[2];
console.log('Using specified version', downloadVersion, '...');
} else {
console.log('Version', process.argv[2], 'using default', downloadVersion, '...');
}
@hvmonteiro
hvmonteiro / ssh_config
Last active January 22, 2019 16:27
SSH Configuration file
#
# WARNING: This configuration file is only suitable for usage in development environments on private networks,
# as it supresses and works around most information messages about SSH related security issues!
#
# Always authenticate with user 'root'
Host *
User root
# Automatically add remote host keys