Link: How to Recover Accidentally Deleted Files Without Paying Outrageous Fees

You can’t always blame data loss on hardware failure. A clumsy user can be just as harmful. PhotoRec is a nifty little command-line based tool that can recover accidentally deleted files.

To use PhotoRec effectively you need to understand how the filesystem handles files. When you delete a file, it isn’t actually zapped into oblivion. Rather the file system just marks it as deleted, and makes the space the file occupies available to other files.

This means that until another app uses that recently freed-up space, the original file is still there, and can be retrieved by a file recovery tool. For this very reason, it’s very important that you immediately stop using the computer as soon as you realize that you have accidentally deleted files in order to minimize the interactions with the hard disk.

Note: PhotoRec is cross-platform compatible. For this tutorial, we will use a Linux (Ubuntu) system for illustration.

Full article here:
How to Recover Accidentally Deleted Files Without Paying Outrageous Fees (Make Tech Easier)

An interesting, but perplexing expansion board for the Raspberry Pi

Expansion board for Raspberry Pi
This afternoon our Twitter stream informed us of the existence of this thing: An Expansion Board Made for Raspberry Pi made by a company called SupTronics, which appears to be headquartered in Shenzhen, China. It can be purchased from this site, and the specifications can be found here. Quoting from that page:

 Introduction

The X100 expansion board designed for use on the Raspberry Pi (RPi) computer platform. The board supplies RPi with a regulated +5V from a wide-range voltage source and also contains a real-time clock, a RS232 master port, a HDMI to VGA converter, 3-port USB hub, memory card reader, and 8-channel darlington Driver.  
Main Features
  • Exactly same size as Raspberry Pi (85 x 56mm)
  • Directly installed into the GPIO header pins with no wiring or soldering
  • 6-23V input to 5V, 3A high-efficiency step-down DC/DC converter to supply your RPI
  • Supports HDMI to VGA (NOT powered by the RPI’s HDMI port)
  • Supports self-powered USB hub (Total 4 ports available)
  • Supports self-powered SD and Micro-SD card reader
  • RTC based on NXP PCF2127AT / PCF2129AT with CR2032 backup battery
  • RS232 Serial Port
  • Having the reset switch convenient to enable RPi reset facility
  • Having two slots to make use of RPi’s FPC connector (S1 & S5)
  • Allowing to stack along with other expansion boards.
  • 8-channel darlington Driver chip allowing to control electronic circuits which require more current to drive them
  • Have DIP switch to remove connection from RPi’s pin header so as to keep using other expansion board with no effect.
 * This expanson board is suitable for Raspberry Pi Rev 2 Model B.

We haven’t actually had our hands on the device, but our initial impression is that it adds a bunch of things that might each be individually interesting to a certain subset of Raspberry Pi owners, but in most cases it will be priced too high to get that one feature you really need, and if you only need one of those features you can probably build it yourself or find a cheaper way to add it. Let’s take each actual feature in turn:

6-23V input to 5V, 3A high-efficiency step-down DC/DC converter to supply your RPI

This in and of itself is great if it works, since the Raspberry Pi is notoriously finicky about power supplies (use one that’s not quite stable enough and you’re likely to have occasional SD card corruption). But a good power supply wouldn’t cost nearly this much. However, if you want to install a Raspberry Pi in a vehicle that only has a 12 volt supply available, or some other situation where the available power is unstable, then this become a more desirable feature.

Supports HDMI to VGA

WHY? Who uses VGA anymore? Oh, right, this came out of China, where the first world dumps all its CRT monitors that nobody wants anymore. We’d have much rather seen this relatively ginormous space used to provide improved audio capability; perhaps a S/PDIF connector supporting full 5.1 or even 7.1 audio. That would have been something we could actually make use of.  And why do they use the word “Supports” to mean “This is included on the board”?

Supports self-powered USB hub (Total 4 ports available)

It appears this means that it includes 4 USB ports. Which is great if you need them, but you can buy powered USB hubs for less than what this costs.

Supports self-powered SD and Micro-SD card reader

Again this is a rather strange way to word this, because the card reader is on the board. Since the Raspberry Pi already has a SD card slot, what’s the advantage of having one on this board? For many users there will be none.

