Show your current IP address as a QR code in the terminal
This makes it easy to test a local site on mobile -- because typing IP addresses on mobile sucks
Using homebrew:
brew install jordwest/tools/ipqr
Alternatively, download the latest darwin_amd64.tar.gz
package from the Releases page
Download the latest windows_amd64.zip
or windows_386.zip
from the Releases page.
Download the latest linux_*.tar.gz
package from the Releases page.
For x86/x86_64 processors, use linux_386.tar.gz
or linux_amd64.tar.gz
.
For Raspberry Pi, use linux_arm.tar.gz
. Note that although a 64-bit binary is available, the default OS on the Raspberry Pi 3 (which has a 64-bit processor) is still 32-bit.
To get started, make sure you have go installed, then:
$ go get github.com/jordwest/ipqr
$ ipqr
$ ipqr
That's it.
$ ipqr --help
Usage of ipqr:
-h, --host string Override host. This will default to the autodetected IP of this device
-n, --interface int The number of the interface to display. Use --list to find the interface number (default -1)
-l, --list Show a complete list of detected network addresses. By default we'll try to auto detect
-a, --path string Specify a path at the end of the URL
-p, --port int The port number to append to the end of the host, if any (default -1)
-r, --protocol string The protocol to prepend (default "http")
-v, --version Show the version number and exit
$ ipqr --port 8080 --path /blog
en0: 192.168.1.226 ==> http://192.168.1.226:8080/blog
$ ipqr --list
0: lo0 ::1
1: lo0 127.0.0.1
2: lo0 fe80::1
3: en0 fe80::8a23:9ff:fa4c:48c3
4: en0 192.168.1.226
$ ipqr -n 1
lo0: 127.0.0.1 ==> http://127.0.0.1
$ ipqr --host google.com --path /search?q=github+ipqr
http://google.com/search?q=github+ipqr
This tool makes use of some great open source projects:
- boombuler/barcode for QR code generation
- shiena/ansicolor for terminal colour support on Windows
- spf13/pflag for POSIX standard command line flags