From 5f302621706e4c5166a0f493b59d4af9d8592ae8 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Tue, 13 Feb 2018 15:54:06 +0100 Subject: [PATCH] Add raspberry function --- .config/zsh/.zshrc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index c40391e..fc3f69d 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -93,6 +93,16 @@ alias reboot='systemctl reboot' alias upl='pio run --target=upload' alias ser='pio serialports monitor -b 9600' +jr() { mkdir -p "./out"; javac -d "./out" "$1.java"; java -cp "./out" "$1" } +raspberry() { + sudo systemctl start avahi-daemon.service + if ! ip a show usb0 | grep -q 'inet6'; then + sudo dhcpcd usb0 + fi + ssh -6 pi@$(avahi-resolve-host-name raspberrypi.local | awk '{ print $2 }')%usb0 + sudo systemctl stop avahi-daemon.service +} + # Git alias g="git" alias ga="g add"