All posts by Hakr

Buffalo WHR-G125 DIY External Antenna

Increase the Router Range with an External Antenna

Buffalo WHR-G125 comes with a stock antenna permanently attached to the side. Some other routers like the popular Linksys WRT54G are equipped with detachable antennas that can be replaced with high gain counterparts. The “permanent” attachment in WHR-G125 is not so permanent after all. You can remove the antenna and install an external connector in as little as one hour [Fig 1].

Buffalo WHR-G125 router with external antenna connector modification
Fig. 1 Buffalo WHR-G125 router with external antenna connector

There is an alternative but more costly method to consider first. The board is equipped with a Hirose U.FL-R-SMT antenna connector [Fig. 2]. You could get a fitting pigtail and plug it directly into the board. These types of pigtails tend to be expensive.

Hirose U.FL-R-SMT connector on Buffalo router
Fig. 2 Hirose U.FL-R-SMT connector

I opted for a solution that cost me $1 U.S. at an electronics swap meet. It’s a pigtail that has bare wires on one end and an SMA connector on the other end [Fig. 3]. Let’s learn how to do it.

SMA pigtail
Fig. 3 $1 cable with SMA connector from HAM radio swap meet

First follow these instructions to open your WHR-G125.

soldier points for antenna on WHR-G125 printed circuit board
Fig. 4 Buffalo WHR-G125 onboard antenna contacts

Unsolder the stock antenna wires from the board. You should use a solder vacuum sucker and a soldering iron with a sharp tip. You don’t need a lot of heat.

The onboard antenna connections are in close proximity [Fig 4] to each other and it’s easy for the molten solder to jump the contacts. If this happens don’t despair. You have not ruined the board. Just use the vacuum tool to remove excess solder.

Depending on the type of external connector you intend to use you could drill a hole in the router enclosure and mount the connector there. I decided to go for a non-invasive option that consists of taking out the original antenna and placing the connector in the hole where the antenna was attached.

To remove the antenna squeeze the tabs as indicated [Fig. 5] and pull the antenna away from the router.

Closeup of Buffalo WHR-G125 router antenna joint
Fig. 5 Remove WHR-G125 stock antenna

 

Extreme closeup of SMA connector
Fig. 6 SMA connector is tiny
Bushing
Fig. 7 Cut bushing

 

SMA size connector [Fig. 6] is a little smaller than the antenna hole. In order for it to fit snugly I used a bushing. It was necessary to cut half of the rim off [Fig. 7]. The reason I had to do this is clear once you look at the antenna hole.

When I inserted the bushing in the hole [Fig. 8] it was a little wobbly so I put a tiny dab of glue to hold it in place.

With the bushing in place you can thread the pigtail through. It is OK to force jam the connector in the hole so it stays still (that’s what we wanted). You can place a couple of self adhesive cable holders onto the PCB just avoid placing them on the board lines or the components. [Fig. 9]

External antenna connector in WHR-G125 prepared
Fig. 8 Bushing in place
SMA pigtail placed inside the WiFi router
Fig. 9 SMA connector and pigtail inside WHR-G125

Solder the wires to the same board contacts where the stock antenna was connected. The center of the coaxial cable is connected closer to the miniature Hirose connector and the shield is connected to the square contact [Fig. 10]. Be careful that the solder does not jump the contacts.

Soldiering antenna connections inside the Buffalo router
Fig. 10 Pigtail soldered to the WHR-G125 PCB

It is possible to test if the solder job is good with an Ohm meter. There should be no connectivity between the outer ring and the tip of your connector. If the Ohm meter reads “0” either your pigtail is bad or your new solder job is bad [Fig. 11].

Test antenna using a multimeter (Ohmmeter)
Fig. 11 Test your work with a multimeter

You can test your external connector further if you wish. There should be connectivity between the tip of your connector and the tip of on-board Hirose U.FL-R-SMT miniature connector. The outer ring of your external connector should also be connected to the outer ring of Hirose connector [Fig. 12].

Test the antenna connections with multimeter
Fig. 12 Further testing is recommended (click to enlarge)

That’s all it takes. Now you can snap the enclosure back in place and store the original antenna in a safe place in case you ever want to put it back on.

Inexpensive Mount for a WiFi Biquad Antenna

