Link: Asterisk: Blacklisting For Multiple Users

Spotted this article referenced in a thread on DSLReports.com, and even though it’s from four years ago we thought it might be worth mentioning:

There are a number of tutorials for people trying to setup blacklisting for their Asterisk server, but they all seem to assume that there is only one user on the server, or at least all users want to share the same blacklist.

Since I host for multiple, unrelated people, they don’t necessarily want to share the same blacklist, so I had to come up with a configuration that would work for all customers.

Here are the changes I made (for Asterisk 1.4)

This may or may not need to be tweaked a bit to work with newer versions of Asterisk. Unfortunately, the thread on DSLReports leaves the impression that it might take a bit of work to integrate it into FreePBX, so you are on your own if you want to attempt that.

Full article here:
Asterisk: Blacklisting For Multiple Users (Lime Daley)
Related Link:
How to hack the FreePBX blacklist for better call blocking capability

Links: My Raspberry Pi Powered ‘Personal Cloud’

I literally have 500GB external USB drives strewn all over the place with multiple copies of multiple things and I have NO clues what is where. So when I sat down to list the things I wanted, I came up with the following:

  1. A central place in my Home Office to store all my backup, training videos, music, documents and pictures.
  2. Accessible by Macs, Windows 7, Windows 8, Windows 8 RT and if possible on iOS.
  3. Low powered, always on, Uninterrupted Power Supply backed.
  4. Accessible over WiFi. All my machines are connected via WiFi and that includes my desktop. The only thing connected to the Router ‘was’ the printer. So my ‘Network Storage’ had to be available over wifi.

Full articles here (from The Lazy Blogger):
My Raspberry Pi Powered ‘Personal Cloud’
Completing my Pi powered personal (Media) cloud

Link: 10 VirtualBox Tricks and Advanced Features You Should Know About

VirtualBox is packed with features that you may have never used, even if you frequently use it to run virtual machines. VMware keeps many of its best features to its paid versions, but all of VirtualBox’s features are completely free.

Many of the features here require Guest Additions installed in your virtual machine. This is good to do anyway, as installing the Guest Additions package will speed up your virtual machines.

Full article here:
10 VirtualBox Tricks and Advanced Features You Should Know About (How-To Geek)

Link: How to Enable TRIM For SSD in Ubuntu

If you are using a Solid State Drive (SSD), you should know that you shouldn’t run any defragmentation or free space consolidation software on it. So how do you clean up your SSD and free up the empty space? TRIM is the command we use to inform the OS to do the cleaning job. Windows 8 comes with the “Optimize Drive” feature that can run the TRIM command regularly. What about Ubuntu? How can you enable TRIM for SSD in Ubuntu?

Full article here:
How to Enable TRIM For SSD in Ubuntu (Make Tech Easier)

Link: A Raspberry Pi File and Print Server

I was recently looking into the options to buy a living room “home server” to centralize certain services like file and print server, media server, etc.

It didn’t take me long to realize that for less money I could get a whole legion of small microcomputers that do the same work better and more securely; and use less energy while doing so.

This was of course the pretext to buy my first Raspberry Pi. A few more should follow… This article starts a little series explaining what I did and how I did it. Today, I will look at the first and simplest type of server …

Full article here:
A Raspberry Pi File and Print Server (Sascha’s Blog)

Link: Weekend Project: Solar Powered, Outdoor Raspberry Pi

We’re a big fan of solar technology, and even bigger fans of the Raspberry Pi.  So when we found that Adafruit had some cool parts that would let us run a solar-powered Raspberry Pi, we got to work!  The idea is simple, a Raspberry Pi that can safely and happily live outside without any wires that would keep it close to home.

Full article here:
Weekend Project: Solar Powered, Outdoor Raspberry Pi (polyideas)

Link: Simple way to control 12V DC Motor using Raspberry Pi’s GPIO port and NPN transistor

I needed to control a DC motor from my Raspberry Pi’s GPIO port as part of my time-lapse dolly project. I had to be able to turn the motor on for approximately 150ms which would in turn move the dolly along by 3mm.

Full article here:
Simple way to control 12V DC Motor using Raspberry Pi’s GPIO port and NPN transistor (Geeking About)
Related article:
Tutorial : Control a DC motor with Raspberry Pi (My Robot Lab)

Link: Raspberry Pi SOCKS 5 Proxy Server (AKA browse the web with an IP from a different country)

