Link: How to Replace the Unity Desktop on Ubuntu Using apt-get

We think Unity pretty much sucks. If you do too, you have choices, as outlined here:

How to Replace the Unity Desktop on Ubuntu Using apt-get (Linux.com)

Another choice would be to switch to a better Linux distribution. Many people seem to like Linux Mint; others simply go back to plain old Debian (both Ubuntu and Mint are based on Debian).

Link: Build an LED Indicator with a Raspberry Pi (for Email, Weather, or Anything)

The Raspberry Pi makes a nice compact platform to attach an indicator light to for all sorts of projects—weather notification, new emails, etc. Read on as we show you how to hook up an LED module to your Pi and set up some basic notifications.

Build an LED Indicator with a Raspberry Pi (for Email, Weather, or Anything) (How-To Geek)

Link: BASH Frequently Asked Questions

Here is something we could have used a few times in the past, had we known it existed:

These are answers to frequently asked questions on channel on the freenode IRC network. These answers are contributed by the regular members of the channel (originally heiner, and then others including greycat and r00t), and by users like you. If you find something inaccurate or simply misspelled, please feel free to correct it!

All the information here is presented without any warranty or guarantee of accuracy. Use it at your own risk. When in doubt, please consult the man pages or the GNU info pages as the authoritative references.

BASH is a BourneShell compatible shell, which adds many new features to its ancestor. Most of them are available in the KornShell, too. The answers given in this FAQ may be slanted toward Bash, or they may be slanted toward the lowest common denominator Bourne shell, depending on who wrote the answer. In most cases, an effort is made to provide both a portable (Bourne) and an efficient (Bash, where appropriate) answer. If a question is not strictly shell specific, but rather related to Unix, it may be in the UnixFaq.

This FAQ assumes a certain level of familiarity with basic shell script syntax. If you’re completely new to Bash or to the Bourne family of shells, you may wish to start with the (incomplete) BashGuide.

If you can’t find the answer you’re looking for here, try BashPitfalls. If you want to help, you can add new questions with answers here, or try to answer one of the BashOpenQuestions.

Link: BASH Frequently Asked Questions

Over 100 questions are answered here. And in case you missed it above, this page only shows the questions – you have to click on the links that follow each question to see the answers.

People often don’t realize how powerful BASH really is. Very often people will try to write a program in a higher level language to do a simple task that could easily be done entirely in BASH. Look this page over and you might realize that you can do a lot more with BASH than you thought. And BASH is available in every version of Linux we’ve ever encountered (note we did not say “installed by default”, though it often is nowadays). Even small computers such as Raspberry Pis will usually have BASH installed as part of the operating system.

Link: How to set up a VNC server on a Raspberry PI, a VNC client on an Android device, and use the two together

I think the title above more accurately describes what is shown in this article than the tile they picked. Just good basic information on how to do this:

Connecting via VNC to Raspberry PI from the Google Nexus 7 (Everyday Linux User)

Asterisk on a Raspberry Pi – which distribution is best?

Portions of this article were UPDATED July 20, 2016, mostly to include information about Raspivo.

To the best of our knowledge there are five projects that will allow you to run a PBX on a Raspberry Pi. They are:

In this discussion we are only going to consider the first four, because FusionPBX runs on top of FreeSWITCH, not Asterisk. And we have nothing against FreeSWITCH, but it’s never been big among home users and experimenters. Perhaps that should change, but for now we just want to consider the Asterisk-based distributions.

It does not seem as though µElastix ever really caught on with a significant group of English-speaking users, and therefore it would be difficult to offer any sort of opinion. But we will note that new users and those not all that familiar with Linux may have a bit more trouble with the installation process, since there is no image file provided as is the case for some other distributions. One potential advantage of µElastix is that it will run on a Raspberry Pi, PicoSam, or Mcuzone, though you are not likely to run into the latter two boards anywhere in North America.

As for Incredible PBX, this takes the typical Nerd Vittles/PBX in a Flash “throw in everything but the kitchen sink” approach, but then offers this ominous-sounding advice:

Here’s everything you need to know about security for Incredible Pi:

1. ALWAYS RUN INCREDIBLE PI BEHIND A SECURE HARDWARE-BASED FIREWALL/ROUTER
2. NEVER EXPOSE ANY INCREDIBLE PI PORTS DIRECTLY TO THE INTERNET
3. NEVER MAP INBOUND INTERNET PORTS FROM YOUR FIREWALL TO INCREDIBLE PI