Mount Your Antenna for under $8

Once you build a biquad you realize that it won’t stand on it’s own. The LMR-400 cable is very heavy and always pulls on your antenna causing it to face up. Using an antenna mount helps prevent this. It keeps the antenna locked in place and aids you in fine positioning the direction of the antenna.

DIY  antenna support for a WiFi antenna
Fig. 1 Cheap antenna support

You can purchase an antenna mount or even a security camera mount. They will work great but they tend to be expensive. I used a combination of electrical and plumbing pieces to build this antenna support for under $8 U.S. [Fig. 1].

DIY  antenna support for a biquad antenna
Fig. 2 Biquad atop the mount

It works well as a table stand [Fig. 2] and it can also be wall mounted using the screw holes on the base plate. The range of articulation is far greater with this mount then with a typical security camera mount.

You can really use your imagination in creating a functional mount. It is generally better to shy away from metal parts as they may reflect microwaves.

antenna parts are cheap PVC plumbing elements
Fig. 3 Mount parts under $8

Plumbing PVC elbows [Fig. 3] are cheap and give you the ability to rotate pieces and position the antenna in many different ways.To attach the antenna drill a hole [Fig. 4] on the antenna housing and screw in the mount top.

biquad antenna enclosure
Fig. 4 A hole in the enclosure

The ability to rotate the antenna is important for proper polarization. In simple terms you may get better signal by rotating your biquad 90 degrees to match the polarization of the access point’s antenna. This do-it-yourself antenna mount allows you to rotate the biquad and achieve just that.

Once you mount the antenna you can use Netstumbler to set it up. It’s a great tool for antenna installation and fine tuning.

iTunes Library Share Hack (Original)

Quick and easy iTunes hack

iTunes doesn’t play well with multiple accounts on one computer. This is the simple way I share my iTunes library and playlists with another Windows XP user on my computer.

This is a free and fast way of synchronizing songs and playlists between two or more users. Note that when user “A” adds to his library, the library of user “B” does not update automatically. No music files are copied or duplicated in this process.

iTunes files and music are stored in your:

C:\Documents and Settings\USER A\My Documents\My Music\iTunes

Our goal is for USER B to have access to all playlists and music from USER A’s account.

1. Go to: C:\Documents and Settings\USER B\My Documents\My Music\iTunes

Back up:

iTunes Music Library.xml
iTunes Library.itl

to a safe place should something go wrong. You can always place these files back where they came from if you want to revert to USER B’s original library.

2. Copy and paste:

iTunes Music Library.xml

from C:\Documents and Settings\USER A\My Documents\My Music\iTunes
to C:\Documents and Settings\USER B\My Documents\My Music\iTunes

3. Rename the extension of iTunes Library.itl to iTunes Library.txt in the USER B’s folder.

4. Open iTunes Library.txt in notepad, select all (CTRL+A) and delete all text. Save the file and rename it back to iTunes Library.itl. The size of the file should now show 0 KB.

5. Launch iTunes from USER B’s Windows XP account. Sit back and enjoy the music.

After the last step iTunes will go through a series of messages and prompts. It may take several minutes depending on the size of your library.

How this works is like this. The .XML file is iTunes library backup. In case .ITL file is damaged iTunes will rebuild the file using the .XML. So what we do is we swap out the XML file and damage the .ITL file and iTunes does the rest of the work for us.

I’m not familiar with Vista so I don’t know if this technique works with it.

iTunes Library Share Hack (Tuneshare)

Automatically share your music with other Windows users

Sharing a common iTunes library among two or more Windows users is not easy. iTunes is designed to function as a personal product where each user has a unique music collection.

But what if you and your spouse or roommate listen to the same music and subscribe to the same podcasts? Using Apple’s logic you’d have to store duplicates of everything in parallel libraries. This is a waste of disc space. Luckily there is an iTunes hack that makes it possible to have a common iTunes library.

The Tuneshare iTunes hack is based on an earlier article [LINK] and simplifies the process by using a batch file that you can run every time you want to give USER 2 access to USER 1’s iTunes library.

InstallTuneshare iTunes Hack

The Tuneshare iTunes library hack is simple to install and run. Copy and paste the code into the notepad and save it as tuneshare.bat.

