aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspv <spv@spv.sh>2025-07-30 10:46:30 -0400
committerspv <spv@spv.sh>2025-07-30 10:46:30 -0400
commit030bd922eedddc71f514ca44d668d0370b5329e1 (patch)
tree8f002a17e6c8d843e4a85f4ab4a178d301278e58
parent636632b1d03f14c45911c1051d39ff01bd6f118a (diff)
last night's signal hack
-rwxr-xr-xsrc/dirty_hack.sh9
-rw-r--r--src/log_shit.py8
-rwxr-xr-xsrc/skid.sh2
3 files changed, 12 insertions, 7 deletions
diff --git a/src/dirty_hack.sh b/src/dirty_hack.sh
index 67691a3..6366d80 100755
--- a/src/dirty_hack.sh
+++ b/src/dirty_hack.sh
@@ -1,8 +1,11 @@
#!/usr/bin/env zsh
-mmcli -m any --location-get | # get location from modem manager
-grep "long\|lat\|alt" | # select only relevant lines
+(mmcli -m any --location-get;
+ mmcli -m any |
+ grep ignal |
+ cut -d'%' -f1) | # get location from modem manager
+grep "long\|lat\|alt\|ignal" | # select only relevant lines
cut -d':' -f2 | # remove colons,
cut -d' ' -f2 | # and leading spaces
tr '\n' ',' | # csv-esque
-cut -d',' -f1-3 # remove unwanted newline \ No newline at end of file
+cut -d',' -f1-4 # remove unwanted newline \ No newline at end of file
diff --git a/src/log_shit.py b/src/log_shit.py
index 7e5da43..295dc45 100644
--- a/src/log_shit.py
+++ b/src/log_shit.py
@@ -27,10 +27,12 @@ print("[i] we out here, yo", flush=True)
while (start + time_to_do_it) > now():
# print("we out here, yo", flush=True)
- lat, lon, alt = [float(x) for x in subprocess.getoutput("src/dirty_hack.sh").split(",")]
+ lat, lon, alt, sig = [float(x) for x in subprocess.getoutput("src/dirty_hack.sh").split(",")]
- print("[i] %f: %f, %f, %f" % (time.time_ns() / (10**9), lat, lon, alt))
- f.write("%f: %f, %f, %f\n" % (time.time_ns() / (10**9), lat, lon, alt))
+ sig /= 100
+
+ print("[i] %f: %f, %f, %f, %f" % (time.time_ns() / (10**9), lat, lon, alt, sig))
+ f.write("%f: %f, %f, %f, %f\n" % (time.time_ns() / (10**9), lat, lon, alt, sig))
f.flush()
diff --git a/src/skid.sh b/src/skid.sh
index 07cc305..9cc41c2 100755
--- a/src/skid.sh
+++ b/src/skid.sh
@@ -17,4 +17,4 @@ sleep 1
echo '[*] doing it.'
-python3 src/log_shit.py `date +%s`.log 1 600 \ No newline at end of file
+python3 src/log_shit.py log/`date +%s`.log 1 600 \ No newline at end of file