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
| var mqtt = require('mqtt'); | |
| mqtt.createConnection(1883, 'localhost', function(err, client) { | |
| if (err) { | |
| console.dir(err); | |
| return process.exit(-1); | |
| } | |
| var events = ['connack', 'puback', 'pubrec', 'pubcomp']; |
| ::APP_CONFIG = {} | |
| ignore = [:database] | |
| Path.glob("#{Rails.root}/config/*.yml") do |f| | |
| key = File.basename(f, '.yml').to_sym | |
| content = YAML.load_file(f)[Rails.env] | |
| ::APP_CONFIG[file] = content unless ignore.include? key | |
| end |
| 301,302c301,302 | |
| < x.endingDate opts[:end_date].strftime("%Y-%m-%dT%H:%M:%S") | |
| < x.startingDate opts[:start_date].strftime("%Y-%m-%dT%H:%M:%S") | |
| --- | |
| > x.endingDate opts[:end_date].strftime | |
| > x.startingDate opts[:start_date].strftime |
| node_modules |
| Post-install message from paperclip | |
| # NOTE FOR UPGRADING FROM PRE-3.0 VERSION # | |
| ################################################## | |
| Paperclip 3.0 introduces a non-backward compatible change in your attachment | |
| path. This will help to prevent attachment name clashes when you have | |
| multiple attachments with the same name. If you didn't alter your | |
| attachment's path and are using Paperclip's default, you'll have to add | |
| `:path` and `:url` to your `has_attached_file` definition. For example: | |
| has_attached_file :avatar, | |
| :path => ":rails_root/public/system/:attachment/:id/:style/:filename", |
| node_modules |
| java -Xms512m -Xmx1024m -cp "~/Library/Application Support/minecraft/bin/*" -Djava.library.path="bin/natives" net.minecraft.client.Minecraft "ohpenis" |
| ==> Installing zsh dependency: gdbm | |
| ==> Downloading http://ftpmirror.gnu.org/gdbm/gdbm-1.10.tar.gz | |
| File already downloaded in /home/adam/.homebrew/cache | |
| /bin/tar xf /home/adam/.homebrew/cache/gdbm-1.10.tar.gz | |
| ==> ./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/gdbm/1.10 --mandir=/usr/local/Cellar/gdbm/1.10/share/man --infodir=/usr/local/Cellar/gdbm/1.10/share/info --enable-shared | |
| ./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/gdbm/1.10 --mandir=/usr/local/Cellar/gdbm/1.10/share/man --infodir=/usr/local/Cellar/gdbm/1.10/share/info --enable-shared | |
| checking for a BSD-compatible install... /usr/bin/install -c | |
| checking whether build environment is sane... yes | |
| checking for a thread-safe mkdir -p... /bin/mkdir -p | |
| checking for gawk... no |
This script is specifically designed for reconstituting mp3s from the silly hash directories iDevices store their music in. It requires that the mp3s have working id3v2 tags, so use something like find . -name '*.mp3 -print0 | xargs -0Ixx id3v2 -C "xx" to convert them if they're in id3v1.
./extract.sh ~/music /media/IPOD/iPod_Control/Music