Run the batch file from command line as:

tuneshare user1 user2

Where “user1” is the Windows user whose library you want to copy to “user2.” It is also possible to hard code the user names into the script so that you can run it by double clicking.

REM Use Tuneshare to share one iTunes library
REM between two or more Windows users.
REM Instructions for use at www.skifactz.com\wifi.

ECHO OFF

CLS
IF “%1″==”” GOTO Instructions

REM Remove garbage
IF EXIST C:\”Documents and Settings”\%2\”My Documents”\”My Music”\iTunes\”iTunes Library (Damaged).itl” DEL C:\”Documents and Settings”\%2\”My Documents”\”My Music”\iTunes\”iTunes Library (Damaged).itl”

REM Verify paths and user names
IF NOT EXIST C:\”Documents and Settings”\%1\”My Documents”\”My Music”\iTunes\”iTunes Music Library.xml” GOTO SourceError
IF NOT EXIST C:\”Documents and Settings”\%2\”My Documents”\”My Music”\iTunes GOTO DestinationError

REM Backup existing library
COPY C:\”Documents and Settings”\%2\”My Documents”\”My Music”\iTunes\”iTunes Music Library.xml” C:\”Documents and Settings”\%2\”My Documents”\”My Music”\iTunes\”Previous iTunes Libraries”\”iTunes Music Library.xml”
COPY C:\”Documents and Settings”\%2\”My Documents”\”My Music”\iTunes\”iTunes Library.itl” C:\”Documents and Settings”\%2\”My Documents”\”My Music”\iTunes\”Previous iTunes Libraries”\”iTunes Library.itl”

REM Modify *.itl and copy .xml
DEL C:\”Documents and Settings”\%2\”My Documents”\”My Music”\iTunes\”iTunes Library.itl”
ECHO OFF > C:\”Documents and Settings”\%2\”My Documents”\”My Music”\iTunes\”iTunes Library.itl”
COPY C:\”Documents and Settings”\%1\”My Documents”\”My Music”\iTunes\”iTunes Music Library.xml” C:\”Documents and Settings”\%2\”My Documents”\”My Music”\iTunes\”iTunes Music Library.xml”
ECHO %2’s iTunes library is now synchronized to %1’s library.
GOTO Done

:SourceError
CLS
ECHO Source path or source user name doesn’t exist.
ECHO Verify that your iTunes library path is
ECHO C:\Documents and Settings\USER\My Documents\My Music\iTunes
GOTO Done

:DestinationError
CLS
ECHO Destination path or destination user name doesn’t exist.
ECHO Verify that your iTunes library path is
ECHO C:\Documents and Settings\USER\My Documents\My Music\iTunes
GOTO Done

:Instructions
CLS
ECHO You must use this syntax: TUNESHARE USER1 USER2
ECHO where “user1” is the Windows user whose library you want to copy to “user2.”

:Done

Configure WiFi SIP Phone

Make Cheap Calls with a mobile WiFi Telephone

Even my mother knows about Skype. It allows you to make cheap domestic and international calls and free calls to other Skype users. What my mother doesn’t know is that Skype may not be the best VOIP solution out there.

UTStarcom F1000 WiFI SIP phone
Fig.1 UTStarcom F1000

In this tutorial we’ll learn how to setup a dirt cheap non-Skype internet telephone [Fig. 1]. The instructions apply to UTStarcom F1000G and F3000 models. Both models have identical menus.

I have several requirements for this project. First, I want a physical phone that I can carry around with me and make calls. Second, I want good sound quality and inexpensive rates to international destinations (at least as inexpensive as Skype). Third, I want to be able to make free internet-only calls to any standard VOIP phone.

Anyone can benefit from this setup but it is especially useful to people with family members in many different countries and small companies with a virtual office and employees all over the world.

Cost and Time

How expensive is this solution? A new WiFi phone will cost you from $120-200 USD on the Internet. Calling plans usually have no setup fee and you can start making landline calls with as little as several dollars balance on the account.

Prepare to spend 1-2 hours setting up your first phone and account. Once you get a sense how it works you’ll be able to do it in 10 minutes.

I knew nothing about the technology a month ago. By the time you finish reading this you’ll know as much as I do now.

