Tuesday, February 14, 2012

Google Chrome, Linux (selinux), and Google Docs "Aw, Snap!"

For people getting an "Aw, Snap!" when opening Google docs in Google's Chrome browser (OS is Linux, with selinux enabled, can be determined by running "getenforce"), you should be able to fix this by running the following :



grep chrome /var/log/audit/audit.log|audit2allow -M chromepolicy

This will greate a chromepolicy.pp file in the current directory.  It is a binary file, so don't panic if you less or vi the file and can't read it.  It basically spits what was being denied by selinux through audit2allow to create the policy.

Once done, it prints this nice little line :

[root@cyanide var]# grep chrome /var/log/audit/audit.log|audit2allow -M chromepolicy******************** IMPORTANT ***********************
To make this policy package active, execute:

semodule -i chromepolicy.pp

[root@cyanide var]

That "semodule -i chromepolicy.pp" line is the new key to making it work.  If you then run that, it will allow Chrome to do the things it's been denied.  This is a better option for those that want to keep selinux enabled.  (Disabling it is bad if you don't trust people around you.)

Friday, February 10, 2012

Arduino : Interrupt-Driven Alarm System

Okay, I have now figured out how to do the interrupt-driven arduino alarm system, using a series of diodes for each input. I also found out that the resistors were pointless, as the inputs on the arduino typically contain a pull-up or pull-down resistor already embeded on the device. It makes it quite nice to set up an input.
The code is available from  http://svn.silverhawk.net/files/interrupt_alarm.pde  , you just need an appropriate Arduino, the Ethernet Shield (with the SD card), a small prototyping board, wire, and some diodes.  It's configurable (on an SD card), and will connect to a server.  It uses encryption, so sniffing minds can't easily see what is being communicated (pretty effective PSK-based "algorithm" considering the low processing power of an Arduino - it's a simple PSK XOR mechanism).  If you need a schematic, let me know.  E-Mail address is in the code header.

Lumberjack - An open source logging mechanism

Hey;

Just as an announcement, after watching some non-opensource log mechanisms, I thought I'd give a shot at creating my own.  The source is available for free, though the code isn't exactly "open source".  I'll do what I can to get patches committed into the application, for other releases.  If this becomes a stable and enterprise-ready platform, I might just release the control of it into the opensource world.

You can obtain a copy of the source from :

http://www.silverhawk.net/files/lumberjack-0.1.tgz

Also, you can test it with the following instructions :


  1. First, compile, prepare, and launch :

    if [ -e Makefile ]; then make rmproper; fi && ./configure --modules-dir=modules && make && make modules && ./server/lumberjack -bd -f server/lumberjack.conf
  2. In another window, CD into clients, and compile the test client :

    make clean && make && ./followlog -v --no-daemon --verbose --type apache --path test/info.log --report-back plain://localhost:5820
  3. In a third window, add something to the log file :

    echo '['`date '+%a %b %d %H:%M:%S %Y'`']' - warning : work >> test/info.log