Skip to content

Instantly share code, notes, and snippets.

Avatar
🎲
Making games

sunil srpatel

🎲
Making games
View GitHub Profile
View prepl.pl
#!/usr/bin/perl
# This is a REPL loop for Perl.
# If you want to be able to navigate on the prompt with arrow keys
# and have up/down for history, then:
# For OSX, install: Term::EditLine, Term::ReadLine::EditLine
# For Linux, install Term::ReadLine::Gnu
use strict;
View .ssh-autocomplete
# Source this file in your .profile/.bashrc in order to get tab autocomplete
# on ssh hosts as listed in your ~/.ssh/config file.
_ssh_autocomplete() {
local SSH_CONFIG_FILE="$HOME/.ssh/config"
local cur=${COMP_WORDS[COMP_CWORD]}
if [[ "$COMP_CWORD" -eq "1" && -f $SSH_CONFIG_FILE ]]; then
local hosts=`cat $SSH_CONFIG_FILE | grep ^Host | awk '{ print $2 }' | tr '\n' ' '`
COMPREPLY=( $(compgen -W "$hosts" -- $cur) )
else