VOIP Basics

Let’s review how all this works. VOIP stands for “Voice Over Internet Protocol.” It can be implemented in many ways but in the nutshell if communication between two telephones travels over the internet there is VOIP in play. The two phones need not have a 100% internet connection between them. You may have made VOIP calls without even knowing it. Inexpensive phone companies often use VOIP to deliver cheap rates to customers. You and the party you are calling may be using 70’s rotary phones but some part of the traffic between these two units is routed through the internet.

The advantage of VOIP is that more calls can be shoved through the pipe. Where an analog line could handle a limited number of calls a VOIP route can push many more calls through. This brings the cost down.

It doesn’t matter where you are in the world. Your calls will always cost the same and people will always be able to call you at your local number(s) regardless of your location.

It is important to consider that a setup described here is not a replacement for your regular phone. You can not make emergency 911 calls from this type of phone. There will also be many times when you are completely out of WiFi range and the phone is dead.

Glossary

Some terms will keep coming up so let’s review them:

Hardphone This is a physical VOIP phone. Something you can hold in your
hand.
Softphone A software VOIP phone. Think of Skype’s interface for example.
SIP Session Initiatiation Protocol. The most common VOIP standard.
Termination Outgoingcall.
Origination Incoming call.
DID Your own telephone number that can be dialed from any old phone.
AP Access Point. A wireless router WiFi phone can connect to.

 

Equipment

The only two pieces of equipment you will need are a SIP compliant WiFi phone and a computer. The computer is only used for initial setup and is not required on an ongoing basis other than to add money to your account. However, you can also use the computer to make and receive calls if you wish.

While there are tons of wired VOIP phones for use in office environments there are literally fewer than ten mobile WiFi phones available on the market. Most are designed for office use within well functioning wireless networks. Just about all of them have terrible user reviews.

The cheapest of the pack — Utstarcom F1000 and F1000G [Fig. 1] retail for about $110 (USD) but you can often find used ones cheaper on eBay. The “G” version is designed to work with both “b” and “g” type wireless networks which is not a significant advantage for VOIP.

The unit has very little terms of features we expect today. There is no color screen, no fancy ringtones, no camera, and no MP3 player. It is relatively small but it looks like a late 90’s Nokia. However, it has a significant advantage over the competition. This phone will roam between APs as you move around without dropping a call. Better yet, it will auto connect to any unlocked AP if the signal is strong enough. This means that you can take the phone with you out of the house and make calls from places with unlocked hotspots or unlocked municipal networks. You can also connect to locked (WEP/WPA) APs as long as you have the password.

One feature that’s lacking is a web browser. Without a browser it is difficult to log into hotspots that require authentication. The phone supports use of authentication scripts which must be written using a special application and loaded onto the phone in advance. This may not be rocket science but it’s hardly worth the time. There is one phone with a browser — Linksys WIP330 but it has such poor reviews that I don’t dare fork out over $200 (USD) for it.

Enough talk. Let’s do it.

STEP 1 – Download a Softphone

A softphone is not necessary but it will simplify testing procedure quite a bit. One of the best out there is X-Lite. Follow the installation instructions.

STEP 2 – Open a SIP Account

This is like signing up with a cell phone carrier except that there aren’t crazy contract commitments. There are many SIP providers out there. If there are setup fees I’d look the other way. Usually they’ll let you get started with a small balance transfer from a PayPal account or a credit card. I’m talking about just a few bucks. Some will even allow you to make free calls for testing purposes.

One thing that’s very different from signing up with a cell phone company is that when you open a SIP account you get the ability to call and receive calls from other SIP users (similar to Skype to Skype) and the ability to call regular phones (termination). If you want to be able to receive calls from regular phones you need DID which is billed separately and can be actuated through another provider. More about this later.

Check out the rates for the places you will be calling. Remember that switching providers later is very easy.

I ended up testing several providers. Cheapskates may want to consider www.voipcheap.com. They offer “free” calls to select countries and overall cheap rates. The way the “free” calls work is somewhat complicated. You make an initial payment of €10. After that you can call for free for 90 days. After 90 days they start applying standard rates to your calls and depleting your balance. At that point you can sink in another €10 and start a new 90 day period.

