This file contains 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
rem Batch script: how to check for admin rights | |
rem https://stackoverflow.com/a/11995662/1390788 | |
net session >nul 2>&1 | |
if not %ErrorLevel% == 0 ( | |
echo "ERROR: no administrative priviliges" | |
exit /b 1 |
This file contains 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
#!/usr/bin/env bash | |
# Enable SSH | |
touch /Volumes/boot/ssh | |
# Set up WiFi | |
cat << EOF > /Volumes/boot/wpa_supplicant.conf | |
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev | |
network={ | |
ssid="YOUR_SSID" |
This file contains 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
-- tested on HiLetgo NodeMCU v1.0 | |
-- requires modules: wifi, tmr | |
-- (and optionally gpio for blinky light) | |
local ssid = "ssid" | |
local password = "password" | |
local BLUE_LED = 4 | |
function connect_to_wifi(ssid, password) | |
wifi.setmode(wifi.STATION) | |
wifi.sta.config(ssid, password) |