Privoxy on Android (with EC2 VPN)

This week’s challenge was getting a certificate-based VPN up on an Android phone, and getting all web traffic through a filtering proxy (Privoxy) to both scrub some of the ads from content, and obscure the IP address and location of the phone.

In my quest to forever banish ads and other unwanted content from all of my digital experience, I’ve discovered a number of things along the way: AdBlock (not to be confused with Adblock Plus), Ghostery (which stops tracking scripts/cookies), Privoxy (to altogether disable scripts by default on pages, as well as randomly set user-agent strings), Tab Cookies (to require opting-in to cookies per-site), and Proxy SwitchySharp (to allow easy Chromium-local toggling of proxy choice).

Now, the remaining frontier has been my phone. Considering it’s the medium for most lunchtime distraction and time-wasting exercises, I wanted to bring the Amazon EC2-based Privoxy service to it, by way of a VPN.

Continue reading Privoxy on Android (with EC2 VPN)

Find and edit matching files

As a programmer, sometimes I find myself doing some repetitive thing and eventually it occurs to me to automate that thing. Now is one of those moments, and the repetitive thing is searching a code base for a symbol and opening one of the matches in my favorite text editor.

The sequence usually goes like this:

  • (comes across symbol myFunction) Oh! I wonder where that lives?
  • (opens another tab in screen) grep -rnsI myFunction
  • Oh! it lives in widgets/retro_encabulator.js!
  • vim widgets/retro_encabulator.js
  • /myFunction<enter>
  • so on…

Continue reading Find and edit matching files

Execute process only when away

As an improvement of streaming motion detection video to the cloud, it’d be great to do this only when I’m away. A simple bash script installed as a cron job can ping a cell phone every couple minutes, and if successful, make sure the motion process isn’t running. If the phone is unreachable, the process is started.

This is contingent on having the phone’s WiFi feature on, telling the DHCP server to always assign it the same address, and setting power saving features to keep WiFi on when in sleep mode. In time, I’ll know whether this heavily impacts battery lifetime.

Additionally, the whole function of this will only take place if the second video device, /dev/video1, is present.

Continue reading Execute process only when away

Off-site CCTV backup part 2

In part 1 of this series, I demonstrated how IP security cameras could be used to upload once-per-minute snapshots via FTP, over an IPsec tunnel to an Amazon EC2 instance. The EC2 takes care of compressing the generated series of images into daily time-lapse videos, which can be used as a second layer of security for monitoring premises. Continue reading Off-site CCTV backup part 2

Off-site backup of CCTV using the cloud

Having a camera security-system (“CCTV”) can be great for loss prevention, deterring crime, and providing physical evidence when something goes amiss. Many companies use surveillance cameras connected to a DVR device to store video on-site. Of course, having the DVR in a lock-box can only go so far to protect against catastrophic accidents, and sometimes it’s desirable to have offsite backups. Continue reading Off-site backup of CCTV using the cloud

MikroTik to AWS EC2 instance IPsec tunnel

This topic is worthy of a post, if only because there wasn’t much documentation out there on getting this working. I just wanted to link an Amazon EC2 instance running Ubuntu server, to a MikroTik RouterOS device. Configuration required a bit of tweaking, and I wouldn’t expect the configuration below to work on every setup. Continue reading MikroTik to AWS EC2 instance IPsec tunnel

Auto-archiving ZoneMinder recordings to video files

While ZoneMinder (www, github) is a great free and open-source surveillance camera software suite, it still lacks in some aspects. One of these is in its storage/transcoding of input video into series of JPEG images. This limits the amount of compression achieved by the system, such that a system with a high number of cameras must have a significant amount of storage to store history video past a few days. Continue reading Auto-archiving ZoneMinder recordings to video files

Two-factor authentication with MikroTik, xinetd, and gmail

Sometimes setting up a VPN may be overkill for the requirements of remote access, and in that case there are secure alternatives to opening a firewall port to the outside world. My introduction to MikroTik devices came with the requirement that a client have employees accessing their office computers via. remote desktop, and I arrived at using SSH tunneling for the task due to the security offered, along with simplicity of setup on the end user’s computers. Since then, multiple client have adopted these low-cost routers for similar uses. Continue reading Two-factor authentication with MikroTik, xinetd, and gmail

A mobile charging cradle for the Xperia Z

This is an extension of a previous project, a charging station for the Xperia Z. I decided it would be nice to have hassle-free charging in the car, as well as a base to hold the phone in a favorable position for seeing navigation.

The design in CAD software
The design in CAD software

The new design was made to partially enclose the phone (with its protective case) and have two pogo pins to hit the charging contacts on the side, making it virtually effortless to hop in the car and charge the phone without plugging anything in.

Instead of designing the dock with a specific car or mounting system in mind, I placed two holes matched to the diameter of a wire coat hanger. This allows a mount to be created and modified after the fact, and makes it possible to use the dock in another car without printing another one.

Also this time, instead of using a USB breakout board, I hacked the end off a USB cable, made a channel for the cable in the design, and used a knot in the cable as a strain relief.

Bottom view

Top view

With bracket

The quality of the print was much higher due to using a well-tuned Ultimaker instead of the aging Makerbot used for the last print.

Files for this project: SolidWorks filePDF Drawing, STL file.