This is a small tutorial, which will show you how to set up a local Raspberry to serve as a so-called SOCKS 5 proxy-server for your local network. The Raspberry itself will connect to a remote server, which will then make the requests to other Internet servers with it’s own IP, thus masquerading the original requestor’s.

All computers on your local network can be configured to connect to the Raspberry, so they all can share the same connection to the remote server.

Full article here:
Raspberry Pi SOCKS 5 Proxy Server (AKA browse the web with an IP from a different country) (pi3g Blog)

Link: Raspberry Pi NAS

Why would you want to run a file server off a Raspberry Pi? Maybe you want a small server that is always on and low voltage. If you need something that you can send and recieve files to and from than this might be your solution. The Raspberry Pi is low voltage running at just 5.0V ±5%. This means that your server will end up costing you around $5 a year.

Full article here:
Raspberry Pi NAS (CMDann.ca)

Using irrecord to allow LIRC to recognize extra buttons, as from an unused remote and/or a Harmony remote

A few days ago we published an article on Using the Raspberry Pi to control AC electric power. We ended that article by showing how you could control the Raspberry Pi’s GPIO pins using a standard remote associated with a Home Theater PC on the same local network. Actually, come to think of it, there’s nothing to prevent someone from sending such commands across the Internet to a distant system, if one has an application that requires it. But I digress…

One problem that some users might encounter is that there are simply no free buttons on the remote control that can be used for other functions. Or maybe there are extra buttons, but they don’t seem to do anything. Or maybe you have a Logitech Harmony Remote or some other type of universal remote, and you downloaded a configuration for it to match your existing remote and infrared receiver but it added some additional buttons that appear to do nothing. Or, failing all that, maybe you have a spare infrared remote from a no longer utilized or broken device, that you’d like to use to control some additional functions (such as the GPIO pins on the Raspberry Pi, as in the aforementioned article). The question is, can you get your Home Theater PC (the one to which you have the infrared receiver attached) to recognize those additional button presses?

In our experience, the answer is that there’s a high probability, but it seems to depend on whether your infrared receiver can properly receive and decode the additional button presses. Which it just might be able to, even if it’s not doing that now. So, how can you tell what it’s now recognizing, and whether it can be made to recognize additional button presses?

First of all your system must be using the LIRC software for this to work. Most Linux-based home theater software does, so if you have a Home Theater PC and it’s not running some variant of Windows, it probably already has LIRC installed. Note that LIRC is actually a small collection of programs, none of which are actually named lirc, so just doing “which lirc” from a command prompt probably won’t tell you if it’s installed. Instead, you can check for one of the included programs — for example, try “which lircd” (lircd is the lirc background process) and see if it shows a path to that program.

Before you go any further, from a terminal prompt enter this:

irrecord --list-namespace

You may want to copy the output of that command to a text file that you can keep open in another window while you proceed, or just open another terminal window so you can refer back to this one. You could even print out that list if you think it would help. You are probably only going to be concerned with the entries that start with the characters KEY_ (and NOT those that start with BTN_, which may seem counter-intuitive, but that’s just how it is, at least with “MCE” compatible remotes — MCE = Windows “Media Center Edition”, in case you were wondering).

Next you will want to find out which buttons are already recognized. You should do this from a terminal prompt, with none of the software that normally responds to remote control commands running (so kill any instances of XBMC or similar software before doing this). Enter the command “irw” (without the quotes) and then start pressing buttons on the remote. For each button that LIRC recognizes, you will see one or more lines of text appear. Note any buttons that irw doesn’t print out anything for. If you are wanting to add a second remote to get additional usable buttons, see if irw responds to any of those buttons (it’s very unlikely that it will). The buttons that irw does not recognize are the ones we will try to add in the following steps.

