Sunday, February 28, 2016

What have I been reading this week? (20160228)

A double post this week. I missed last week, due to spending the first half in DC (during horrible weather). I'm still a bit Docker-focused, attemtping to get certain programs to run a certain way, so that they can be considered "portable".

Floppy (over on Dangerous Prototypes) posted a firmware update to the USB IRToy. I've installed it and (knock on wood), it appears to be working better than v.22 and v.23, which typically crashed after 15-30 minutes of being idle. It's passed the 30-minute mark so far. The bad news is that some people are still having trouble with it. I'm hoping that it may be because they've not modified the suspend settings on their internal USB hubs. I'm using an external, powered hub. Fingers crossed!

The mods to the Document Management System (DMS) are something that I should have done a couple years ago. What took me a month to complete (last year) now only takes a weekend to perform. The mods include: title guesser, URL guesser, and drag/drop uploading. The title and URL guessers take advantage of the fact that most of my PDFs are generated by the PrintFriendly service, which produces PDFs in a very specific format. (Note: I recommend the webs-based service over the browser app as it produces a prettier output.)

In any case, what I've been reading in the last couple weeks...

2016-02-15

- How to become a Bayesian in eight easy steps
- Make VM run like Container
- Beginner's Guide to Fuzzing Part 1: Simple Fuzzing with zzuf
- Top Machine Learning Data Mining & NLP Books that Every Data Scientist Should Read
- How to learn JavaScript
- A Gentle Introduction to Secure Computation
- Media goes gaga over study showing women code better than men. Here's what's unsaid.
- SourceForge Acquisition and Future Plans
- Before You Get Too Excited About That GitHub Study
- Phone Hacking Group Is Trading Fake Bomb Threats For Bitcoin
- Supercapacitor-On-a-Chip Now One Step Closer

2016-02-16

- Stealing Decryption Key from Air-Gapped Computer in Another Room

2016-02-18

- Why you should stop worrying about deep learning and deepen your understanding of causality instead
- There is no tech talent shortage: unlocking trapped programmers
- Polish codebreakers 'cracked Enigma before Alan Turing'

2016-02-19

- The missing link of artificial intelligence
- Docker goes rootless -- and that's a good thing

2016-02-24

- Awesome Windows Exploitation Resources
- Self Hosted Git Service: Gogs

2016-02-25

- Import a Docker Container in Python
- You hear a voice in your head when you're reading right?
- Homeschooled Weirdoes and the Culture of Conformity

2016-02-26

- Report from the VMware GPL court hearing
- Type edit and format with your voice in Docs no keyboard needed!
- Coding Jarvis in Python in 2016

2016-02-27

- A relatively easy to understand primer on elliptic curve cryptography
- Curiosity depends on what you already know

Above was generated by a homegrown bolt-on script for Wallabag, which is a free utility for capturing web content so that it can be read later.

Saturday, February 20, 2016

Global Cache IP2IR

I won an eBay bid ($27) on a used Global Cache IR2IP device on Monday, paid for it on Tuesday, and had it in my hands on Friday. Because $27 is about 20% of the normal price, I was nervous that it wouldn't work.  Turns out, there's no issue with the box other than what the seller had noted.

Basically, the GC IP2IPR is an Ethernet-to-Infrared converter.  It has a web interface (for base conversion) and an operational interface on port 4998. I say "operational" as you can connect to it with a telnet client or a browser, but isn't really a telnet or web service (more later).

Shortcomings related to the purchase:

- no emitters
- no manual

The lack of emitters was solved by digging in my junk box.  The emitter from an old Tivo works nicely.  I'm think of purchasing more emitters from eBay or Amazon.

The lack of manual appears to be caused by the manufacturer, in that they don't send out manuals with their hardware (I just toss 'em anyways).  Instead, Global Cache's web site offers tutorials and an API document.  If you're going to write controls for any of Global Cache's devices, you most definitely should download a copy of the API document.

