DRIVE IT YOURSELF: USB CAR

What we are going to do is a basic variant of a process generally known as reverse engineering. You start examining the device with common tools (USB is quite descriptive itself). Then you capture the data that the device exchanges with its existing (Windows) driver, and try to guess what it means. This is the toughest part, and you’ll need some experience and a bit of luck to reverse engineer a non-trivial protocol.

via DRIVE IT YOURSELF: USB CAR | Linux Voice.

Windows 10 to make the Secure Boot alt-OS lock out a reality

At its WinHEC hardware conference in Shenzhen, China, Microsoft talked about the hardware requirements for Windows 10. The precise final specs are not available yet, so all this is somewhat subject to change, but right now, Microsoft says that the switch to allow Secure Boot to be turned off is now optional. Hardware can be Designed for Windows 10 and can offer no way to opt out of the Secure Boot lock down.

via Windows 10 to make the Secure Boot alt-OS lock out a reality | Ars Technica.

Universal Music Hijacks YouTube Videos of Indie Artist

Apparently UMG has the rights to an audiobook that uses Lynne’s music track “Kingdom of the Persians” as background music. This isn’t a problem, as his music can be freely used as long as the license fees are paid.

However, UMG have entered the audiobook in YouTube’s Content-ID system, and as a result they’ve hijacked the ads on the original video. Making matters even worse, UMG also rejected Lynne’s dispute through YouTube after he explained the situation.

via Universal Music Hijacks YouTube Videos of Indie Artist | TorrentFreak.

ffmpeg – encode video in reverse?

Dump all video frames

$ ffmpeg -i input.mkv -an -qscale 1 %06d.jpg

Cat video frames in reverse order to FFmpeg as input
$ cat $(ls -t *jpg) | ffmpeg -f image2pipe -vcodec mjpeg -r 25 -i - -i backwards.wav
-vcodec libx264 -vpre slow -crf 20 -threads 0 -acodec flac output.mkv

via ffmpeg – encode video in reverse? – Stack Overflow.

The above ffmpeg command examples turned out to be very useful.  Previously I had to do this manually in Avidemux.

The output of my IP camera is VGA 640×480 and I needed to slice that up into a  10×10 array of little areas  (100 jpeg files) using the following:

convert input.jpg -crop 64x48  +repage  +adjoin  myoutputfile_%02d.jpg

Motion detect reveals a lot of false positives which must be filtered out manually.  In order to automate this I  compare time n to time n+1 in only a couple of the 100 little jpegs separated in the above command.   So far I’m using this:

compare -metric MAE time_n_number.jpg time_n+1_number.jpg  null: 2>&1

A changed portion of the jpeg will generate a high number which can be compared to a threshold in a script allowing me to eliminate most all false positive motion detects.

More detailed explanation for the Image compare commands in the ImageMagick package can be found here:

ImageMagick v6 Examples –Image Comparing

Therefore my entire process consists of separating the video into jpegs, finding changes in areas where there shouldn’t be changes and if not reassembling the jpegs back into a video file again all done automatically via bash scripting.

There probably are more elegant solutions but this works for now.

Counting Legal Positions in Go

The computation uses dynamic programming to count the number of paths through a graph consisting of 18^2=324 layers with up to 81 billion nodes each. Each node corresponds to a set of partial board (e.g. the top 7 rows plus 6 points on the 8th row) positions that are equivalent in their set of valid completions. Our paper explains the algorithm in detail, and also explains how the resulting exact counts allow derivation of the approximation formula

L(m,n) ~ 0.850639925845714538 * 0.96553505933837387^{m+n} * 2.97573419204335724938^{m*n}

which gives us the approximate number of legal positions on a standard board size

L(19,19) ~ 2.08168199381982*10^170

via Counting Legal Positions in Go.