What this basically means is that you can’t have any off-site extensions that register with your Asterisk server, if you heed their warning.  Well, you CAN, but not in any way that’s convenient for end users.  The problem apparently is that a few years ago someone connected with that project got hold of an article or two where someone got a huge phone bill by having an unsecured PBX, and had a major freakout about it.  There were probably several security failures associated with those incidents, but here is our question:  Since nobody in ANY other PBX project we’ve ever encountered gives advice like this, does this mean that Incredible PBX is incredibly insecure by design, and the only way to properly secure it is to take extraordinary steps such as these?

We’re not saying that all of this advice is out of line – the first point is probably a very good idea whenever possible – but most home users will be doing that anyway.  But it’s we particularly take issue with.  If you want to have any external extensions, you pretty much need to forward UDP ports 5060 and 10000-20000 to your Asterisk server.  And the Incredible PBX people specifically tell you not to do that, rather than recognizing that for some users that is simply not a viable option.

The other issue we have with Incredible PBX is that it includes a lot of what we would consider frivolous add-ons.  The main reason people generally install a PBX is because they want to use it to make phone calls, and perform a few other basic functions such as record voicemail, let callers select a destination from an auto-attendant, and so on.  All of these basic functions are provided by FreePBX, and all the other add-ons are pretty much useless unless you are just installing a PBX to play with features.  We can just about guarantee you that 99 percent of your users will not care that they can dial a code and get tide reports, or some similar nonsense.  On a regular server that has a lot of CPU power and storage space, having a bunch of extras may not be a problem.  On a Raspberry Pi, however, you are probably going to want a lean, trim installation that doesn’t get in the way of the basic functionality of a PBX.

I’ve seen reports in mid-2016 that Incredible PBX will soon (and perhaps already does) offer a menu at installation where you can select which features you want. However you will need to choose carefully because if you reject an option and then later decide you want it, you might need to reinstall from scratch to get it. New users might not know which features are actually useful and which are needless bloat, but at least it appears some effort is underway to stop forcing users to take all or nothing.

Raspivo is based on XiVO, which has been around for a while but was relatively unknown in the English-speaking world until fairly recently. However it has generated a lot of interest due to users desiring an alternative to FreePBX, which seems to be getting less “free” (in all senses of that word) as time goes by. There is a discussion about XiVO on DSLReports that you may wish to read, which in turn contains several other useful links. My understanding is that the “official” English language translation of the installation instructions are somewhat out of date, so you may find that RonR’s instructions on DSLReports are easier to follow. Like FreePBX, XiVO is a GUI interface for Asterisk, so any custom dialplan you have written for another build of Asterisk should be usable (perhaps with minor modification) in Raspivo. It appears that you must have at least a Raspberry Pi 2 or newer to run Raspivo.

If you have no experience at all with software PBX’s and are just getting your feet wet, but you are not unfamiliar with programming, XiVO is the one I’d suggest. It makes repetitive tasks easier but doesn’t get in your way when you want to customize your system to the same degree that FreePBX does. However if you just want everything to be as easy as possible, and you never want to do any dialplan customizations (or only very limited ones), then you may want to consider Asterisk for Raspberry Pi, also known as RasPBX.

The RasPBX distribution includes Asterisk and FreePBX, with additional scripts that will optionally let you install HylaFAX and/or Fail2Ban. There is also a related version of this software for the BeagleBone Black. This software is relatively easy to install, comes with no ominous security warnings, and doesn’t include a lot of “bloatware”, which we think is a definite advantage. They also have a semi-active discussion forum where you can find several installation and usage tips. And it is possible to run RasPBX from an External USB HDD or Thumb Drive, in case you are worried that running a PBX off of an SD card might not be reliable, although there are ways to minimize writes to the SD card if you prefer not to have the added power drain of another device.

We realize that none of these distributions are absolutely perfect, and everyone will have their own reasons for picking one over another. The PBX in a Flash forum used to include a Raspberry Pi board, but it was apparently lost in their “Great server crash of 2013”, and they never bothered to reinstate it. So it seems that for them, the Raspberry Pi is just one of many platforms they are attempting to support, and it does not appear to us that they are making much of an attempt to optimize their software specifically for the Raspberry Pi. We might receive a few less than gracious comments for saying that, but that’s simply our observation, and others are free to disagree – we just recall the old saying, “Jack of all trades, master of none” and feel it might apply in the case of putting out a version of Incredible PBX for the Raspberry Pi that includes pretty much everything that the versions intended for larger servers include. For performance reasons, we’d prefer to stick with a distribution designed for the Raspberry Pi from the ground up, and therefore our preference has always been Asterisk for Raspberry Pi / RasPBX, though nowadays we’d suggest that anyone that wants to have complete control over their system might also consider Raspivo. Just be aware that the learning curve with Raspivo might be a bit steeper.

