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 python2 | |
# a simple script for one of my articles - https://cryptolok.blogspot.com/2017/08/practical-wifi-hosts-triangulation-with.html | |
from math import log10 | |
MHz=raw_input('MHz FREQUENCY (2417, 5200, ...) : ') | |
MHz=int(MHz) | |
dBm=raw_input('dBm TRANSMITTER POWER (23, 63, ...) : ') |
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
uint16_t crc16(char* pData, int length) | |
{ | |
uint8_t i; | |
uint16_t wCrc = 0xffff; | |
while (length--) { | |
wCrc ^= *(unsigned char *)pData++ << 8; | |
for (i=0; i < 8; i++) | |
wCrc = wCrc & 0x8000 ? (wCrc << 1) ^ 0x1021 : wCrc << 1; | |
} | |
return wCrc & 0xffff; |
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
Install pip packages with homebrew: | |
1. Install Homebrew | |
http://mxcl.github.com/homebrew/ | |
2. Install the brew-pip package | |
brew install brew-pip | |
3. Add Homebrew's pip path to your PYTHONPATH environment variable (you probably should add this to some sort of shell initialization file like ~/.bashrc or ~/.zshrc) | |
export PYTHONPATH=$(brew --prefix)/lib/python2.7/site-packages | |
3. Now install any pip pacakges with Homebrew! | |
brew pip Glances |