Even with the web site documentation, there's a slight learning curve involved with figuring out how to use the device.  After a reset (one of the things I really don't like on this device), you have to figure out the IP address for the device.  This wasn't that difficult as the device's MAC address is printed on the sticker on the bottom of the case.  You just need to consult your router's "Connected Devices" list.

Pointing a browser at the IP address gives you access to the web interface, where you can make configuration changes.  Please note that learning/sending IR codes are not done via this interface.

GC provides enough software and information (and sample code) to start experimenting with the device.  I think I like GC's "let others write the code" approach.  Various home automation programs already have controls written for the IP2IR device.

I experimented, using various of GC's software, until I figured out how to manage the IR from the command line (writing the controls are quite similar to the controls for my home-grown jukebox, which also uses a telnet-like interface).  I now have a handful of working "send" commands and I've put "write code for IR 'learning'" on my to do list.  I'll post my code on GitHub as they become clean enough for others' use.

While I really like the device, there are a couple annoying bits.  The first relates to the hole for the "learning" sensor and the factory reset.  Both the IR sensor and the factory reset reside behind that single, tiny hole in the case.  Where most products have a switch behind the hole (i.e., you push on one end of a pin while reseting the power), GC designed it such that you short out two pins.  If you push, you risk damaging the "learning" sensor.

The other (very minor) annoyance is the location of the "learning" sensor.  It's on the back of the case, wedged in between the jacks for the power and the first emitter.  The recommended distance for the "teaching" remote control is a quarter inch.  If you have cabling for Ethernet, power, and IR emitters all connected, accessing the back of the device and using a one quarter inch distance may be a bit difficult (I have very stiff Ethernet cables).

For the price of the used device ($27 vice the full $110+), this was most definitely a worthwhile purchase.  If the docs and user comments are to be believe, I now have a network-enabled IR interface that can learn and send just about any IR remote command.

Bonuses noted: While writing this, I noted the PoE sticker on the bottom of the device.  If I can find my PoE injector, I should be able to use the device without attaching the power wart.  (Note: the PoE version does have a power jack so that you can use the device where you don't have PoE.)  This also changes what I thought was a IP2IR model to a IP2IR-P.

Thursday, February 18, 2016

DMS status

Over the past few weeks, I've added the following features to the Document Management Solution:

- Source URL guesser - I heavily use PrintFriendly to capture web site articles.  It's PDF output includes the source URL in the first 100 lines of the PDF.  This is easily recovered via grep "/URI (http" --text -m1 filename.
- Title guesser - Somewhat less accurate than the above but still useful.  PrintFriendly's PDFs include the page title in the resulting filename (use the format of "site-title.pdf").  All it takes is trimming of the site name and switching underscores to spaces in the remaining filename.
- Drag and drop processing of files.
- Keyboard shortcuts to "press" various PrintFriendly buttons which are keyboard unfriendly (i.e., no shortcuts or search-able text associated with them).

The end result is approximately a 80-85% reduction in manual processing time.  Still to go:

- adding incremental indexing
- removing need for nightly full indexing
- adding "indexed" timestamp to record metadata

Monday, February 15, 2016

What have I been reading this week? (20160215)

I continue to be distracted by containerization technologies, so reading is a bit light. The bitlbee+all-available-plugins container appears to have gone as far as possible (without adding libpurple). At it's largest point, it was just shy of 2GB in size, but that was without removing the build directories (added to the to-do list).

In other news, the modification to the document management system has improved workflow by an order of magnitude. I managed to pass the 4,000 document mark without noticing (I noticed at around document #4050). In any case, following is this week's reading...

2016-02-09

- How to win at Monopoly and piss off your friends

2016-02-11

- The Princeton Bitcoin textbook is now freely available
- The chips are down for Moore s law
- Irving Avenue and Moffat Street Queens
- Why the World's Dumbest Hackathon Is Also Its Best
- An old-school reply to an advertiser's retro threat
- Why Stack Overflow Doesn't Care About Ad Blockers
- The Sad State of C Strings

2016-02-12

- StevenBlack/hosts

2016-02-13

- For gifted children being intelligent can have dark implications
- Scientists have found a way to help you learn new skills twice as fast
- Barcode attack technique: Drops

Above was generated by a homegrown bolt-on script for Wallabag, which is a free utility for capturing web content so that it can be read later.

Wednesday, February 3, 2016

Closing Chrome's download shelf

Was playing with XWarpPointer and XQueryPoint Monday evening and came up with a way to close Chrome's download shelf without having to run XWarpPointer 4 times. Hint: it requires declaring the Window to avoid having to employ relative positions. See the man page for an explanation.

Basically, what the below does is fake a mouse click at a specific location on the screen. Coupling it with a function key or Gleebox (I use both), I can close the annoying download shelf without having to touch the mouse.

// compile with: gcc -lX11 -o cdl cdl.c

#include <X11/Xlib.h>
#include <stdio.h>
#include <string.h>

int main() {

 // determine the location of the close button by running
 // xdotool getmouselocation
 // following values are for my display

 int button_x = 1661;
 int button_y = 1005;

 //create a field in which mouse can operate

 Display *mousefield = XOpenDisplay(NULL);
 //return error if above didn't work
 if (mousefield == NULL) {
  return -1;
 }

 // find the proper window

 Window root_window;
 root_window=XRootWindow(mousefield,0);

 //determine current location of mouse

 XEvent event;
 XQueryPointer(mousefield, DefaultRootWindow(mousefield), &event.xbutton.root, &event.xbutton.window, &event.xbutton.x_root, &event.xbutton.y_root, &event.xbutton.x, &event.xbutton.y, &event.xbutton.state);
 int original_x=event.xbutton.x;
 int original_y=event.xbutton.y;

 // move the pointer to the location of the close button
 // assumes window is full screen
 // see https://tronche.com/gui/x/xlib/input/XWarpPointer.html for explanation

 // move pointer to xbutton

 XWarpPointer(mousefield, None, root_window, 0, 0, 0, 0, button_x, button_y);

 // click & release the button

 XEvent event2;
 memset (&event2, 0, sizeof(event2));
 event2.xbutton.button = Button1;
 event2.xbutton.same_screen = True;
 event2.xbutton.subwindow = DefaultRootWindow(mousefield);
 while(event2.xbutton.subwindow) {
  event2.xbutton.window=event2.xbutton.subwindow;
  XQueryPointer(mousefield, event2.xbutton.window, &event2.xbutton.root, &event2.xbutton.subwindow, &event2.xbutton.x_root, &event2.xbutton.y_root, &event2.xbutton.x, &event2.xbutton.y, &event2.xbutton.state);
 }
 event2.type=ButtonPress;
 XSendEvent(mousefield,PointerWindow,True,ButtonPressMask,&event2);
 event2.type=ButtonRelease;
 XSendEvent(mousefield,PointerWindow,True,ButtonReleaseMask,&event2);
 
 // put the mouse back where you found it

 XWarpPointer(mousefield, None, root_window, 0, 0, 0, 0, original_x, original_y);

 // kill the field created above

 XCloseDisplay(mousefield);
 return 0;
}

Monday, February 1, 2016

What have I been reading this week? (20160201)

Apologies for the delayed post. Have been down hard for a few days with cold/flu. Spent most of weekend sleeping and writing a web front-end to Docker.

2016-01-29

- Political speech generator (github)
- The Dark Side of Cryptography: Kleptography in Black-Box Implementations
- Walmart's OneOps

2016-01-30

- Dean for graduate education to take leave start new university

2016-01-31

- TiddlyWiki: A free open source wiki revisited

Above was generated by a homegrown bolt-on script for Wallabag, which is a free utility for capturing web content so that it can be read later.