If you disagree, feel free to try any of the other distributions mentioned. That’s the nice thing about having choices – you can try various programs until you find one that meets your needs, and maybe even your wants.

One final point – since this article was originally written in 2013, new versions of the Raspberry Pi have appeared, and some of the above-mentioned software may have been updated to only run on newer models. Or they may run, but only painfully slowly, if you have an original Raspberry Pi. In particular, it appears that Raspivo will only run on the Raspberry Pi 2 or newer. So if you have a first-generation Raspberry Pi, pay attention to the system requirements for the software you are downloading, because you might need to seek out an alternate or older version of the software.

Links: How to extend the life of the SD card on a Raspberry Pi (or similar device)

People are using the Raspberry Pi for many applications these days, including as a VoIP PBX server based on Asterisk. One thing that many people forget is that you can only write to an SD card a limited number of times before it fails. Asterisk in particular likes to write a LOT of information to log files, and let’s face it, if you are honest and you are like 99% of Asterisk system administrators, you will admit you never read them unless perhaps you suspect there is a problem with your system. Yet every one of those many writes reduces your SD card’s lifespan by a small amount.

So with that in mind, here are links to a few threads that may or may not be helpful, in no particular order:

How can I extend the life of my SD card? (Raspberry Pi Stack Exchange)
How can I use a USB HDD to extend the life of my SD Card? (Raspberry Pi Stack Exchange)
Read/Write cycles of a SD card (RaspberryPi.org)
Extending the life of the SD card (RasPBX – Asterisk for Raspberry Pi/Sourceforge)
How to add ‘noatime’ to fstab? (AYK solutions)

Know of any other good links on the subject? Please leave a comment!

Add voicemail transcriptions to e-mail notifications in FreePBX

This comes from a post in the PBX in a Flash forum by user matt91 and was slightly edited, but will probably work on most FreePBX installations of recent vintage. Note that at one time you could get 30 seconds of voice transcribed but now it is only 15, but that still may be enough to help you quickly decide if you want to listen to the full message. If you are not running PBX in a Flash then open the batch file in a text viewer before you run it and make sure it’s not going to do something you don’t want it to do, and run it at your own risk.

1. Log into your server via SSH as root and…

cd /root
wget -N http://www.deltaend.net/pbx/installmp3stt.sh
chmod 0755 installmp3stt.sh
./installmp3stt.sh

2. In FreePBX, choose Settings -> Voicemail Admin -> Settings, make the following changes, then click Submit and Reload FreePBX.

format -> wav
mailcmd -> /usr/sbin/sendmailmp3

3. Leave yourself a voicemail and you should see the first 15 seconds of the voicemail transcribed for you.

Link: How to remove Zeitgeist in Ubuntu and why

Quoting from the article:

On my desktop I use Xubuntu 12.04, and today i noticed that this distribution shipped by default the Zeitgeist daemon, a thing that I’m not using at all, for what i know.

From Wikipedia:

Zeitgeist is a service which logs the users’s activities and events, anywhere from files opened to websites visited and conversations. It makes this information readily available for other applications to use in form of timelines and statistics. It is able to establish relationships between items based on similarity and usage patterns by applying data association algorithms such as “Winepi” and “A Priori”

Zeitgeist is the main engine and logic behind GNOME Activity Journal which is currently seen to become one of the main means of viewing and managing activities in GNOME version 3.0

Personally i don’t use any tool that use the Zeitgeist Framework and I’d prefer to open a terminal and use locate or find to search for files than having something that log all my activity and so slow down my system, so I’ve decided to remove this daemon totally from my system, please note that if you use Gnome 3 or Unity you could have some side effect, or perhaps the system will just become more faster, like the author of the article: Removing Zeitgeist Sped Up Unity .

Just remember that the information collected by Zeitgeist are stored for use in various forms in Unity: showing what were the last application you used, what are the applications you use most, which are the files that were used lately, the music you listen, among many other aspects. If you think you can live without these information probably your system will gain a good sped up.

The remainder of the article at Linuxaria gives provides the actual removal instructions.

Proof of concept: Automatically transfer Google Voice voicemail to Asterisk voicemail

 

Important
This article is a guest post. We may not be able to answer questions about this article.