RTC based on NXP PCF2127AT / PCF2129AT with CR2032 backup battery

This is really only useful if you are using your Raspberry Pi in a situation where you can’t update the time from an Internet-based timeserver. And even then, it only matters if keeping something close to the exact time is important to your application. Again, we could see this being most useful in a vehicle-based application.

RS232 Serial Port

This is so early 2000’s. A rare few people might have a use for this (and for those that do, we suspect that add-on serial port circuits are available for less than this) but for most people this is just a useless port that wastes space that could have been occupied by something useful, like maybe a Wi-Fi or Bluetooth module, or any of a number of things that might actually be useful to people in this decade.

Having the reset switch convenient to enable RPi reset facility

A switch that costs less than a dollar to add is hardly a reason to buy this board, but at least it’s more useful than some of the other things they put on here. But, why not a true power switch, that (when used with some software) would do a proper shutdown on the Raspberry Pi? That would have been far more useful. And, viewed one way, giving people easier access to a cold reset is not such a great idea, since every time you use it you risk corrupting your SD card. Yet we understand that it can be a convenient feature if the Raspberry Pi is prone to freezing up occasionally.

8-channel darlington Driver chip allowing to control electronic circuits which require more current to drive them

This appears to be basically a ULN2803A integrated circuit with the outputs brought out to some inconvenient connectors. It’s described this way:

ULN2803 8-channel RC servo port
Bring in some muscle to your output pins with 8 mighty Darlingtons! This driver chip contains 8 drivers that can sink 500mA from a selecable 5V or input voltage supply and has kickback diodes included inside for driving coils. This will let your little microcontroller or microcomputer power solenoids, DC motors (in one direction) and unipolar stepper motors. The GPIO Pins are connected to ULN2803 inputs through a DIP switch, with the its outputs going to two array of Wire-to-Board header. Alternatively, these ports can be used to supply +5V or input voltage to other external circuitry, or embedded devices.Please note that this is an ‘open collector’ driver – it can only be used to connect the load to ground and there will be a 1 Volt (or more) ‘drop’ across the internal transistors.

For some people this might be the most useful thing on this board, although it would be nice if there were better documentation on how it’s used. It appears that this converts the Raspberry Pi GPIO ports to make them behave more like those on an Arduino, though we can’t be entirely sure. But you can do the pretty much the same thing same thing with a cheap breadboard, a ULN2803A (get the kind with long pins, not the surface mount type), some connector wires, and an external power supply. Here you get all that in one package (except you will still need the external power supply), but why on earth did they add those funky little white GPIO connectors on the board? We realize those appear to be similar to the type used to bring power to certain devices (such as some internal drives) but still, the plugs that fit those connectors are not something that the average person is likely to have lying around.

Basically, it’s our opinion, again based solely on the information we can find online, that this will only be a good fit for people that happen to need several of these features, or that simply have money to burn and no inclination to look for other ways to achieve the same results. And (at least in the first world) relatively few people will have use for a VGA port, and probably even fewer for a serial port. We can see some of the other features being a bit more useful, particularly in vehicle based and remote sensing applications, or cases where you plan to power this off a solar or wind-powered source of electricity.

If there is ever a second revision on this board, we would recommend the following:

– Ditch the VGA port and replace it with a S/PDIF audio output.
– Ditch the serial port and consider replacing it with a wi-fi and/or bluetooth connection
– Change the reset button so that it becomes a true power on/off button, so that when the power is turned off it signals the Raspberry Pi to do a graceful shutdown (the equivalent of typing sudo poweroff at the command prompt) and then waits for that shutdown to complete before removing the power. We would expect that you’d need to run a background task to catch the shutdown signal and run the shutdown sequence, but you have to install additional software to make the RTC work, so this would simply be similar to that procedure. And several people have built standalone devices that do this, so it’s definitely possible, and this would be far better than giving a typical user an easy way to do a “cold” reset that might bork their system.
– Add a receiver for an infrared remote (suggested by Jeff Darlington in the comments section)

We neither recommend this board nor advise against it, we’re just saying that depending on the reasons you’d want to use it, there might be better or less expensive options. But if you can utilize several of the functions on this board, then it might be a good value for you, assuming that it works as advertised and that if you plan to use the GPIO connections, you can actually figure out how you’re supposed to connect to them.