Also, as you are pressing buttons and watching the output of irw, note the key names that are already used (they will likely be in the next to last column. Here is why. When you add previously unrecognized keys, you have to give them a name that LIRC understands, which can be any name from the output of “irrecord –list-namespace” that is not already used. If you duplicate an existing button name, one of the buttons won’t work. So, take note of the names already used, and also of the buttons that currently don’t do anything. When you have pressed all the buttons on your remote(s), use Control-C to exit irw.

Now before going any further, take a look at the file /etc/lircd/lircd.conf (at this point we are only going to read it, not write to it, so don’t use sudo):

nano /etc/lirc/lircd.conf

Note that file may contain a bunch of comments, and then a line such as this:

include “/usr/share/lirc/remotes/mceusb/lircd.conf.mceusb”

Whatever file is referenced in that “include” is the file we will be working with, which for simplicity’s sake I will henceforth refer to as the lirc remote configuration file. So close lircd.conf and go to that file:

nano /usr/share/lirc/remotes/mceusb/lircd.conf.mceusb (or whatever file was included in lircd.conf)

You should see some preliminary configuration at the top, and then if you scroll down a bit you should see a line that says “begin codes” — below that, the lines that are not commented out will show key codes that LIRC currently recognizes (even if they do not appear on your remote) followed by hexadecimal values. Now this is where it gets a little confusing. When you are naming buttons in the next steps, you do not want to use any button names that already appear in this file. So the general rule for naming buttons in the following steps are:

1. DO use names that appear in the output of “irrecord –list-namespace”. BUT…
2. DO NOT use names that already appear in the lirc remote configuration file.
3. DO NOT use names that appear when you are using irw to find existing buttons (this should be a subset of ).

Now you are ready to try to add additional buttons to the list that LIRC knows about. The lircd process must NOT be running at this time, so do this:

sudo killall lircd

Now, to see if the additional buttons (or alternate remote) can be used, do this (note this assumes your IR receiver is at /dev/lirc0, which it probably is, but if not you may need to change that reference):

sudo irrecord -d /dev/lirc0 ~/lirctest

The irrecord program will first have you do several things to get some basic information about the remote – this will involve a bit of time and several button presses, so be patient and just follow the on-screen instructions. Then, after it has figured out what it needs to know about your remote, it will ask you to enter a key name — be sure to keep in mind the rules mentioned above! — and after that it will have you press the button on the remote. You can repeat this cycle as often as necessary to get all the buttons you want to add, and at this step you should only add buttons that it doesn’t already know about (ones that did not elicit a response from the irw program). Only do one remote at a time — don’t try to add buttons from different remotes on the same run of irrecord. If, for any reason, you have to quit irrecord before you are finished, delete the file ~/lirctest before you start over.

There may be cases where irrecord simply will not recognize a remote. or does so only with great difficulty. If that is the case, it probably means that either the batteries are dead in that remote, in which case you should restart the irrecord program after changing the batteries, or that the remote is not compatible with your infrared receiver. Different IR devices can operate on different infrared wavelengths, and your IR receiver is probably “tuned” to receive IR commands in a relatively narrow portion of the infrared spectrum. So, don’t be too surprised if some alternate remotes work fine, while others don’t work at all.

After you have run irrecord, the configuration should be in the file ~/lirctest (lirctest in your user directory). What you need to do now is copy the non-comment lines from that file (in other words, the section from begin remote to end remote, including those lines) to the end of the lirc remote configuration file. Before saving the additions, change the name line (right below begin remote) to have a value that is short and meaningful, using all lowercase letters and no spaces (such as name old_vcr if you are adding buttons from an old VCR remote). You may want to save a copy of the original lirc remote configuration file before making any changes, just in case you mess something up. For that matter, I’d also save a copy after you make the additions, since we’re not entirely sure whether the lirc remote configuration file might revert back to the original configuration if an upgrade to lirc comes along. So you may want to keep both a “before” and “after” copy in another directory.

If you want to add buttons from yet another remote, just repeat the process using irrecord. Remember to give the buttons unique names from the list you got when you ran irrecord –list-namespace. Note that the button name you use in irrecord does not need to bear any actual relation to the button name on the remote itself, it just has to be a name that’s not already in use.

Once you have made the additions to the lirc remote configuration file and rebooted the system (to restart lircd and read the new configuration file), run irw again and verify that the new buttons are being recognized. Now you can use those added buttons in your .lircrc file, or in the remote configuration file for a particular piece of software (for example, ~/.mythtv/lircrc for the MythTV frontend, if you are running that).

Readers with Harmony remotes may have noticed that when they looked into the lirc remote configuration file, there was already a lot of buttons defined that do not appear on their remotes, and might have wondered if it is possible to get the Harmony remote to learn those codes. While we have found that getting a Harmony to learn button presses from another remote is relatively easy using the Harmony configuration software — which means it would be easy to add buttons from that old VCR remote, assuming that irrecord was able to recognize it — it’s either difficult or impossible to add raw codes to a Harmony without having another remote that generates them. We tried to figure out if it could be done, but pretty much hit a dead end. If you should figure it out, please feel free to leave a comment explaining the procedure.

Recent Posts

Recent Comments

Archives

Categories

Meta

GiottoPress by Enrique Chavez