The following should be considered proof-of-concept material. Feel free to use and/or modify it at your own risk.

The problem: You have Google Voice calls coming into an Asterisk server but even though you take care to answer calls when they arrive, every so often some hiccup causes voicemails to be left in Google Voice’s voicemail, and no one checks those. The solution: Transfer those voicemails to Asterisk’s voicemail box for that user.

The following assumes that there is already an active voicemail box established for the target user.

Prerequisites: php-xml (do yum install php-xml on a Centos-based system). Also, go to the Google-Voice-PHP-API page on GitHub and grab the file GoogleVoice.php – be sure to get the Raw version of the file. It is suggested that you place it your root directory, and make it executable. Note that if you have downloaded this file in the past, you should check to make sure you have the most recent version, since older versions available prior to June, 2013 did not include the ability to download voicemails.

Then in the same directory create a new file. Call it anything you want but give it a .php extension:

<?php

include('/root/GoogleVoice.php');

// NOTE: If you get errors from GoogleVoice.php, try installing the php-xml package
// You must change the name and password on the following line. NOTE: Full email address required.
$gv = new GoogleVoice('gv_user@gmail.com', 'gv_account_password');
// On the next line insert the extension number of the target voice mail box.  Must have voicemail enabled!
$vmbox = '1111';
// On the next line specify an email address for delivery of new voicemail notification.  Use $email=FALSE; if you don't want this.
// Note that this will not send the voicemail as an attachment so if you want that, do it from within the Google Voice account.
$email="username@gmail.com";

// Don't change anything below unless you know what you are doing!

// Set path to user's mailbox
$dir = '/var/spool/asterisk/voicemail/default/'.$vmbox.'/INBOX/msg';

// Set flag that determines if message waiting indications will be updated
$mwi = FALSE;

// Get data on all unread Google Voice voicemail messages into array.
$voice_mails = $gv->getUnreadVoicemail();
$msgIDs = array();
$keys = array_keys($voice_mails);

// process each available message
foreach($voice_mails as $v) {
	//	echo 'Message id: '.$v->id.' from '.$v->phoneNumber.' on '.$v->displayStartDateTime.': '.$v->messageText."<br><br>\n";

	// Downloads individual voicemail
	// Uses getVoiceMailMP3 function added to GoogleVoice.php - WILL FAIL with unmodified GoogleVoice.php 
	$mp3 = $gv->getVoicemailMP3($v->id);

	// construct temporary filenames used
	$mp3file = $v->id.".mp3";
	$wavfile = $v->id.".wav";

	// write temporary mp3 file to disk
	$fh = fopen($mp3file, 'w') or die("can't open file");
	fwrite($fh, $mp3);
	fclose($fh);

	// convert mp3 to temporary wav file
	system("mpg123 -q -w mp3towavtmp.wav ".$mp3file);

	// convert wav file to format required by Asterisk
	system("sox mp3towavtmp.wav -r 8000 -c 1 ".$wavfile." vol 3 dB");

	// If caller's number starts with +1 strip it
	$number=$v->phoneNumber;
	if (substr($number, 0, 2) == '+1') {
		$number=substr($number, 2);
	}

	// Calculate approximate duration of file from file size
	$duration=(int) (filesize($wavfile)/16000);

	// Construct Message Information file for Asterisk - following must be one long continuous line!
	$txt=";\n; Message Information file\n;\n[message]\norigmailbox=$vmbox\ncontext=macro-vm\nmacrocontext=ext-local\nexten=s-NOANSWER\nrdnis=unknown\npriority=2\ncallerchan=\ncallerid=<$number>\norigdate=$v->displayStartDateTime\norigtime=".substr($v->startTime,0,10)."\ncategory=\nflag=\nduration=$duration\n";

	// Find next unused voicemail file number in Asterisk voicemail directory
	$exists = TRUE;
	$i = 0;
	while ($exists) {
		$file=$dir.substr("000$i",-4).'.txt';    
		$exists = file_exists($file);
		$i++;
	}
	$i--;

	// $file will contain path and base filename of voicemail files, without extension
	$file = $dir.substr("000$i",-4);

	// Write Message Information file for this voicemail
	$fh = fopen($file.".txt", 'w') or die("can't open file");
	fwrite($fh, $txt);
	fclose($fh);

	// Change owner and group of file to asterisk
	chown($file.'.txt', "asterisk");
	chgrp($file.'.txt', "asterisk");

	// Move wav file to voicemail directory with proper filename
	rename($wavfile, $file.".wav");

	// Change owner	and group of file to asterisk
	chown($file.'.wav', "asterisk");
	chgrp($file.'.wav', "asterisk");

	// Mark message read in Google Voice so we don't read it again
	if(!in_array($v->id, $msgIDs)) {
		// Mark the message as read in your Google Voice Voicemail.
		$gv->markMessageRead($v->id);
		$msgIDs[] = $v->id;
	}

	// If email address specified construct and send email to user
	// Wanted option to attach voicemail but couldn't figure out how to do it correctly. uuencode does NOT work.
	if ($email) {
		// Construct email text
		$txt="There is a new voicemail in mailbox $vmbox that was imported from Google Voice's voicemail system:\n\n\tFrom:\t$number\n\tLength:\t$duration seconds\n\tDate:\t$v->displayStartDateTime\n";
		if ($v->messageText) {
			$txt=$txt."\tTranscription:\t$v->messageText\n";
		}
		$txt=$txt."\nDial *98 to access your voicemail by phone.\n";
		$i++;
		`echo "$txt" | mail -s "New message $i in mailbox $vmbox" "$email"`;
	}

	// Remove temporary files
	unlink($mp3file);
	unlink('mp3towavtmp.wav');

	// Set flag to indicate message waiting indication needs to be reset
	$mwi = TRUE;

}