The thing that bugs me about voipcheap is that you have to download and install their Skype-like softphone in order to create a SIP account. Their softphone is absolutely non-essential. It’s just a hassle. I downloaded it, installed it, wrote down my SIP account information and uninstalled the software.

Another provider worth mentioning is www.callwithus.com. They have a nonsense-free setup and a very functional web interface used to configure your account settings. The rates are pretty low too. You can setup multiple numbers (SIP user names) under one account for no extra charge.

Explore other options your provider may offer such as voice mail, conference calling, etc.

STEP 3 – Setup Softphone and Make a Test Call

Whichever service you sign up with they’ll provide you with standard information used to setup your softphone/hardphone. For example voipcheap SIP information is as follows:

SIP port 5060
Registrar sip.VoipCheap.com
Proxy server sip.VoipCheap.com
Outbound proxy server leave empty
Account name your VoipCheap username
Password your VoipCheap password
Display name/number your VoipCheap username or voipnumber
Stunserver (option) stun.VoipCheap.com

 

In most cases it comes down to just the parameters in bold text.

Xlite SIP client menu button
Fig. 2 X-Lite Menu Button

Let’s setup X-Lite for use with Callwithus. Assuming that you have already opened an account and have your user name and password available start the X-Lite and click on the triangular icon button top left [Fig 2].

Choose “SIP Account Settings” and click on “Add.” Use this information from callwithus to complete your settings. Substitute your user name and password. “Display Name” is like a caller ID for SIP-to-SIP calls. “Authorization User Name” should be the same as your “User Name.” Note that user name is different from your callwithus account number. The user name is like your telephone number and callwithus allows you to have more than one user name under a single account.

When done click on “OK” and “Close” to get back to your X-Lite panel. The phone will connect to the server and say “Ready.” Test it by calling yourself. Because the SIP server doesn’t necessarily know where you are you always have to dial the country code first. To call a U.S. number (202) 555-1212 you’d have to dial this sequence: 12025551212.

STEP 4 – Setup an Incoming Telephone Number

You can purchase one or more incoming numbers (DID) from www.callwithus.com or most other SIP providers. Wait, multiple numbers all funneling to the same unit?

Yes. This feature is gold for business users who like to have local numbers where their clients are. Also if you’re looking for work in another state you could get a local number for couple of bucks a month to make an appearance that you’re local. You can get inexpensive 800 numbers too. It gets even better, read on.

You can get a 100% free incoming phone number in Washington State at www.ipkall.com. Why are they handing out free numbers? I have no idea. Maybe they are all routed through NSA supercomputers. The setup is simple. You give ipkall your email, SIP server address and your SIP user name. They hand you out a phone number. Within 60 minutes you are ready to receive calls. Test it is soon as 10 minutes later. It kicks in pretty quick. Call and your X-Lite will ring as long as it is connected.

STEP 5 – Setup Hardphone

All this exercise with X-Lite was to ensure your account is working and there aren’t any blocked ports in your router that could prevent SIP from going through your firewall. Once you’re comfortable with the softphone it’s time to move onto your new hardphone.

Utstarcom F1000 and F1000G have identical user interfaces so it doesn’t matter at all which one you have.

There are two “stages” to any WiFi phone’s connectivity. First it must be connected to your wireless router like a laptop computer. Once that is achieved it must connect to the SIP server in order to send and receive calls.

Initially your phone screen will probably say “No service try other AP.” To connect to your router for the first time press the SEARCH key (right softkey under the phone screen). After several seconds the names of all available wireless networks will come on screen. Chose your network and press the “Save” softkey. The screen will change giving you 4 slots where this network can be saved. Pick slot number 1 and save.

If you use no WEP/WPA protection you can up-arrow twice and press OK when “Activate” is selected. This will connect the phone to your network.

If you use protection down-arrow to “Security Mode” and chose whichever is appropriate “WEP Key Info” or “WPA PSK Info.” A prompt will ask you to “Enter Code.” The code is “888888” — your phone’s password. The next step is to enter your router’s WEP or WPA password. Exit and go to “Activate” and your phone should connect to the router.

If you fail to connect power cycle the phone and verify that all menu settings you just entered are correct.

We’re connected to your network now but still can’t make calls because the phone is not setup to register with the provider’s SIP server yet.

