Skip to content

Instantly share code, notes, and snippets.

View cstroie's full-sized avatar

Costin Stroie cstroie

  • Bitdefender
  • Bucharest, Romania
View GitHub Profile
sudo iw wlan0 scan | grep -io '\(^bss [^(]*\)\|\(signal: [-.0-9]*\)' | sed -e :a -e '$!N; s/\n/ /; ta' | sed 's/\.[0-9]\+ BSS /;/g' | sed 's/ signal: /,/g' | sed 's/BSS //g; s/\.00//g' | base64 -w 0 | xargs -I{} curl -v "http://api.mylnikov.org/geolocation/wifi?v=1.1&data=open&search={}"
/******************************* SOURCE LICENSE *********************************
Copyright (c) 2018 MicroModeler.
A non-exclusive, nontransferable, perpetual, royalty-free license is granted to the Licensee to
use the following Information for academic, non-profit, or government-sponsored research purposes.
Use of the following Information under this License is restricted to NON-COMMERCIAL PURPOSES ONLY.
Commercial use of the following Information requires a separately executed written license agreement.
This Information is distributed WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@cstroie
cstroie / pbf.c
Created May 3, 2018 10:49
Chebyshev 2025-2225Hz PBF (http://www.micromodeler.com/dsp/)
/******************************* SOURCE LICENSE *********************************
Copyright (c) 2018 MicroModeler.
A non-exclusive, nontransferable, perpetual, royalty-free license is granted to the Licensee to
use the following Information for academic, non-profit, or government-sponsored research purposes.
Use of the following Information under this License is restricted to NON-COMMERCIAL PURPOSES ONLY.
Commercial use of the following Information requires a separately executed written license agreement.
This Information is distributed WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
/******************************* SOURCE LICENSE *********************************
Copyright (c) 2018 MicroModeler.
A non-exclusive, nontransferable, perpetual, royalty-free license is granted to the Licensee to
use the following Information for academic, non-profit, or government-sponsored research purposes.
Use of the following Information under this License is restricted to NON-COMMERCIAL PURPOSES ONLY.
Commercial use of the following Information requires a separately executed written license agreement.
This Information is distributed WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@cstroie
cstroie / bin2bcd.c
Created April 11, 2019 14:04
bin2bcd
uint32_t bin2bcd(const uint16_t in) {
uint32_t out = 0;
for (uint8_t pos = 13; pos >= 0; pos--) {
if ((out & 0xF) >= 5)
out += 3;
if (((out & 0xF0) >> 4) >= 5)
out += (3 << 4);
if (((out & 0xF00) >> 8) >= 5)
out += (3 << 8);
out = (out << 1) | ((in >> pos) & 1);