// If messages were processed tell Asterisk to reset message waiting indications
// This may not be the best way to do this but only way I know
if ($mwi) {
	`/usr/sbin/asterisk -rx "voicemail reload"`;
}

?>

After you have changed the information at the top of the above code so it is correct for your installation, save it to a file with the extension .php and don’t forget to make it executable. Remember, this is proof-of-concept code, and we do not guarantee that it is ready for use in a production environment. It could probably benefit from additional error checking and possibly other enhancements.

You may want to call the above file on a schedule, perhaps every 15 minutes or every hour, depending on how urgently you want to receive Google Voice voicemails. I would not do it too often because you never know if Google would feel you are abusing their system with very frequent accesses. Note that when you call the script you’ll need to call it using php, for example:

php scriptname.php

and if that doesn’t work try adding the -f option after “php” but before the script name. Also, if you are running multiple copies of this script from a bash script (because you are collecting voicemail for more than one Google Voice user) then use a sleep statement between executions (such as sleep 30), otherwise you may see errors such as this:

PHP Fatal error: Uncaught exception ‘Exception’ with message ‘Could not log in to Google Voice with username: user@gmail.com’ in /root/GoogleVoice.php:67

Note that when this inserts voicemails into the Asterisk voicemail directory, it is not quite the same as when using a user leaves a voicemail. The known differences are:

  • When a user leaves a voicemail, the audio is saved in two files, a larger one with a .wav extension and a smaller one with a .WAV extension. The larger one is standard .wav format but the smaller seems to be some sort of GSM file, and I cannot figure out how to get SOX to create a compatible file, so I just don’t bother with it. It doesn’t seem to be needed anyway.
  • While this will let you send a notification e-mail to the message recipient, it does not let you attach the mp3 or wav file to the email. Again, don’t know how, but remember you can configure Google Voice to send a notification (with out without audio file attachment) when someone leaves a voicemail.

I hope someone will expand upon this to create something a bit more robust.

Cubieboard2 open single board computer ships, Cubietruck model revealed

This comes to us from LinuxGizmos:

The forthcoming Cubietruck will have additional I/O ports
The forthcoming Cubietruck will have additional I/O ports

The Cubieboard open SBC project began shipping a faster Cubieboard2 version of its open source Linux and Android SBC, and revealed prototypes of a new, larger, enhanced Cubietruck model. Like the $59 Cubiboard2, the Cubietruck uses an Allwinner A20 dual-core Cortex-A7 SoC instead of the original’s single-core Allwinner A10, and adds a 2GB RAM option, WiFi, Bluetooth, gigabit Ethernet, VGA, and SPDIF ports.

Read the full article here.

Note that the abbreviation “SBC” in the above-linked article stands for “single board computer”. In our opinion, if the Cubietruck works reliably it could relegate the BeagleBoard Black to also-ran status, and could even give the Raspberry Pi a run for its money among those who’d like just a bit more power and a wider selection of outputs. For Home Theater PC builders, the inclusion of a SPDIF Toslink optical port is no small thing. We’ll definitely be keeping an eye on this one!

Recent Posts

Recent Comments

Archives

Categories

Meta

GiottoPress by Enrique Chavez