Some distros (Ubuntu and its derivatives on my Macbook for instance) struggle to find a route to the captive portal on public networks (read: Starbucks). Assuming you want to connect the way they intend (via the gateway through the captive portal) because you are a rule abiding patron, all you need to do is visit the address of the gateway. There is no need to fiddle with your network drivers, disable SSL stuff or engage in plebian network tomfoolery.
""" find and open wifi captive portal (such as Starbucks) written by Jess Sullivan """ from netifaces import gateways from sys import argv from time import sleep import subprocess help_str = str("\n " + 'usage: \n ' + ' -h : print this message again \n' + ' -i : `pip3 install netifaces` \n' + 'You may specify a browser argument to complete the portal, such as \n' + 'google-chrome') def argtype(): try: if len(argv) > 1: use = True elif len(argv) == 1: use = False print(help_str) else: print('command takes 0 or 1 args, use -h for help') raise SystemExit except: print('arg error... \n command takes 0 or 1 args, use -h for help') raise SystemExit return use def main(): all_gates = gateways() target = all_gates['default'] if argtype(): if argv == '-h': print(help_str) quit() if argv == '-i': try: subprocess.Popen('pip3 install netifaces', shell=True, executable='/bin/bash') sleep(1) quit() except: print('err running pip3 install netifaces') quit() else: print(str('opening portal in ' + argv)) subprocess.Popen(str(argv + ' ' + str(target)), shell=True, executable='/bin/bash') sleep(1) quit() else: print(str('\n please visit address ' + target + ' in a browser to complete portal setup \n')) quit() main()
I haven't posted a Morning Metal on Soundcloud for a while- glad to break the lull. xD
Quickly & forcefully manage extra JDKs in base R
Simplify rJava woes
# get this script: wget https://raw.githubusercontent.com/Jesssullivan/rJDKmanager/master/JDKmanager.R
rJava is depended upon by lots of libraries- XLConnect, OpenStreetMap, many db connectors and is often needed while scripting with GDAL.
library(XLConnect) # YMMV
Errors while importing a library with depending on a JDK are many, but can (usually) be resolved by reconfiguring the version listed somewhere in the error.
On mac OSX (on Mojave at least), check what you have installed here- (as admin, this is a system path) :
sudo ls "/Library/Java/JavaVirtualMachines/
I seem to usually have at least half a dozen or more versions in there, between Oracle and openJDK. Being Java, these are basically sandboxed as JVMs and are will not get in each others way.
Unlike JDK configuration for just about everything else, aliasing or exporting a specific release to $PATH will not cut it in R. The shell command to reconfigure for R-
sudo R CMD javareconf
...seems to always choose the wrong JDK. Renaming, hiding, otherwise trying to explain to R the one I want (lib XLConnect currently wants none other than Oracle 11.0.1) is futile.
The end-all solution for me is usually to temporarily move other JDKs elsewhere.
This is not difficult to do now and again, but keeping a CLI totally in R for moving / replacing JDKs makes for organized scripting.
JDKmanager help: (args are not case sensitive) (usage: `sudo rscript JDKmanager.R help`) list :: prints contents of default JDK path and removed JDK path reset :: move all JDKs in removed JDK path back to default JDK path config :: configure rJava. equivalent to `R CMD javareconf` in shell specific JDK, such as 11.0.1, 1.8,openjdk-12.0.2, etc: searches through both default and removed pathes for the specific JDK. if found in the default path, any other JDKs will be moved to the `removed JDKs` directory. the specified JDK will be configured for rJava.
Visit the repo on Github here-
tested on Mac OSX 10.14.6
Emulates a variety of Raspian releases on proper ARM hardware with QEMU.
QEMU and wget (OSX homebrew)
brew install qemu wget
Get the Python3 CLI in this repo:
After the first launch, it will launch from the persistent .qcow2 image.
With no arguments & in a new folder, Raspian "stretch-lite" (no desktop environment) will be:
sudo python3 QEMU_Raspian.py
prints CLI usage help
removes ALL files added in dir with QEMU_Raspian.py
uses standard graphical stretch release with GUI
for stretchlite release [default!]
for standard graphical buster release [YMMV]
for busterlite release [YMMV]
# examples: sudo python3 QEMU_Raspian.py busterlite python3 QEMU_Raspian -h # print help
Burn as .img:
qemu-img convert -f qcow2 -O raw file.qcow2 file.img