OpenSprinkler Pi (OSPi) – An Open-Source Sprinkler / Irrigation Extension Board for RPi

OpenSprinkler Pi (OSPi) is an open-source sprinkler / irrigation extension board for Raspberry Pi (RPi). It is based on the design of OpenSprinkler, but its ‘brain’ is an RPi instead of an AVR microcontroller.

The idea of OSPi first came when I noticed that many users were setting up RPi to work with OpenSprinkler. There are good reasons to do so, for example, to enable logging, to customize the default Javascript files, and to allow more advanced features such as weather-based and learning-based control. OSPi is designed as an extension board that makes use of RPi’s GPIO pins to directly control sprinkler valves, without an additional layer of microcontorller and Ethernet controller. In other words, it is a circuit board that allows an RPi to directly interface with sprinkler valves.

Full article here:
OpenSprinkler Pi (OSPi) (rayshobby.net)

Link: How to install and configure Nagios on Linux

Nagios is one of the most powerful network monitoring systems, which is widely used in the industry. It can actively monitor any network, and generate audio/email warnings and alerts when any problem is detected. The check types and alert timers are fully customizable.

Another incredible capability of Nagios is that it can monitor both hosts and services e.g., it can monitor IP addresses and TCP/UDP port numbers. To explain a little, let us assume that there is a web server that we want to monitor. Nagios can check whether the server is online by running ping on the IP/name of the server as well as it can be set up to provide warnings in case the round trip time (RTT) to the server increases. Further, Nagios can also check whether TCP port 80 (web server) is reachable e.g., the server is online but Apache/IIS is not responding.

There are also 3rd party monitoring tools that are based on Nagios, such as Centreon, FAN , op5 Monitor, which supplement standalone Nagios engine in terms of interface, automation, and technical support.

This tutorial explains how to install and configure Nagios on Linux.

Full article here:
How to install and configure Nagios on Linux (Xmodulo)
Related:
Install And Configure Nagios on Ubuntu 14.04 LTS (Unixmen)

Why you can’t get SRTP encryption to work between Asterisk and your VoIP adapter or phone

Some recent versions of Asterisk (Asterisk 11 in particular) have built-in SRTP support of sorts. As Wikipedia notes,

The Secure Real-time Transport Protocol (or SRTP) defines a profile of RTP (Real-time Transport Protocol), intended to provide encryption, message authentication and integrity, and replay protection to the RTP data in both unicast and multicast applications. It was developed by a small team of IP protocol and cryptographic experts from Cisco and Ericsson including David Oran, David McGrew, Mark Baugher, Mats Naslund, Elisabetta Carrara, James Black, Karl Norman, and Rolf Blom. It was first published by the IETF in March 2004 as RFC 3711.

In simple terms, SRTP encrypts the audio of your VoIP calls, making it much more difficult for anyone with a packet sniffer to listen in.

Let’s say you have an Android-based tablet and you are running CSipSimple. If you have configured it as an extension off your Asterisk 11 server, and you turn SRTP on in the security settings, you will likely find that outgoing calls work fine but incoming calls do not.  The reason is that you need to add one line to the extension’s configuration settings in Asterisk:

encryption=yes

If you are using FreePBX then it’s only a bit more complicated.  You’d need to add two lines to the /etc/asterisk/sip_custom_post.conf file:

