WARNING: This post involves live mains electricity and is EXTREMELY DANGEROUS! Do not attempt this project on your own unless you are qualified to do so. I advise you to engage a licensed electrician to help you build this test unit!
Most of my electronics projects involve modern devices that require low voltage DC and minimal current. Occasionally I take on a project that involves high voltages, but these usually involve new components which run little to no risk of internal faults that involve dead shorts. This all changed when, in a moment of nostalgia, I bought an old Marantz Stereo Receiver off of eBay. I knew from the description that the unit was “dead” and when I received it and broke open the case, I could see that there were indeed indications of serious problems. After performing diagnostics and making a number of repairs (capacitors, transistors and fuses), I was ready to conduct a test to see if the unit was working. The proper way to do this would be to have an isolation transformer and a variac and to slowly bring up the power to make sure there were no shorts. Since I don’t do enough of these types of projects I thought it might be nice to build myself a Dim Bulb Tester instead.
A Dim Bulb Tester is a very simple device that puts an incandescent light bulb in series with power running into an unknown device which acts as a current draw if there is a short in the device being tested. Not only is it really simple to build, it’s a rock solid way to safely test “new” old gear without fear of doing damage in the event that there is a problem.
I wanted to keep the tester as simple as possible. I wanted one dual outlet receptacle with one socket used for the bulb load and the other socket serving up power to my test load. I also wanted a switch to make it really easy to prepare my tests and to kill power in a hurry if needed.
After purchasing my parts, the first thing I did was cut the tabs between the neutral and hot connections on each side of the duplex receptacle. This allows each socket to function independently and is critical to this particular circuit design.
The next step involves wiring up the circuit. Even though the power in our homes is AC, most people don’t realize that that power is polarized. In other words, one lead is hot and the other is neutral. For safety reasons, we want to make sure we pay attention to how we hook these leads up in our circuit. This is particularly important when using a unit like this to test old electronic devices that use hot chassises such as All American Five radios and vintage TV sets. Wiring the circuit is very straightforward. Simply run the hot wire through the switch, through the bulb socket and then to the hot side of the load socket of our receptacle. Then connect the mains neutral to the neutral side of the load socket and, last, but not least, connect the ground to the duplex unit.
At this point, your Dim Bulb Tester is fully functional. Plug the unit into mains power and plug in a test load such as a lamp or radio. If you wired it up correctly, simply turn on the switch and the load should power up normally and the bulb will stay off. Now short the load socket (WARNING: Exercise EXTREME CAUTION!!!! DO NOT perform this test unless you know what you are doing! This is extremely dangerous!) and the bulb should light up.
It’s important to note that the incandescent light bulb you choose for your unit is important. First and foremost, the lower the impedance of your bulb the better. Secondly, the wattage of your bulb matters. If you’re goal is to test old HiFi gear from the 70s and 80s then a 40 watt bulb should be just fine. If you get into older vintage gear, here’s a guide that might help:
25 – 40 Watts = All American 5 Radio
40 – 75 Watts = 6 Tube w/Transformer
75 – 150 Watts = TV
200 – 350 Watts = Color TV
That’s it; so simple, yet so ingenious! Following are some images of my build.
When it comes to Linux, the best desktop note taking tool, in my opinion, is Zim Wiki. I love this tool and have used it for a long time. That said, the 800 pound gorilla of note taking tools is Evernote, but unless you want to use the web client, your options on Linux are limited and not always so great.
There are a number of unofficial Linux based Evernote clients with one of the better options being Everpad. The problem with Everpad is that it lacks a built-in option for searching your notes. The good news here is that the standard Ubuntu user gets search capabilities for Everpad via an Everpad lens that integrates into Ubuntu’s Unity standard search. If you run a desktop with KDE then you can search via Krunner. If, like me, you run an Xfce based desktop, there’s no way to search your notes which makes Everpad a no-go option.
I played around with some of the other Linux client options, but I wasn’t fully satisfied with any of them. Rather than give up, I decided I would try installing the latest Windows client on my Xubuntu machine using Wine. After a bit of fiddling with the setup, I managed to get a fully functional and pleasant looking install on my Xfce based machine.
Following are the versions of the various pieces of software that I’m using in my installation:
The first step in this process is to install Wine. The latest stable version of Wine is 1.6.2 but I opted to go with the latest development release available in the ubuntu-wine ppa.
The next step in this process is to get your hands on a copy of the Evernote Windows client. If you try to download the client from your Linux machine Evernote will frustrate your attempts by looking at your User Agent information and presenting you with a screen that suggests you use the web client. The options for getting around this are:
download a copy of the client from a Windows machine and copy to your Linux box via a thumbdrive, dropbox or other similar method
use a browser plug-in that can change your user agent to something such as Internet Explorer 10
After you have your exe installer, right click on it and select open with “Wine Windows Program Loader”.
At this point you’re likely to see a number of system updates occur. Just be patient until the Evernote installation fires off. Once it does, just follow the directions until complete.
Now reboot your machine and proceed to the next step.
While not a problem per se, I make it a practice to configure my Wine installations as Windows 7 since most modern software expects to be running on a modern operating system. To make this change do the following:
Navigate to “Wine”, under the menu system
Select “Configure Wine”
Select Windows 7 in the dropdown at the bottom of the screen
If you start Evernote at this point you will likely encounter two issues:
Note Titles are missing
On my installation, most of the fonts looked fine. My issue was with the fonts in the actual notes (far right side panel), they looked absolutely terrible. To fix the issue, I enabled subpixel rendering/anti-aliasing as follows:
Now let’s make some registry changes:
Navigate to HKEY_CURRENT_USER>Control Panel>Desktop and set (or create the key if it doesn’t exist)
FontSmoothing=2 (string key)
FontSmoothingType=00000002 (dword key)
FontSmoothingGamma=00000578 (dword key)
FontSmoothingOrientation=00000001 (dword key)
Even though you can’t see the title, it’s actually there. If you click into the title area and start typing, the title will change, but not being able to see it is annoying.
To fix this issue execute the following command:
winetricks -q riched20
After these changes were made, my install looks perfect. I have yet to try more advanced functions such as annotating images, webcam note captures etc, but this installation covers my day-to-day note taking needs.
The one issue that I have noticed has nothing to do with functionality but is an aesthetic issue. When resizing the window the rendering stutters creating some ugly artifacts on the screen. The good news is that as soon as you stop moving the mouse, the artifacts disappear, so it’s nothing more than a minor nuisance.
There you have it; an Evernote client running on Linux with very minimal effort.
A couple of months ago I decided to move my company’s Asterisk PBX system from one of our physical data-center servers to Amazon’s AWS EC2 Platform. We had been using Trixbox since 2006, but the Community Edition of that product (Trixbox CE) is no longer being developed and is no longer supported. Since I was starting with a fresh installation on AWS, I decided to go with FreePBX which is very similar to Trixbox. The only problem with this idea is that FreePBX, like Trixbox, ships as its own Linux Distribution. I wanted to use Amazon Linux as my distro of choice in the AWS cloud because the OS is optimized for that environment. This meant I needed to install, configure, and in many cases, compile all of the necessary components to make my PBX work. This approach isn’t as “easy” as dropping a distro in place and configuring, but is sure is a lot more fun!
Following is a step by step walk-through of my installation process.
An installation of this magnitude uses a lot of various software components and systems that require credentials. Be sure to change these passwords to match your internal security requirements:
PASSWORD1 – MySQL root password
PASSWORD2 – Used for the asterisk database user
PASSWORD3 – Used for the FreePBX administrator
PASSWORD4 – Used for Flash Operator Panel
PASSWORD5 – Used for the Asterisk Recording Interface
Create Virtual Machine
Deploy a 64Bit medium instance of Amazon Linux with all of the default settings.
Name the instance “FreePBX”
Attach an Elastic IP Address
Open Ports 80 and 443
Prep the Instance
The first step is to download the certificate from AWS that you will need to SSH to the server. Once that’s in place, establish a SSH session, login as ec2-user and execute the following commands:
All Amazon instances are in GMT time by default. To make sure that logs and such reflect the correct times, we should set the correct local timezone. To do so, you first point the correct timezone data file at “/etc/localtime” file, and then edit the “/etc/sysconfig/clock” file to ensure that the correct timezone gets applied the next time the system reboots.
LAME is required for some of Asterisk’s audio features. We need to download LAME to a source directory, compile and then install it.
tar zxvf lame-3.98.4.tar.gz
Now let’s remove the source data:
rm -fr lame-3.98.4
rm -f lame-3.98.4.tar.gz
Build / Install SOX
SOX is required for some of Asterisk’s audio features. We need to download SOX to a source directory, compile and then install it.
tar xvzf sox-14.4.1.tar.gz
Now let’s remove the source data:
rm -fr sox-14.4.1
rm -f sox-14.4.1.tar.gz
Build / Install spandsp
Asterisk needs a fax engine to support the processing of inbound faxes. We could use Digum’s Fax for Asterisk (paid) option or, as we’ll use here, the free spandsp option.
tar zxvf spandsp-0.0.6pre21.tgz
Now we need to make sure that the module can be found:
Let’s grab a copy of Asterisk 11 and extract it to its own source folder:
tar xvfz asterisk-11-current.tar.gz
./configure CC="gcc -O3" CFLAGS=-O3
The last command will launch the source configuration manager. The we want to install:
Extra Sound Packages
When done, press x to save your selections and exit.
Now let’s compile the source and install:
cp /usr/lib/libasteriskssl.so.1 /usr/lib64/
Now let’s remove the source data:
rm -fr asterisk-11.2.xx.xx
rm -f asterisk-11-current.tar.gz
Configure PHP Timezone
Now we need to configure our timezone for PHP:
set date.timezone = “US/Central”
Let’s get the latest version of FreePBX and extract it to its own source folder:
tar xvfz freepbx-2.xx.xx.tar.gz
Let’s start MySQL, create the asterisk databases and run the initial SQL setup scripts:
chkconfig mysqld on
mysqladmin create asterisk
mysqladmin create asteriskcdrdb
mysql asterisk < SQL/newinstall.sql
mysql asteriskcdrdb < SQL/cdr_mysql_table.sql
Now let’s start the MySQL command line tool:
Let’s define the user and password for each of the databases:
GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY 'PASSWORD2';
GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY 'PASSWORD2';
Let’s change the MySQL user to root:
mysqladmin -u root password 'PASSWORD1'
Now we need to create the Asterisk user and set folder permissions:
Now we need to update the Apache configuration file:
Change User apache and Group apache to User asterisk and Group asterisk
Change AllowOverride None to AllowOverride All
Change ServerName to servername.domain.com:80
Now we can start Apache:
chkconfig httpd on
Let’s start Asterisk:
Set Up FTP Server
We installed the vsftp server at the beginning of this process, now we need to configure it.
Create Polycom User
Set the password to polycom as well.
Just to be cautious, let’s lock the polycom user down so the account can only be used for FTP:
Scroll to the end of the file and change:
Now add polycom to the bottom of the following files:
The vsftp server restricts users in the user_list file by default, we want to only allow users in this file. Be sure to comment out all users listed in the file except for the polycom user we added previously.
Now add the following line to the bottom of the file:
Now we need to restart the vsftpd server to read our new configuration:
Navigate to the Advanced Settings menu item and set:
Browser Stats = False
SIP nat = yes
Navigate to the Asterisk SIP Settings menu item and set:
NAT = yes
External IP = Static IP
At this point you have a functional Asterisk and FreePBX installation running on AWS. All that’s left to do is to configure the PBX to meet your specific needs. Following is a sample of the items you’ll need to set up: