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/sh | |
# This script takes the IP of the local machine, then makes a URL pointing to the local Flask server (http://192.168.1.9:5000), | |
# opens the URL in remote machine's Chrome tab, runs the Flask server, and plays a sound when ready. | |
# USAGE: in Flask's project folder: ~/path-to-script/openFlaskInRemote.sh [remote_machine_name] | |
IP="" | |
# find all the active connections of the local machine, | |
# and find the IP address of the first one |
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
# This script finds a device in local network by its name (using "devicename.local"), and | |
# then connects to it via ssh. Default device is "rainbow", other device name can be | |
# passed as a parameter. | |
# USAGE: ./connect.sh [machine_name] | |
#!/bin/sh |
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
# This script is to find and open the localhost server of a target remote | |
# machine connected to the same network and identified by name, in cases where `mymachine.local` is not available. | |
# There's a default machine named "XXX", script accepts custom machine names as first argument. | |
# The localhost port defaults to 3000 but | |
# can also be passed as an argument. Script has been tested on Mac OS only. | |
# USAGE: ./findAndOpenLocalhost.sh <machine_name> <port_number> | |
#!/bin/sh |
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
# This script is to open localhost server from a local browser, | |
# it has a default-machine.local and :3000 as default port, both | |
# can be passed as arguments. On execution, it will open the target | |
# remote machine's localhost server in a Chrome tab. | |
# USAGE: ./openLocalhost.sh <machine_name> <port_number> | |
#!/bin/sh | |
# Uppercase user input for machine name, or use default: |
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/sh | |
IP="" | |
# find all the active connections of the machine, | |
# and find the IP address of the first one | |
for i in $(ifconfig -lu) ; do | |
if (ifconfig $i | grep -q "status: active") ; then | |
IP=$(ifconfig $i | grep -i "inet ") | |
break |