ClearOS HTTPD & Reverse Proxy

I already host a few domains on my ClearOS box with no problems, but they are all hosted on the Clear box itself. I recently had the need to point a subdomain to another machine on my network. In Apache2 this is reverse proxy (pointing a domain/subdomain to an internal IP address). A few Googles here and there and all I could find was a few 3-4 year old posts regarding the topic. It mentions installing and building Pound, and a few other options. None of those seemed to be right. A bit more Googling and I finally found it. Its super easy.

All I had to do was modify my existing /etc/httpd/conf.d/flex-80.conf file, nothing to install.

Heres where I found the solution,com_kunena/Itemid,232/catid,17/func,view/id,32097/#32108

The forum support for ClearOS sucks, and everything I find is years old. Hopefully this helps someone, this solution worked for me using ClearOS 6.5 (as of 12/2014).


Raspberry Pi High CPU Utilization

So if you are coding in python for your Raspberry Pi and your script runs a loop you may have noticed the high cpu utilization, or not. I have not had an issue (yet) with the Pi running in the 90%, I have had a test Pi on my bench running for a few days with no problems so far. Least to say that it still is an issue.

Now I cannot claim to be the author of this fix, I found it while digging through the RPi forums one day. If your Pi is having this issue, simply add this line of code here and there during your loop:


TA-DA! It really is that simple. I added one time.sleep(0.1) call between each of my IF/THENs and I watched (via top) my cpu go from 90-98% to under 5%!!

My adventures in 433mHz with a Raspberry Pi B+

So I bought some 433mHz modules off of eBay for dirt cheap. The “standard” 4 pin receiver and 3 pin transmitter. For the life of me I could not get them to work. Everything I found online appeared to be related to the RPi A I am pretty sure because NONE of the instructions worked for me. I was able to download, compile and run the commands but with zero results. I tried damn near all tutorials I could find out there. Nothing work but I did get close a few times. The part that really irritated me was that I had hooked up LEDs to the Tx and Rx pins to see if it was working. It was, I could see the LEDs flicker away when I pressed buttons, but no results with sniffing.

Finally I was able to send and receive a signal. RFSniffer finally worked off of pin 13/GPIO 27/wiringPi 2 on my Raspberry Pi B+. I curse the people that decided to use a completely different number schemes!! I used this to get the sniffer working, with the above pins, but without the ninja block stuff.

I don’t have FTDI, it hasn’t arrived yet, so I used my Arduino Duemilanove to flash the Mini Pro, but it didn’t work. To get the Arduino Mini Pro to flash I had to switch the Tx and Rx pins. You will find all the directions out there say to connect the Arduino’s Rx to the Minis Tx and vice versa, but that was not the case for me. I did find one post on the Arduino forums that mentioned switching them, I had to flip-flop the pins and then it worked! Tx to Tx and Rx to Rx. I got my Mini Pro off eBay for cheap, it has no name on it, but it does have a red PCB and a small Sparkfun logo. Works like a charm this way. Just remember to set the Arduino IDE to your Mini Pro or you will get errors. I also HAD to remove my Duemilanove’s chip to flash the Mini. I tried it with it in and it did NOT work.

As for the receiver some say to use 5v to power, the board even says 5v. But I have also read people using 3.3v to power it. I used 3.3v to power it when I was testing. To use 5v and the RPi you need to drop the voltage or you will damage the Pi. Use a voltage divider with a 1K and 2K ohm resistors to do it. Google Images has plenty of examples.

Heres the code I used to finally get it to work:

(1) Raspberry Pi B+
(1) XY-MK-5V 433mHz Receiver (4 pins, both data are the same)

(1) Arduino Mini Pro
(1) FS1000A 433mHz Transmitter (3 pins)

RFSniffer (on the RPi for receiving)
RCSwitch (on the Arduino for transmitting)

I used 2 LEDs on the Tx and Rx data pins, and 10K ohm pulldown resistor for the button. I also soldered on 17cm (about 6.5″) of 22awg solid copper wire for antennas.

Some useful links

So far so good. Do not blame me for anything bad that happens to you or your RPi/Arduinos, consider yourself warned. Double check your wiring!!