With the phone connected to the router we can edit the menus through a web browser on your computer which is a lot easier than thumbing on the phone. To do this we must determine the F1000’s IP address. The easiest way to do this is to press the MENU key from the phone’s main menu. Press up-arrow key three times until you get to “WiFi-Settings” and click OK. Down-arrow to “Network Parameter” and press OK. Up-arrow once and press OK to enter “Network Information.” IP address of the phone will be listed right at the top.

UTStarcom F1000 WiFI SIP phone IP address
Fig. 3 UTStarcom F1000 IP address typed in browser address field

Copy this number into your web browser’s address field [Fig. 3] and the phone configuration menu will come up. Login as “user” with “888888” password. Your computer must be connected to the same network as the phone in order to achieve this.

UTStarcom F1000 WiFI SIP phone web based menu
Fig. 4 UTStarcom F1000 web menu

Enter “USER MENU” on the left [Fig 4].

The only two submenus of immediate interest are “SIP and RTP Config” and “STUN Config.” Use this cheat sheet [LINK] to setup your parameters.

Click on “REBOOT” and the phone will restart. Allow about a minute for it to connect and register and make a test call. You can dial 3246 if using www.callwithus.com to start an echo test. Anything you say will be repeated to you free of charge. It’s great for kids!

STEP 6 – Making SIP Calls

If you have several of these phones or if you know someone with a SIP account you can bypass the traditional phone network and call them directly. These calls are free. In order to call someone who has a SIP account with the same provider as you just dial their number (SIP user name). SIP user names sometimes contain letters which can not be dialed from Utstarcom F1000/F1000G.

Dialing a SIP number serviced by another provider is not easy to do on F1000/F1000G because of the standard syntax: UserName@SipServer.com Even if the user name contains numbers only “@” and “.” can not be typed into the phone. However, all these calls can be easily initiated through X-Lite.

As limited as F1000’s dialing abilities are it is still useful to setup two or more phones under one SIP provider so you can make direct VOIP calls between them. If you have family members or co-workers in multiple countries this is a great way to stay in touch.

Troubleshooting

Your X-Lite installation is a great diagnostic tool should something go wrong. If you can make and receive calls from the softphone but not from Utstarcom F1000G it means that your hardphone settings are wrong.

Check if the phone is connected to the router first. If so, look at error messages on the home screen of the phone. Absence of any message usually means that the phone is connected to the AP and registered with the SIP server.

Blocked ports in your router are a common problem. Check with your SIP provider which port number(s) are used. Usually it is port 5060. Verify your router settings to see if the port is blocked which is sometimes done for security purposes. If you’re unsure how to do this but would still like to test the phone just take a walk with the phone and see if you can register through any unprotected WiFi networks on the street. The word is that this is illegal in some U.S. states. I don’t know whether this is true but if you just connect and register the impact on the bandwidth is minimal.

A Word on Skype

At the beginning I said that Skype may not be the best VOIP solution out there. Here’s why.

While Skype offers good rates and decent call quality it has several shortcomings. It is not SIP compliant which means that you can not easily connect to a much greater pool of telephone users who are SIP compliant.

Unlike using a SIP device where you can switch a provider with a few clicks of a mouse if you dislike the rates there is no alternative to Skype rates. Skype phone uses Skype proprietory technology and third party companies are excluded from competing and bringing less expensive rates.

Skype is based on peer-to-peer networking which means that when your phone is online calls could be routed through your computer even if you’re not talking on the phone. This takes up your bandwidth.

Watch YouTube on Roku

Simple workaround to enable YouTube on Roku

Note that since this post has been published, Roku has made available the official YouTube channel.

It’s too bad there is no official YouTube channel for the Roku box. My understanding is that every now and then someone makes one but YouTube shuts them down. I am not sure why this is, but there is a way around it.

Post a link to the YouTube video you want to watch on your Facebook account. You’ll need to do that on your computer. If you don’t want the link to be visible to your friends you can set the privacy option to “only me.”

Go to the Facebook channel on Roku and login into your account. Click on your YouTube video link and it will play back full screen on your TV.

Obviously, this multiple step workaround doesn’t allow you to search for videos using Roku, but at least it’s better than nothing

 

Email IP Address on Login