[####](+)
encryption=yes

Replacing #### with the extension number. Once you have done this and reloaded Asterisk, it will only communicate with the endpoint using SRTP.

BUT there is one problem here.  With some other VoIP devices and softphones, once your have enabled SRTP, any attempt to place an outgoing call will not work.  And, if you watch the Asterisk CLI, you may see lines similar to this:

[2013-12-19 08:18:57] NOTICE[2949][C-000005e9]: sip/sdp_crypto.c:255 sdp_crypto_process: Crypto life time unsupported: crypto:1 AES_CM_128_HMAC_SHA1_80 inline:6aV+PFYMnVJVUZuxug9EM5yefPnfOrNhHcKLSABE|2^20
[2013-12-19 08:18:57] NOTICE[2949][C-000005e9]: sip/sdp_crypto.c:265 sdp_crypto_process: SRTP crypto offer not acceptable
[2013-12-19 08:18:57] WARNING[2949][C-000005e9]: chan_sip.c:10454 process_sdp: Rejecting secure audio stream without encryption details: audio 17100 RTP/SAVP 0 8 18 104 101

The problem is that in Asterisk, “any SRTP offers that specify the optional lifetime key component will fail”, as is detailed in this submitted patch to Asterisk:

(ASTERISK-17899) [patch] Adds a ‘ignorecryptolifetime’ (Ignore Crypto Lifetime) option to sip.conf for SRTP keys specifying optional ‘lifetime’

If if the device or softphone had a setting to disable sending the lifetime parameter, it probably would work. If users would go through the trouble of applying this patch to Asterisk, it would probably work, but many users either don’t know how to do that, or they are running a pre-built distribution and don’t want to or cannot tamper with it (also, any upgrades to Asterisk thereafter would require re-application of the patch). If Digium would apply this patch to Asterisk and push it out in upgrade releases, it probably would work. But for whatever reason, though this patch was first posted back in May of 2011, Digium has not seen fit to roll it into Asterisk.

So, this may very well be the reason, or at least one of the reasons, why you can’t get SRTP encryption to work between Asterisk and your VoIP adapter or phone! Basically, your VoIP device or softphone and Asterisk just don’t want to play nice with each other.

We’ve heard that some other varieties of PBX software, such as FreeSWITCH, might not have this issue, but since we don’t have a working FreeSWITCH installation at the moment we cannot comment on that.

Link: How to Install and Configure UFW – An Un-complicated FireWall in Debian/Ubuntu

The ufw (Uncomplicated Firewall) is an frontend for most widely used iptables firewall and it is well comfortable for host-based firewalls. ufw gives a framework for managing netfilter, as well as provides a command-line interface for controlling the firewall. It provides user friendly and easy to use interface for Linux newbies who are not much familiar with firewall concepts.

While, on the other side same complicated commands helps administrators it set complicated rules using command line interface. The ufw is an upstream for other distributions such as Debian, Ubuntu and Linux Mint.

Full article here:
How to Install and Configure UFW – An Un-complicated FireWall in Debian/Ubuntu (TecMint)

How to use Wiconnect in Ubuntu Linux to set up a WiFi access point that Android devices can connect to (NOT an ad hoc network!)

If you run Ubuntu Linux, and you have a wired ethernet connection to your system, and it also has wireless connectivity, then at some time you might have tried to set it up as a WiFi access point.  And what you probably discovered is that you can create a WiFi access point using Ubuntu’s “Create New Wireless Network” panel, but unfortunately this creates what is termed an “ad hoc” network, and for reasons we don’t fully understand, Android devices and some other types of wireless devices apparently can’t connect to that kind of network.

Ubuntu's method for creating a WiFi access point will NOT allow Android devices to connect
Ubuntu’s method for creating a WiFi access point will NOT allow Android devices to connect

Why this should be so difficult in Ubuntu is hard to fathom because Windows users can easily set up an access point using Connectify.  This provides an actual access point.  It turns out that there’s a similar program for Ubuntu but it’s not well known, because it’s not in the official Ubuntu repository.  The program is called Wiconnect Infrastructure Wireless Connection Manager and it is described as follows:

Wiconnect is an infrastructure wireless connection manager built specifically for ubuntu. This is an Ubuntu’s open source alternative for connectify. It aims to provide network that is compatible with android devices.
current features:
– Compatible to connect with android devices
– Flexibility to change wifi username and password
– ability to check devices that connects to your wifi

future aim :
– ability to create repeater
– a much better gui
– ability to check devices that connects to wifi via device name and not mac address

The program is hosted on Launchpad and is available as a .deb file.  So, go to the download page and download the software to your system.  Then, double click on the file once it’s been downloaded, and Ubuntu Software Center will load and display this:

Wiconnect Install page as displayed in Ubuntu Software Center
Wiconnect Install page as displayed in Ubuntu Software Center

Again, just in case you didn’t quite understand what we wrote above above, you cannot at this time find Wiconnect by searching for it in the Ubuntu Software Center – you have to download the .deb file and then double click on it to cause Ubuntu Software Center to bring up the above page. Once you read the page, if you want to install the software, just click the Install button. Once the software is installed, you need to run it to configure it. We have Classic Menu Indicator installed, and it appears under Other | Wiconnect, but you can also start it by going to the Dash and typing in Wiconnect. The first screen you will see when you invoke the program is this:

Wiconnect Connection tab
Wiconnect Connection tab

Before you go any further, you should check your network connections and make sure that “Enable Wireless” is on (there should be a check mark next to it) but also make sure you are not actually connected to a WiFi network. Unless you have two network adapters, you can’t both be connected to a WiFi network and simultaneously acting as an access point.

Now on the Wiconnect Connection screen, click the About tab to bring up this screen:

Wiconnect About tab
Wiconnect About tab

Click the button that reads “How to use this software” – it should bring up a text file that will help you if you get stuck at any point. Now click the Connection tab to go back the original screen, and then click the Setup/Resetup Wizard button. It will then bring up several screens asking for information:

Wiconnect Root Password window
Wiconnect Root Password window
Wiconnect Root Password confirmation window
Wiconnect Root Password confirmation window

The above two windows are asking for the password you use on your system when installing new software or making system changes. Some of what it has to do requires root privileges, so that’s why it needs the password.

Wiconnect Wifi Settings
Wiconnect Wifi Settings

On the above screen it wants you to enter the name of wireless network as it will be seen on your WiFi devices, also called the SSID. Use something unique, but not too personally identifying, so that if you are in an area where there are multiple WiFi networks you will be able to easily find your access point. As for the password, this might be called either the “password” or “key” on some devices, but you should use a really strong one here if you don’t want to be hacked. If you don’t have a program that you can use to generate a truly random password, then search online for a random password generator. The longer and more random the password is, the better. Remember that if a hacker can see your access point, he can run a program that can try millions of password combinations over time, so don’t make yourself an easy target.

Wiconnect Connection Settings
Wiconnect Connection Settings

On the above screen you need to select your internet source, which in most cases will be your wired ethernet connection on eth0.

Wiconnect Save Root Password query
Wiconnect Save Root Password query

On the screen above, it is asking whether you want to be prompted to enter your password any time you make a change, such as starting or stopping your wireless access point. By saving the root password, it won’t ask for it each time, but as it notes, that is less secure. If you are not the only user of your system, you probably do not want to save the root password, so that no one else can start or stop your access point without your permission. After you have answered that question, you should see this screen:

Wiconnect Setup Completed screen
Wiconnect Setup Completed screen

This completes the setup but doesn’t start your access point. To do that, go back to the original window and select the Connection tab:

Wiconnect Connect Tab, updated with correct ssid name
Wiconnect Connect Tab, updated with correct ssid name

Note that the SSID name should now be showing the name you selected (if not, you might need to restart Wiconnect). Now click the Create Connection button. After several seconds, your access point should be operational. Whenever you want to turn it off, click the “Stop Connection” button. Note that if you answered “No” to the question about saving the root password, then you will be prompted to enter it each time you start or stop the wireless connection.

Note that if your device (that you want to connect to your access point) asks you to specify what type of connection this is, it will be something like “WPA/WPA2 PSK” – the exact terminology may vary but the most important thing is that it is WPA2.

In case you are wondering, the Advanced tab in Wiconnect looks like this:

Wiconnect Advanced Tab
Wiconnect Advanced Tab

The first four buttons give you the ability to change individual settings in the configuration without re-running the entire setup. The fifth lets you see a report of what is connecting to your access point at any given time – with one device connected, it looks like this (the MAC address in the image has been replaced by x characters for security):

Wiconnect "Who is connected to my WiFi?" Window
Wiconnect “Who is connected to my WiFi?” Window

Just as a final note, we used this with Ubuntu 12.04, the most recent LTS (Long Term Support) version of Ubuntu, and it allowed us to create an access point that an Android tablet could connect to. It’s not the most beautiful program out there, but at least for us, it worked, and that’s what’s important. We particularly appreciated the convenience of being able to start or stop the access point just by clicking a button. But just in case anyone can’t seem to make this work, here’s another article that shows a bit different method to achieve nearly the same result:

How to Set Up a Wireless Hotspot (Access Point Mode) That Supports Android in Ubuntu (WebUpd8)

Hopefully one of these two approaches will get your access point working!