This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # include this in ~/.bashrc or ~/.zshrc | |
| sshf () { | |
| local hosts | |
| hosts=$(grep -E '^Host ' ~/.ssh/config | awk '{print $2}' | grep -v '*' | grep -v '*$' | grep -v 'github') | |
| local selected_host | |
| selected_host=$(echo "$hosts" | fzf --height=50% --reverse --prompt="SSH into: ") | |
| if [ -n "$selected_host" ]; then | |
| ssh "$selected_host" | |
| fi | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [[ "$#" != 2 ]]; then | |
| echo "Usage $0 <config path> <hostname>" | |
| exit 1 | |
| fi | |
| mapfile -t configs < <(ls -1 /etc/pve/lxc/) | |
| last_config="${configs[-1]%%.*}" | |
| new_config=$((last_config+1)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(function(){javascript:(function(){ | |
| const guid = ([1e7]+-1e3+-4e3+-8e3+-1e11) | |
| .replace(/[018]/g, c=>(c^crypto.getRandomValues(new Uint8Array(1))[0]&15 >> c/4).toString(16)); | |
| const q = prompt('Search for:'); | |
| if(q){ | |
| location.href = `https://www.reddit.com/answers/${guid}?q=${encodeURIComponent(q)}`; | |
| } | |
| })();})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Redirect Medium Urls | |
| // @namespace https://github.com/push-and-pray-ops | |
| // @version 0.1 | |
| // @description Redirect medium urls to freedium ones automatically | |
| // @author https://github.com/david-shepard | |
| // @match https://medium.com/* | |
| // @match https://*.medium.com/* | |
| // @grant none | |
| // ==/UserScript== |