Automatically Email WAN IP Address at Login – Linux

Note that after this post was written whatsmyip.com has stopped providing support for IP detection automation. You may consider using icanhazip.com instead.

While I can only take a partial credit for this bash script which emails the WAN IP address at login, I expanded it and modified it for use with Gmail. The basic idea is that your Linux machine retrieves the internet IP address from www.whatsmyip.org and sends it out to an email recipient.

Why is this useful in the first place? My mom lives abroad. She uses Ubuntu and wants me to get inside of her computer to do occasional software updates or fixes. Because her provider assigns dynamic IP addresses to the customers, this script informs me of the IP address changes so I can log into her computer via SSH.

Other uses may include detection of unauthorized use, GPS-free geo tracking, etc.

The script gets the IP address from a third party service, compares it to the previous known address stored in a file called ipaddress, and if different, it emails it to the recipient.

#!/bin/bash
# Emails current IP address to a recipient. Requires package sendEmail with SSL and TLS.
#Last known IP address
IPFILE=/tmp/ipaddress
#Allow 60 seconds for the Internet connection to become active
sleep 60
#Retrieve and assign WAN IP address to CURRENT_IP
CURRENT_IP=$(wget -q -O - http://automation.whatismyip.com/n09230945.asp)
DATUM="$(date)"
#Customize the “from” address
MAIL_FROM="From: YOURNAME@gmail.com"
#Verify that ipaddress file exists, compare to the current IP, update ipaddress file
if [ -f $IPFILE ]; then
KNOWN_IP=$(cat $IPFILE)
else
KNOWN_IP=
fi
if [ "$CURRENT_IP" != "$KNOWN_IP" ]; then
echo $CURRENT_IP > $IPFILE
#Customize email addresses and Gmail password
sendEmail -f "$MAIL_FROM" -t RECIPIENT@YOURDOMAIN.COM -u "$CURRENT_IP" -m "$CURRENT_IP" "Local time is" "$DATUM" -s smtp.gmail.com:587 -xu YOURNAME@gmail.com -xp GMAIL-PASSWORD -o tls=yes > /dev/null
logger -t ipcheck -- IP changed to $CURRENT_IP
else
logger -t ipcheck -- No IP change
fi

Step-by-step Instructions

Create a directory called “bin” in your home directory unless one already exists. Create a new text file, copy and paste the above script into the file. Customize your Gmail information and save the script as “dynip.” Right click the script and give it a permission to execute. If that doesn’t work in your flavor of Linux, open up the terminal window and type these commands:

cd /home/yourusername/bin
chmod +x dynip

Now we need to make it possible for the operating system to execute your script from the command line regardless of your current directory. We’ll add the directory you created to the PATH system variable:

export PATH=$PATH:/home/yourusername/bin

Next, we’ll install the sendEmail package unless you already have it. In Debian/Ubuntu you can use:

sudo apt-get install sendEmail

If everything went right we can test the script by typing “dynip” at the command prompt. The script will wait for 60 seconds and email the IP address to the address specified within.

On Boot Scheduling

The script is now working at the command line level, but we need to add it to your crontab so it runs automatically each time you log into the computer. Crontab is a text file which keeps track of scheduled jobs. To edit the crontab:

crontab -e

Add a line of text:

@reboot /home/yourusername/bin/dynip

and save crontab. This will cause your computer to ryn dynip script every time you log in. It is possible to setup the same or similar automatic jobs for other users as well.

Voice Mail Hack

Mobile Phone Voice Mail Hacking

 

Stop unauthorized access of your cell phone voice mail

It’s incredibly easy to hack into someone’s mobile phone voice mail. Most if not all carriers have a wide open security gap waiting to be exploited. I’ve tested the hacking vulnerability of Sprint Nextel and it failed miserably. First let’s see how we can protect your voice mail.

It’s very simple. Make sure that your account allows you to set a voice mail password that’s active when you call in from your cell phone. If your mobile phone allows you to call your voice mail and go straight to listening the messages disable that option. If you can not disable it change your mobile phone provider right away!

Without a password access an unauthorized person can get in, listen to your messages, change all kinds of settings, even change the password so you’re locked out your own voice mail.

How It’s Done

When you dial your voice mail from your cell phone the provider’s computer system recognizes your caller ID and let’s you right in unless your password is enabled. A hacker can easily spoof caller ID.

There are several ways this can be accomplished. The easiest one is to setup a SIP VOIP account that allows outbound calls to regular telephone lines. There are hundreds of providers that specialize in this. By the way, SIP accounts are 100% legitimate.

Then you need a SIP compliant telephone, or if you don’t have one you can use a softphone like X-lite or Ekiga. Configure your softphone per SIP provider’s instructions and you’ll be able to dial numbers just as if you had a regular phone. This is still 100% legitimate and actually a very cheap method to place calls.

Netflix Connection Problem Solved

Pulling My Hair Over Double NAT Internet Connectivity Issue

This is not really a hack, but a solution to the Netflix connectivity problem I’ve had for months. My WAN connection had a brief, less than a second long break like a clockwork just about every eight minutes. Normally, this wouldn’t be a big deal, but it affected YouTube, Netflix and most Internet radio stations.

Every time the break occurred Netflix and YouTube would stall and require to hit F5 to reload the page. This was very annoying, and if left untended, Netflix would continue wasting minutes although picture was frozen on the screen.

I tried too many things to mention and spent a lot of time on the phone with all kinds of tech support people until I spoke to a brilliant tech support guy from Buffalo, the maker of my router. Although I am not even using the router’s stock firmware, this guy pointed out that there was a double NAT between the DSL modem and the router.

The modem was authenticating with my DSL provider and serving DHCP to the router. Ideally, you want the modem to act as just a dumb modem and have the router handle everything else. I logged into the modem, disabled the authentication, logged into the router and enabled PPoE authentication there. The problem was solved, no more Netflix glitches.

Childproof Your Computer

Add a key switch lock so your kid can’t turn it on or off

I childproofed my wife’s computer because she was tired of our little daughter turning it off while she was working. It’s cute once or twice but when your kid starts pushing that on/off button it’s time to mod the computer.

Philmore computer on/off key lock
Fig. 1 Computer Lock

A computer on/off switch is not like a wall light switch that stays in “on” position when actuated. It’s spring loaded like a door bell switch and close the circuit only for as long as you’re holding it down. I could not find a spring loaded, key actuated switch at the local store. Instead I bought a Philmore key switch [Fig. 1] and connected it in series with my existing computer on/off button.

The new key switch acts as a master computer switch. When it’s in the off position the existing switch can’t turn the computer on or off. When the key switch is it’s in the on position the existing switch works as designed. When the computer is on I can set the new key switch to off position and my daughter can’t power it down by pressing the on/off button.

The following photos  illustrate how I put the switch in although you will likely have to modify the steps to make this hack work with your computer. The process should not take more than a couple of hours. You will need basic tools and supplies like an electric drill with a large diameter hole cutter or a jigsaw, insulated copper wire, soldering iron and electrical tape.

Illustrated Computer Childproofing Steps

Take HP computer apart

Disconnect the AC power cable from the back of the computer. Remove the side and the front face. The on/off button has 2 white wires connected to it. The color of your wires may be different.

HP XW8600 power connector on motherboard

The white wires from the on/off button are part of the black bundle of wires. They are connected to the motherboard with a wide multipin connector. Disconnect this connector.

HP XW8600 power connector

Cut either of the wires from the on/off switch.

copper wire

Cut a piece of spare double wire long enough to reach the computer front. Strip the tips. Note the shrink tubing on the wires. I like shrink tubing better than electrical tape for the final insulation but you can also use electrical tape.

Tap into HP XW8600 power connector

Soldier the wires to the cut wires.

HP XW8600 power connector with switch line tap

Wrap some electrical tape to secure the wires and keep them away from fans and other components.

HP XW8600 on/off lock installation

Bring the wires to the front of the case. Strip the insulation, thread shrink tubing if you’re using it and don’t forget to thread the switch nut before you solder the wires to the switch. Go ahead and solder the wires to the switch.

HP XW8600 closing the front panel

Everything is in place. You can test your work now or if you trust your skills just tighten the switch nut and close up the computer.

HP XW8600 with on/off lock modification

All done. This computer is childoproof and immune to kids pushing the on/off button. Just hide the keys well.