Skip to content

Instantly share code, notes, and snippets.

@scusi
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scusi/fbb9e238694465003bb7 to your computer and use it in GitHub Desktop.
Save scusi/fbb9e238694465003bb7 to your computer and use it in GitHub Desktop.
convert binary bpjm data from FritzBox routers into text files
#!/bin/sh
#
# USAGE:
# $> ./ConvertBinaryBpjmData.sh bpjm.data
#
RAWFILE=$1
OUTFILE=`strings $RAWFILE | head -n 1`
od -t x1 -An -j 64 $RAWFILE | tr -d '\n ' > $OUTFILE
sed -i -e 's/.\{66\}/&\n/g' $OUTFILE
sed -i 's/.\{32\}/& /' $OUTFILE
sed -i 's/.\{65\}/& /' $OUTFILE
echo "$OUTFILE written"
@scusi
Copy link
Author

scusi commented Oct 29, 2014

similar thing done in golang is available at: https://gist.github.com/scusi/5286e2a5a21c7ee99c13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment