Multiple instances of LibreOffice in multiple monitor (multiple X session) machine
2015-Apr-11After a strange crash that I still can’t explain, I updated my video driver (nvidia) and could no longer function with Xinerama. Running 3 monitors with separate X screens is okay for my use for now – it is limited in that you can’t drag windows from one screen to another, but it also lets you swap workspaces in each screen individually.
I can handle not being able to drag windows between screens, but some applications really benefit from having different windows open – and they fall apart when you attempt to open separate windows in different screens. Firefox, and LibreOffice being top of my list.
Firefox works with separate profiles. Start the program with a -P once, define a new profile, and then you can have it prompt on startup each time. I may set up something like my LibreOffice fix later.
Programming Arduino Pro Mini with Bus Pirate
2015-Jan-04Program an Arduino Pro Mini 328 [sparkfun] board using a Bus Pirate.
I tried setting up the Bus Pirate as a transparent bridge for UART to use the Arduino boot loader. I got as far as manually sending 0x30 0x20, and receiving a 0x10 0x14 – establishing communication over UART… But couldn’t get the Arduino IDE to actually upload a program to it.
It turns out – version depending – that avrdude can use the buspirate as an SPI programmer.
http://dangerousprototypes.com/docs/Bus_Pirate_AVR_Programming
Bus Pirate I2C / I²C interface with a DS1307 RTC
2014-Nov-30I picked up a Bus Pirate and cable to help with troubleshooting and future projects. Conveniently, I am using an Adafruit Data Logging Shield for Arduino for a current project – which makes a perfect easy introduction to some of the communication with the Real Time Clock over I2C because the shield already has all of the supporting bits and pieces needed for the RTC.
WordPress Comment Spam
2014-Oct-06Not only are bots trying to beat on sshd, but they were also annoying me with comment spam.
Only 4 attempts per hour to talk to sshd so far. That will pick up.
$ uptime && iptables -vnL | grep tcp\ dpt\:22
11:29:15 up 18:45, 1 user, load average: 0.00, 0.01, 0.05
74 3456 DROP tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
Inspired by http://mywifequitherjob.com/how-to-prevent-comment-spam-from-crashing-your-wordpress-blog-and-taking-down-your-server/, I installed the Cookies for Comments WordPress plugin and made one tweak to my lighttpd.conf
$HTTP["url"] =~ "^/wp-comments-post.php.*$" {
$HTTP["cookie"] !~ ".*f88ca0021aa9ade19e8258a9d4637c66.*" {
url.access-deny = ( "" )
}
}
$HTTP["url"] =~ "^/wp-login.php.*$" {
$HTTP["cookie"] !~ ".*f88ca0021aa9ade19e8258a9d4637c66.*" {
url.access-deny = ( "" )
}
}
$HTTP["url"] =~ "^/xmlrpc.php.*$" {
url.access-deny = ( "" )
}
That’s the real cookie value for this site, this is what it’s for if you see it in the cookies list, and you can see where it shows up in the source code of this page. Bonus points when, after seeing some log entries for some of these, I realized it would also work for simple brute-force login robots as well. Scope creep as a feature!
If you are trying to GET/POST the comments .php file, AND you don’t have this cookie value set, then go straight to 403 Forbidden. Do not load php and jam up system resources, do not try to show a nice error message.
Will now go open up comments the way I wanted to originally and wait and see if this means problem solved or at least significantly reduced.
Future development, if it becomes more of a problem: Fail2ban, perhaps working an iptables tarpit.
Migrating WordPress blog to a new VPS
2014-Oct-06Lesson learned: stay away from service providers who try to be everything.
If the service provider thinks that being a domain name registrar, DNS host, web host, and email hosting are all one and the same “hosting” – R U N A W A Y. If you don’t – then you deserve everything you get, with interest. Including the extra advertising popup you are forced to step past in order to actually get into your account control panels.
The experiment to try a blog at a hosting company only lasted 4 months.
In the end, it took one SSL certificate to do them in. Their automation broke because they don’t host email for my domain, and some really bizarre ideas came up after their customer support discovered that they also didn’t host my DNS. Part of the extra confusion is my responsibility. I have a tendency to tell tech support people too much, and they have a tendency to focus intently on a detail that is most likely irrelevant to the issue at hand.
When compared to the hosted solution and the amount of effort I spent trying to communicate with customer service – it turns out I can spend less effort and, actually, also less dollars to manage my own VPS. While the initial set up effort is much higher, the ongoing maintenance effort is less and much more satisfying than dealing with confused support and still getting nowhere.
Anybody with a bit of whois-fu can dig up that the new provider is RamNode, well reviewed at http://lowendbox.com/. I even get much better latency from home to Seattle than Boston.
It’s much much too early to form an opinion about them because nothing’s gone wrong yet.
Migrating WordPress to a VPS
Get the VPS going
Individually controlling 1000 WS2812 pixels with an Arduino UNO
2014-Jun-302014-06-30 – This (both this post, and the project) is a work in progress. My lights are installed and controllable, the installation is being upgraded, and a better user interface is needed.
Wanted to get into some electronics, and I really need some form of end objective to get going on anything. The thermostat project that was going to be my debut into electronics and microcontrollers has a pretty ambitious scope that has been intimidating enough to procrastinate any serious work on.
When I saw the advertisement form sparkfun with some addressable RGB LED strips for sale (60 WS2812 pixels/m) – I decided to do something with those. With solution in mind, I went looking for a problem.
The crown around my living room has a perimeter around 17m, and I wanted some better lighting in there. At 60pixels/m, 1000 pixels works out to be a nice arbitrary round number that takes up enough space.
A test installation of a few strips from January:
Bluetooth Adapter ASUS USB-BT400
2014-Jun-16Edit 2014-10-09 – on Kali needed:
# apt-get install bluez-alsa
# apt-get install pulseaudio-module-bluetooth
# rmmod btusb
# insmod <path-to-file>/btusb.ko
# echo “0b05 17cb” >> /sys/bus/usb/drivers/btusb/new_id
(and then I had to *NOT* have the ~/.asoundrc file – pulseaudio picked it up once it had module-bluetooth-discover.so to play with)
I did modify /etc/bluetooth/audio.conf as listed below. Unsure if it was a part of the solution.
This audio drivers stuff in Linux always seems to be a seriously counterintuitive pain in the ass – and while I generally don’t mind learning some of the under the hood details, this I just want to work. Oh yeah – and trying to do it on a laptop……..
Driver doesn’t recognize the vendor/device combination in the version I have compiled. Can add after each boot by:
echo “0b05 17cb” >> /sys/bus/usb/drivers/btusb/new_id
Wasn’t the exact path on mine, but got me the next step forward. thanks
Did the below, managed to have “bluetooth” show up as a device in Audacity, and it works to play sound! asound -l and asound -L doesn’t show it for some reason. Not going to pursue further right now.
cat ~/.asoundrc pcm.bluetooth { type bluetooth device "XX:XX:XX:XX:XX:XX" profile "auto" }
- On the other laptop – I needed to remove the quotations from around the MAC address, and I removed the profile “auto” line to get it working. Alsa completely refused to do anything once it saw the above lines as-is.
- [General] section of /etc/bluetooth/audio.conf
Enable=Socket
~/.asoundrc
added
pcm.!default {
type plug
slave.pcm “bluetooth”
}
now it might be hard to get sound to NOT come out of the headset..
Yeastar NeoGate TG100
2014-Jun-02Summary
So far, this looks like it is going to be a decent little unit for what I want it to do.
Configuration through the web UI wasn’t a problem. I set up an account on the TG100 and configured my asterisk box to register to it. Once registered – both originating and terminating calls worked properly. I didn’t talk to myself long enough to judge call quality or to see if doing anything in the UI or on the device would load it up enough to impact call quality. Also did not try call waiting, multiple channels, or to see if any voicemail indications were passed through.
SMS didn’t work properly for me with the as-shipped firmware – they showed up in the UI looking corrupted. They have worked properly with the newest firmware (51.18.0.34 released 2014-05-15). It looks like you will either have to use the web interface, or code your own interface to the API to work with SMS messages. I did try sending an SMS while a voice conversation was active. It didn’t send the message until the voice call was over.
Having not used them very much, and it’s not likely the prepaid service I am using supports them anyhow – I didn’t try any MMS messages.
Their API for sending/receiving SMS messages uses the Asterisk Manager interface – with a couple tweaks to the manager permissions there is a lot of potential. With a root shell provided, those tweaks can probably be made. Continue reading
Replacing landline with GSM
2014-May-31I pay $32.17 a month for a landline that doesn’t see much use. Thank you <telco> for increasing this 7-9% every single year around September for the past three years. The majority of the actual use is telemarketers and survey takers calling me, being put through to my voicemail, and then them never leaving a message.
*Update 2014-06-25 – Received the latest bill. It’s now $32.50/month all-in. With no time like the present when you’re fired up about it already – I phoned <telco> right away to cancel the service. They immediately with no questions asked offered to chop the fees in half for a year. ~$15/month for 12 months, then $20/month afterwards (which would be plus fees and taxes). That’s pretty comparable to the $12.49-$18.82 that I expect be paying under the new regime. I want to think that it would be different if they had offered the lower rate on their own initiative based on my usage, but I’m not sure it would have been. It would have made a huge percentage impact on my initial cost/benefit – and while I would be less perturbed about their incessant fee increases I would probably have justified the capital cost as “It’s a project” and called it even with the same operating costs. OR maybe I’m just justifying it because I already spent the cash. Continue reading
Upgraded Flir E4
2014-May-19One of the tools I have available to me at work is a Fluke Ti55. It has proven itself as a highly useful predictive, and also a troubleshooting tool. While not certified, I am somewhat familiar with thermography – at least in an industrial setting.
Every once in a while I would look at the pricing for thermal imaging cameras, and they would be outlandishly beyond where I was willing to go. I was blown away by a teardown of the Flir E4, and then subsequent work in the community to tweak the firmware to get more functionality out of the hardware. The upgraded unit provides a high enough resolution image for the price that it was finally a worthwhile (to me) hobby purchase for home.
Lots of information available at http://www.eevblog.com/forum/testgear/flir-e4-thermal-imaging-camera-teardown/msg309194/#msg309194
Communicating to the camera with Windows XP inside a VirtualBox Instance
There were problems trying to work with the firmware because I don’t run any native windows machines at home. I ended up communicating with the camera with a Windows XP instance running inside a VirtualBox VM. There was a nasty rigamarole to get it going that I eventually figured out a procedure for that I don’t have handy anymore. It went something similar to:
- Delete Flir driver and the network interface it created in the WinXP VM
- Reboot VM, wait for it to be fully started up
- Plug in Camera, point it to the driver files
- only one chance to get it connected and upload/download firmware – then needed to wipe out the network interface again
For each of the firmware upgrade, and the additional menu modification I did a full power off on the camera, battery pull, then did the above all over again. Being upgraded, I’m leaving it alone now.
Images
The camera itself will only record still images – it will record the ‘thermal’ image (which actually includes the temperature scale and other popups inside the image) and optionally a copy of the visible image from the camera. It would be nice for it to store a pure thermal image like the Ti55 does – but it probably wouldn’t be too hard to do some kind of colour mapping after the fact to change the palette.
I thought the one ‘warmer than the rest’ breaker was the one driving the fan in my fan coil 24/7. Had a closer look afterwards, it’s actually the ACFI breaker supplying the bedrooms – one which is actually an office running computers. The GFCI outlet in the bathroom is also showing some heat and it isn’t loaded up. The temperature isn’t hot on these, just warmer than the surroundings, so I’m going to write this off as ‘must be normal’ for now.
Recording Video
The camera will stream images over USB. To record video on my laptop:
ffmpeg -f video4linux2 -r 3.5 -s 320×240 -i /dev/video1 test.avi
WordPress modifications
2014-May-19Trying a hosted blog for things I may want to refer to later and things that I want to share. Needed something with a proper backend – mostly for tagging and menu interfacing, and with an easy enough to use interface that it doesn’t impede putting out content that I want to.
The initial temptation was to fire up a new VPS, install all the individual packages, and really get it tweaked in exactly the way I wanted. Instead I’m trying a hosted platform, and only doing easy tweaks to it.
Internet items without a timestamp on them are almost as annoying as ones that use an ambiguous date format.
Modified content.php, added:
<?php echo get_the_date('Y-M-d H:i D'); ?>
Then later changed it to:
<?php echo get_the_date('Y-M-d'); ?>
Since the date/time is now at the top, also modify functions.php – function twentytwelve_entry_meta()
*2014-10-05 this is no longer the case, didn’t make this change with the change in hosts.
if ( $tag_list ) {
$utility_text = __( ‘This entry was posted in %1$s and tagged %2$son %3$s<span class=”by-author”> by %4$s</span>.’, ‘twentytwelve’ );
} elseif ( $categories_list ) {
$utility_text = __( ‘This entry was posted in %1$son %3$s<span class=”by-author”> by %4$s</span>.’, ‘twentytwelve’ );
} else {
// $utility_text = __( ‘This entry was posted on %3$s<span class=”by-author”> by %4$s</span>.’, ‘twentytwelve’ );
}