Skip to content

Instantly share code, notes, and snippets.

View sukhodolin's full-sized avatar

Eugene Sukhodolin sukhodolin

View GitHub Profile

DW3000 "missing manual" notes

Overall

The DW3000 is an exciting part, available as a convenient Arduino-shield eval board with good distribution. HOWEVER, this is NOT a "maker friendly" part with SparkFun or Adafruit type tutorials and examples! It is a sophisticated radio that can be the heart of a positioning system, but you have to do quite a lot of heavy lifting to get there.

For basic use, the older-but-still-good DW1000 may be a better choice; interface libraries are available for Arduino and Raspberry Pi. Or look into packaged location-system vendors, like Estimote, Pozyx, Ubitrack and many others

find . -not -path '*/\.*' -type f -perm +a+x -exec chmod -x {} \;
import sys
fin = open(sys.argv[1], 'rb')
fout = open(sys.argv[1] + '.decrypted', 'wb')
fin.seek(256)
dataEnc = fin.read()
key = -1
for b in range(0, 256):
@sukhodolin
sukhodolin / ChangeAdapterState.vbs
Created September 21, 2015 00:56
Reset Network Adapter if connectivity is lost
If WScript.Arguments.Count = 2 Then
Adapter = WScript.Arguments.Item(0)
Action = WScript.Arguments.Item(1)
Else
Wscript.Echo "Usage: ChangeAdapterState.vbs AdapterName (Enable|Disable)"
Wscript.Quit
End If
Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter")
@sukhodolin
sukhodolin / DecodeCTX1.hs
Last active September 21, 2015 01:09
Decode CTX1 encoding
module Main where
import Data.Char
import Data.Word
import Data.Bits
import qualified Data.Text as T
import qualified Data.Text.Encoding as E
import Data.ByteString as B
import Data.ByteString.Char8 as BC
-- One more solution for
-- http://www.haskell.org/haskellwiki/99_questions/Solutions/7
-- that works for infinite input too (i.e. it's lazy in its input)
data NestedList a = Elem a | List [NestedList a]
get1st :: NestedList a -> (Maybe a, Maybe (NestedList a))
get1st (Elem e) = (Just e, Nothing)
get1st (List []) = (Nothing, Nothing)
get1st (List (l : ls)) = let (e, l') = get1st l