Skip to content

Instantly share code, notes, and snippets.

View RedRockerSE's full-sized avatar
🤟
Working

Magnus Jonsson RedRockerSE

🤟
Working
View GitHub Profile
@RedRockerSE
RedRockerSE / showWLAN.py
Last active March 19, 2024 15:01
Saves visible WLAN and known profiles to textfiles.
import subprocess
import os
outputFilename = "netsh_wlan.txt"
outputFilenameProfiles = "netsh_wlan_profiles.txt"
netshcmd = subprocess.Popen("netsh wlan show networks mode=bssid",shell=True, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
output, errors = netshcmd.communicate()
result = subprocess.run([r'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe', r'.\wlanprofiles.ps1'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
#### User ####
# Add user.
useradd -m username
# -m creates a home directory for the user.
# Set Password.
passwd username
# Set user group to sudo.
usermod -a -G sudo username