Skip to content

Instantly share code, notes, and snippets.

View fglaria's full-sized avatar
👾
Invading...

Felipe Glaría Grego fglaria

👾
Invading...
View GitHub Profile
@cryptolok
cryptolok / dbm2m.py
Last active August 19, 2023 12:29
convert WiFi signal strength (dBm) to distance (meters)
#!/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, ...) : ')
@tijnkooijmans
tijnkooijmans / crc16.c
Created April 17, 2014 12:53
CRC-16/CCITT-FALSE
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;
@Daeinar
Daeinar / gist:4383663
Created December 26, 2012 22:34
Install pip packages with homebrew
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