A couple of scripts for publishing the state of an openwrt router to mqtt.
Relies on mosquitto_pub and mosquitto_sub being present
Init.d scripts including one to start a pair of file monitors and one to publish whether or not the router is onlien
| <?php | |
| /** | |
| * Convert a QuickBooks QBXML Report to HTML/CSV File | |
| * | |
| * I created this little script to help me read through the raw XML responses | |
| * from QuickBooks. I originally built it to export to a CSV file, but found | |
| * that a simple HTML table was better suited for my usage. However, I've | |
| * included the CSV code below for anyone who may need that functionality. | |
| * |
| #!perl | |
| use strict; | |
| use warnings; | |
| use Test::More; | |
| my $actual_uuid = '1F00B3E0-00C6-0800-2C4A-BCAEC5280EAD'; | |
| my $ipxe_uuid = 'e0b3001f-c600-0008-2c4a-bcaec5280ead'; |
| mutate { | |
| # Rename some fields into something more useful | |
| type => "eventlog" | |
| rename => [ "Message", "@message" ] | |
| rename => [ "Severity", "eventlog_severity" ] | |
| rename => [ "SeverityValue", "eventlog_severity_code" ] | |
| rename => [ "FileName", "eventlog_channel" ] | |
| rename => [ "SourceName", "eventlog_program" ] | |
| rename => [ "SourceModuleName", "nxlog_input" ] | |
| rename => [ "CategoryNumber", "eventlog_category" ] |
| input { | |
| tcp { | |
| type => "syslog" | |
| host => "127.0.0.1" | |
| port => 3514 | |
| } | |
| tcp { | |
| type => "eventlog" | |
| host => "10.1.1.2" | |
| port => 3515 |
| #!ipxe | |
| # Get the ISO from | |
| # http://www.helenos.org/download | |
| # and unpack the files in /boot/ to the directory | |
| # where this file is placed | |
| # (note that you have to enable more than 8 modules | |
| # for multiboot) | |
| kernel kernel.bin |
| //#undef PXE_STACK /* PXE stack in iPXE - you want this! */ | |
| //#undef PXE_MENU /* PXE menu booting */ | |
| //#undef DOWNLOAD_PROTO_TFTP /* Trivial File Transfer Protocol */ | |
| #undef SANBOOT_PROTO_ISCSI /* iSCSI protocol */ | |
| #undef SANBOOT_PROTO_AOE /* AoE protocol */ | |
| #undef SANBOOT_PROTO_IB_SRP /* Infiniband SCSI RDMA protocol */ | |
| #undef SANBOOT_PROTO_FCP /* Fibre Channel protocol */ | |
| #undef CRYPTO_80211_WEP /* WEP encryption (deprecated and insecure!) */ | |
| #undef CRYPTO_80211_WPA /* WPA Personal, authenticating with passphrase */ | |
| //#undef CRYPTO_80211_WPA2 /* Add support for stronger WPA cryptography */ |
| <?php | |
| // STEP 1: read POST data | |
| // Reading POSTed data directly from $_POST causes serialization issues with array data in the POST. | |
| // Instead, read raw POST data from the input stream. | |
| $raw_post_data = file_get_contents('php://input'); | |
| $raw_post_array = explode('&', $raw_post_data); | |
| $myPost = array(); | |
| foreach ($raw_post_array as $keyval) { |
| <?php | |
| /** | |
| * Copyright (c) 2007, Roger Veciana | |
| * All rights reserved. | |
| * | |
| * Redistribution and use in source and binary forms, with or without | |
| * modification, are permitted provided that the following conditions are met: | |
| * | |
| * Redistributions of source code must retain the above copyright notice, this |
| # Based on details from http://pubs.vmware.com/vsphere-50/index.jsp?topic=%2Fcom.vmware.vsphere.upgrade.doc_50%2FGUID-2F0D4696-3681-4C13-9552-5280C6406376.html | |
| set base-url http://XXX.XXX.XXX.XXX/ | |
| kernel ${base-url}tboot.b00 | |
| imgargs tboot.b00 ks=${base-url}ks.cfg | |
| module ${base-url}b.b00 | |
| module ${base-url}useropts.gz | |
| module ${base-url}k.b00 | |
| module ${base-url}a.b00 | |
| module ${base-url}s.v00 | |
| module ${base-url}weaselin.v00 |