This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

superconfig / 5pkgs / sshify / package.nix
800 B 39 lines
1{ pkgs }: 2# usage: sshify neoprism.r -- curl ifconfig.me 3pkgs.writers.writeBashBin "sshify" '' 4 set -efu 5 6 TMPDIR=$(mktemp -d) 7 8 SSH_ARGS=() 9 10 while [[ "$#" -gt 0 ]]; do 11 case $1 in 12 --) 13 shift 14 break 15 ;; 16 *) 17 SSH_ARGS+=($1) 18 ;; 19 esac 20 shift 21 done 22 23 if [[ "$#" -le 0 ]]; then 24 echo no command specified 25 exit 1 26 fi 27 28 RANDOM_HIGH_PORT=$(shuf -i 20000-65000 -n 1) 29 30 cat << EOF >$TMPDIR/proxychains.conf 31 [ProxyList] 32 socks4 127.0.0.1 $RANDOM_HIGH_PORT 33 EOF 34 35 ssh -fNM -S "$TMPDIR/socket" -D "$RANDOM_HIGH_PORT" "''${SSH_ARGS[@]}" 36 trap "ssh -S $TMPDIR/socket -O exit bla 2>/dev/null; rm -rf $TMPDIR >&2" EXIT 37 38 ${pkgs.proxychains-ng}/bin/proxychains4 -q -f "$TMPDIR/proxychains.conf" "$@" 39''