Converting DeWalt DCB101 110V charger to 240V

Here is how I converted north American Dewalt DCB101 to proper supply voltage (warning: do it at your own risk).
I have made this conversion based on many internet forum posts and youtube videos.
Note: there are at least two versions of this charger and newer version requires rewinding the transformer (at least according to internet).

Why? For some stupid reason 240V chargers locally cost 2 to 3 times more than in USA.

Continue reading Converting DeWalt DCB101 110V charger to 240V

Opus BT-C100 reverse polarity protection

I recently bought an Opus BT-C100, as unlike my other Lithium Ion chargers, has a discharge test feature. It also fairly quickly estimates internal resistance of the cell, which is a good health indicator.

Unfortunately due to A123 26650 cell being of upside down construction I released the magic smoke out of the Opus BT-C100 by reversing polarity. The smoke escaped through the battery holder slit.

Continue reading Opus BT-C100 reverse polarity protection

Unbricking Asus Chromebox CN60

Asus CN60 is a good platform to re-purpose to run vanilla Linux on, since they come with decent CPU, while RAM can be upgraded to 16GB, and SSD to 512GB.

Unfortunately out of the box they come locked down by Google, with non-standard BIOS/UEFI, making it not possible to wipe the useless ChromeOS in favour of something like Ubuntu.

Fortunately there is a way to un-Google-fy it.

Continue reading Unbricking Asus Chromebox CN60

Dealing with data obfuscation in some Chinese dash cameras

This is post relates to the extracting GPS coordinates form Novatek based dash cameras.

About an year ago I was contacted by someone who tried to use my script on MP4 files generated by their camera, only to get garbage data out. It appeared that the camera was obfuscating the coordinates stored in MP4 (the speed and heading was recorded correctly). It was not a bug because provided player was decoding them correctly.

Continue reading Dealing with data obfuscation in some Chinese dash cameras

GT06E GPS Tracker Part 2: Establishing connection

This is a continuation from Part 1.

As of writing this I already had complete solution (as far as getting tracking data is concerned), a multi-process TCP server with a mysql database back-end.
The server code itself is not pretty thus I am cautious about sharing it at this stage (I will “open-source” it once I cleaned it up).

One caveat: my solution does not support batch mode (where the payload contain multiple concatenated location and other packets).

The assumption is that the reader is somewhat familiar with python and sockets.

Continue reading GT06E GPS Tracker Part 2: Establishing connection

Hate ads on your smart phone? Pi-hole it permanently!

Sorry about spammy headline ;).

Below I will describe how I got rid of ads on my android phone without rooting it.
It is very easy to get rid of ads on an android smart phone if you have root access. Unfortunately pesky manufacturers insist on declining warranty if the phone is rooted.
I will probably one day test this is in small claims court for a cheaper phone. I digress…

The requirements:

  • Some linux box/container/VM. In this post I used Ubuntu 16.04 LTS
  • Public IP on the box from above
  • Some linux/cli/unix experience

How does it work?

  1. Smart phone connects to the Linux box via OpenVPN
  2. Linux box is running Pi-hole which acts as a selective DNS server
  3. ???
  4. Proft!

Continue reading Hate ads on your smart phone? Pi-hole it permanently!

Simple IMAP to IMAP migration/sync tool

I had a need for a simple IMAP to IMAP sync tool, yet the only useful things I could find were offlineimap and imapsync.
The offlineimap is too complex and does not exactly do what I want; while the latter went commercial and not is not a clean install (requires messing with CPAN/perl libraries).

How hard can it be to write one?

Here it is:
imap2imap.py

The configuration is fairly simple (and self explanatory):

imap2imap.conf


hostname=outlook.office365.com
username=microsoftsucks@example.com
password=hunter12
trash=Deleted Items
#movetotrash=yes
#delete=yes

[destination]
hostname=imap.gmail.com
username=dontbeevil@gmail.com
password=hunter12

Here how it works:

It logs in into both IMAP servers and basically copies (with optional source deletion) the messages across. It also avoids duplication by checking Message-ID header. It should be stable enough to “daemon”-ify.

Here is a systemd unit for it (if one wants it to run all the time):

/etc/systemd/system/imap2imap.service

[Unit]
Description=IMAP to IMAP sync tool
After=network.target

[Service]
Type=simple
User=nobody
WorkingDirectory=/usr/local/bin/
ExecStart=/usr/local/bin/imap2imap.py
Restart=on-failure

[Install]
WantedBy=multi-user.target