Thanks to the Chinese Remainder Theorem, the work of computing L(19,19) can be split up into 9 jobs that each compute 64 bits of the 566-bit result. Allowing for some redundancy, we need from 10 to 13 servers, each with at least 8 cores, 512GB RAM, and ample disk space (10-15TB), running for about 5-9 months.

The SSD Endurance Experiment: They’re all dead

The SSD Endurance Experiment represents the longest test TR has ever conducted. It’s been a lot of work, but the results have also been gratifying. Over the past 18 months, we’ve watched modern SSDs easily write far more data than most consumers will ever need. Errors didn’t strike the Samsung 840 Series until after 300TB of writes, and it took over 700TB to induce the first failures. The fact that the 840 Pro exceeded 2.4PB is nothing short of amazing, even if that achievement is also kind of academic.

via The SSD Endurance Experiment: They’re all dead – The Tech Report – Page 4.

If you write a lot of data, keep an eye out for warning messages, because SSDs don’t always fail gracefully.

Concatenate MP4 files using FFMPEG

There are two methods within ffmpeg that can be used to concatenate files of the same type: the concat ”demuxer” and the concat ”protocol”. The demuxer is more flexible – it requires the same codecs, but different container formats can be used; and it can be used with any container formats, while the protocol only works with a select few containers. However, the concat protocol is available in older versions of ffmpeg, where the demuxer isn’t.

via Concatenate – FFmpeg.

I needed a way to concatenate mp4 files generated from all the IP cameras connected to the open wifi.  I tried compiling MP4Joiner but there were way too many dodgy dependencies throwing code errors in the compile.  Then I read that simple ffmpeg, a package easily loaded onto a Linux box, can merge mp4 files and it works.  Unfortunately concat only works on later Fedora releases like Fedora 19 and above but it’s easier than manually merging them in Avidemux.  My main server still runs Fedora 14 for many reasons so merging them simply requires running a command manually in a Fedora 19 or above Virtual Machine.  In the future when I migrate to a later release this can all be scripted seamlessly.

Here’s more as to how it’s done in ffmpeg…

Create a file mylist.txt with all the files you want to have concatenated in the following form (lines starting with a # are ignored):

# this is a comment
file '/path/to/file1'
file '/path/to/file2'
file '/path/to/file3'

Note that these can be either relative or absolute paths. Then you can stream copy or re-encode your files:

ffmpeg -f concat -i mylist.txt -c copy output

The US’s First Offshore Wind Farm Will Slash Local Power Prices by 40 Percent

Five floating turbines will be built off the coast of the island, which currently relies on diesel generators for its power—and pays a dollar more per gallon than the mainland does to get it. Those turbines will be connected to an undersea power cable that links not just the island, but to the US mainland.

The result will be a huge price drop in the islanders’ electricity bills, and an influx of clean energy piped into the grid from across the sound. The 30 megawatt plant is expected be generating power for thousands of New England homes by fall next year.

via The US’s First Offshore Wind Farm Will Slash Local Power Prices by 40 Percent | Motherboard.

Linux Containers

linuxcontainers.org is the umbrella project behind LXC, LXD, LXCFS and CGManager.

The goal is to offer a distro and vendor neutral environment for the development of Linux container technologies.

Our main focus is system containers. That is, containers which offer an environment as close to possible as the one you’d get from a VM but without the overhead that comes with running a separate kernel and simulating all the hardware.

via Linux Containers.

Fault Tolerant Router

Fault Tolerant Router is a daemon, running in background on a Linux router or firewall, monitoring the state of multiple internet uplinks/providers and changing the routing accordingly. LAN/DMZ internet traffic (outgoing connections) is load balanced between the uplinks using Linux multipath routing. The daemon monitors the state of the uplinks by routinely pinging well known IP addresses (Google public DNS servers, etc.) through each outgoing interface: once an uplink goes down, it is excluded from the multipath routing, when it comes back up, it is included again. All of the routing changes are notified to the administrator by email.

via  Fault Tolerant Router