Skip to content

Instantly share code, notes, and snippets.

View hvmonteiro's full-sized avatar

Hugo Monteiro hvmonteiro

View GitHub Profile
@hvmonteiro
hvmonteiro / mdview.sh
Created July 19, 2017 17:36
markdown viewer in linux command line
function mdview {
markdown "$1" | lynx -stdin
}
@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 / 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 / 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 / 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 / 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 / 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 / pinmarklet.md
Created December 16, 2024 20:48 — forked from kentbrew/pinmarklet.md
How to recreate your long-lost Pinterest bookmarklet.

How to recreate your long-lost Pinterest bookmarklet.

Right-click your bookmarks bar and choose Add Page (Chrome) or New Bookmarklet (Firefox).

In Name, put this:

Pin It

In URL, put this:

@hvmonteiro
hvmonteiro / gist:e496cbeb9c33fbaf82da1f689c083897
Created March 14, 2025 18:55
List AI/LLM models installed by 'ollama' in an Linux environment using bash
for MODEL in /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/*; do MODEL_ASH="$(jq -r '.layers[] | select(.mediaType == "application/vnd.ollama.image.model") | .digest | gsub(":"; "-")' $MODEL/*)"; MODEL_NAME="${MODEL##*/}"; echo "$MODEL_NAME:"; echo " path: $( ls -1 /usr/share/ollama/.ollama/models/blobs/$MODEL_ASH)"; done