Friday, September 9, 2011

Unlimited Free Phone Calls!

Free? Unlimited? Phone? Calls?
What’s this you say?

Yes, Free!
Free as in "beer" not as in "speech". And by that I mean no money out of pocket 100% no cost at all, Free.

Unlimited?
Well, almost. There is a transfer limit of how much data you can transfer. Whoa! “Hold on” you say, you said phone calls, what this about "data"? Calm down, I'll get to it.

And phone calls?
Yes "Phone". Lets just say yes but its only for incoming calls. You get a phone number that can receive calls but if you want to keep it 100% free you want be able make any calls out.

So basically, it works out like this; you get a free phone number that people can call you on. You can talk for up to 5000 minutes per month and you can make calls to Toll-Free numbers.

If you still want to know more, keep reading.

Things you will need to have:

1. High Speed Internet.
This one is non-negotiable. Since this "hack" basically uses VoIP for calls, it is essential that you have high speed Internet.

2. A Computer.
This is also pretty essential. Although you don’t "need" to have one, it sure is hard to do the setup online without one. You "could" use your smart phone to access the websites needed, but honestly it would be like pounding yourself on the head with a 10-pound sledge hammer to comb your hair just because you didn't want to spend the money for a comb. Do yourself a favor and just have a computer.

3. An IP Phone

There are a few options you have for this. You can buy a dedicated IP phone that plugs into your Ethernet, you can buy an adapter for you regular hoe phone, you can use software and a headset on your computer, or you can use an app if you have an iPhone or an android. Choice is yours. Personally I prefer the analog adapter. The one I like is the Linksys PAP2. Its about 20 bucks on ebay and allows you have two lines. Not two phones, two LINES. Which in the IP phone world means EXTENTIONS. Anyway, pick your poison and get one. For now, you can use XLITE which is a free software for your Winbloze or Mac.

4. An IQ of over 50.

You must be 10% smarter than a jar of mayonnaise to be able to comprehend most of the topics, Like “Internet” and “VoIP”


Lets get started.

So the way this works is that you sign up for a free GoogleVoice account. Then you sign up for a free SIP termination account. Next you sign up for a free SIP transfer account. Lastly, you sign up for a free account with PBXes.org which is a free hosted phone system.
Confused yet? I will explain.
GoogleVoice is free, they are giving out free phone numbers for you to use. What can you do with a stock GoogleVoice number? Lots. This is an excerpt from the googlevoice site:

Google Voice enhances the existing capabilities of your phone, regardless of which phone or carrier you have - for free. It also gives you:

One Number

Use a single number that rings you anywhere.

Online voicemail

Get transcribed messages delivered to your inbox.

Cheap calls

Free calls & text messages to the U.S. & Canada.

Super low rates everywhere else.

After you get your free GoogleVoice number, you will need to forward it to your cell phone for now. We will change that later. The GoogleVoice number is going to be your main number for receiving calls and for voicemail. As cool as GoogleVoice is, it still isn’t a phone. We need a way to pick up acall if someone calls us without having to use our cell phone minutes. We also want to have a completely indepentet phone from our cellphone. So now we go get our free phone number that is NOT our cell phone number. IPKall is a service that will give you a valid phone number for receiving phonecalls and sending those calls to a VoIP service of your choice. Since we don’t have a VoIP service and we don’t want to pay for one, we will make our own. We sign up for another free account from SIPSorcery.com. This company provides a way to take the SIP calls from IPKall and send them to a phone system capable of handling calls. Since we don’t have a phone system and we don’t want to pay for one, (you can see where this is going), we head over to PBXes.org and sing up for their free hosted phone system service.

So now that you are even more confused than before, read on and follow the steps.

Step 1 – GoogleVoice

Sign up for GoogleVoice. Head over to https://www.google.com/voice and sign up for a new account. If you already have a google or gmail account, DON’T USE IT, sign up for a new account. I used something like jasongvaccount@gmail. You want to use a new account because if you do use gmail, it will interfere with your calls when you check your mail.

Pick a phone number you like and log in when its all setup. You will need to add your cell number for setup but we will be changing that once we get to step 2. Once you have everything working in GooleVoice, test it by calling your googlevoice number form another phone. You cellphone should ring. GoogleVoice is pretty damn cool in its own right but it requires another phone to use the features. We will be eliminating the need for a paid phone.

Log into your GoogleVoice account and go to settings. Click on Calls and make sure you turn off call screening, turn on caller ID, and leave the rest on defaults.

Step 2 – SipSorcery

Go to https://www.sipsorcery.com/mainsite/Home/Pricing and sign up for a free account. Go ahead and use your googlevoice email for the sip sorcery account. It just makes it easier to keep track. Once you sign up you will get the sip server details you will need for the next step.

Step 3 – IPKall

Go to http://phone.ipkall.com/ fill out the info for a free number. Here’s a tip, the 425 area code gets you a number the fastest. Fill out the information and use the SIP server information you got from Sip Sorcery.

Make sure you use the same email address again. Its just easier to keep track. Once you get your number , you should be all set for the last step.

Step 4 – PBXes.org

Go to https://www2.pbxes.com/config.php. Guess what you do. That’s right, sign up for a free account. Once you have your account, login and follow the steps to configure.

First thing you need to do is add an extension so you can test it. Click on extensions and click add. Click SIP. Pick an extention number like 1000, and type in a password. Click submit and then click the red apply bar at the top.

Before you can configure your new phone system, you need a phone. I know what your thinking, “I have a phone!” No you don’t. Well maybe you do, but it most likely wont work. You need an IP phone.

See item you require number 3 above. I suggest testing it out with XLITE.

Open Xlite and go to preferences. Add an account.

UserID will be your account name – your extension. S if your account name is: mypbx and your extension is 1000, your userid will be: mpbx-1000.

Type in the password. Type in the same userID in the Authorization name.

Click OK.

Now make a test call. Dial *98. That’s voicemail. If everything worked, you should now hear that you have no voicemail.

Great. Your phone server is working.

If you try to make an outgoing call now, you want be connected, but that’s fine. We need to configure our phone server to accept the calls.

In PBXes, click on trunks.

Click Add Trunk, Add SIP trunk.

Name the trunk SipSorcery.

Username: your sipsourcery username

Password: your sipsorcery password

Register: YES – Incoming and outgoing.

Click submit, then click the red apply bar at the top.

Log back into your googlevoice account and click on your number to go to settings. Click on phones. Click add another phone and add your IPKall number. You will need to verify it.

If all goes well, Google voice will try to call your IPKall number which will be routed to your SipSorcery account wich then passes it to your phone server which then passes it to your XLITE software phone. In a matter of 10ms, your computer is ringing asking you to verify your new number with googlevoice.

Now, you can call your googlevoice number and it will ring into your software phone.

Free incoming calls!

The only thing you need to do now to make this more practical, is to get a telephone adapter like the Linksys PAP2 so you can use your real phone.

You can add up to 10 extensions to this setup.

You can also install an APP on your iphone or android that will allow you to receive calls over wifi wherever you are.

If you miss a call, it will be sent to your googlevice account and the voicemail will be emailed to you and also transcribed into text.

Sunday, March 6, 2011

Setting up USB Drive Swapping for Backup Exec 11d


The purpose of this document is to archive the process I followed in order to get USB swapping working without user intervention in Backup Exec 11d. This document is NOT intended as a HOW-TO, only a rough guide.

This outlines the ability to swap back and forth between 2 or more USB drives and have the backup job run without the need for any user to manually bring different Backup-to-Disk Folders back online.

You will need some “Special Sauce” for this to work. It is a third party application called USBDLM. USBDLM, among many other options, allows you to hard set a windows assigned drive letter to the unique Device ID of a USB drive. This is crucial to the success of many USB swapping scenarios.

Format and Assign Drive letters:

Format your USB drives and name them accordingly. I name them BackupUSB1 and BackupUSB2 or something similar.

Download and Configure USBDLM

Copy USBDLM to C:\Tools\

Find USB Dev ID’s for Drives:

Run C:\Tools\USBDLM\List_USB_Drives_to_Notepad.cmd

Look for this string under each drive leter:

Ctrl DevID = USB\VID_xxxxxxxxxx

You need this string for each drive you need to assign drive letters to.

Create the USBDLM.ini file:

[Settings]

NoMediaNoLetter=0

WriteLogFile=0

LogFile=

LogLevel=3

[BalloonTips]

Enabled=1

Timeout=6000

[DriveLetters]

Letter1=

Letter2=

Letter3=

[DriveLetters10]

DeviceID1=USB\VID_13FD&PID_1340\4A503639333048443230524C

Letter1=M

[DriveLetters20]

DeviceID1=USB\VID_13FD&PID_1340\4A5032393430485133544744

Letter1=N

[NetworkLetters]

Letter1=

Letter2=

Letter3=

Run _install.cmd to register USBDLM service.

Your USB Drives will now be assigned the drive letters M and N. Everytime you plug in the drive it will be assigned this letter.

Setup and Configure Backup Exec for the USB Drives.

Create the Storage Devices.

In Backup Exec, choose Devices.

Right-Click on Backup-to-Disk Folders. (Removable Backup-to-Disk Folders is only for use with Zip and Jazz and CDRW type devices.)

Name the first one “USB_BACKUP1” or similar.

Make sure you choose “Allocate the maximum size for backup-to-disk files” and on the Advanced tab, be sure that “Disk space reserve” is unchecked.

Choose the Path to the USB drive M:

Click OK.

Do the same for the second USB drive changing the name to “USB_BACKUP2” and the Path to N:

Create a Storage pool for the USB Drives.

In Backup Exec, choose Devices.

Right-Click on “Device Pools”, Choose “New Device Pool”.

Name the Pool “USBDRIVES”

Check the boxes next the USB Drives.

Click OK.

Create the Pause/Unpause script for the USB Drives.

Create a batch file in C:\Tools\ResetDrives.bat with the following:

# Batch file to Pause and unpause B2D Folders

#Get into the backup exec folder. The command won’t run if you’re not in there.

CD C:\"Program Files"\Symantec\"Backup Exec"\

# Pause USB1

bemcmd -o60 -d:"USB_BACKUP1"

# Pause USB2

bemcmd -o60 -d:"USB_BACKUP2"

#Using Ping to Wait 10Sec

Ping –n 11 127.0.0.1

# Unpause USB1

bemcmd -o61 -d:"USB_BACKUP1"

# Unpause USB2

bemcmd -o61 -d:"USB_BACKUP2"

#Using Ping to Wait 10Sec

Ping –n 11 127.0.0.1

# Pause USB1

bemcmd -o60 -d:"USB_BACKUP1"

# Pause USB2

bemcmd -o60 -d:"USB_BACKUP2"

#Using Ping to Wait 10Sec

Ping –n 11 127.0.0.1

# Unpause USB1

bemcmd -o61 -d:"USB_BACKUP1"

# Unpause USB2

bemcmd -o61 -d:"USB_BACKUP2"

Create a Backup Job.

In Backup Exec, choose Media.

Create a new Media Set for a Daily Job.

Choose Job Setup. Create new Backup.

During the Creation of the Backup Job, under “Destination – Devices and Media”, be sure you choose the Device “USBDRIVES” and The correct Media Set.

Under Settings – “Pre/Post Commands” in the Pre-command, Type:

C:\Tools\ResetDrives.bat

Leave the box checked “Run job only if pre-command is successful”

Be sure to uncheck “Allow pre- and post-commands to be successful only is completed with a return code of zero.” If you check this box the Backup will fail as the Return code is “1” or “-1”

Create a Scheduled Task for the ResetDrives.Bat (optional)

Create a Scheduled Task to run in Windows every 1 Hour form 1am to 11pm.

Add the ResetDrives batch to the AutoRun of the USBDLM.

Add this line to the end of the USBDLM.ini file in C:\Tools\USBDLM

[OnArrival10]

Workdir=”C:\Program Files\Symantec\Backup Exec\”

Open=C:\Tools\ResetDrives.bat

Run the cmd:

>net stop USBDLM

>net start USBDLM

Thursday, March 25, 2010

Using XAR to archive files

Archiving large amounts of information is part of any Admin's job.
The problem comes when you need to decide how to do it. Do you use off the shelf backup software? Do you create your own solution?

When I set out to find a solution to our archival problem here I wanted something easy to use, and that could be run from any computer. With those requirements, I was limited to what was built into Mac OS X. I have used TAR and the infamous ZIP formats. These both work well but I wanted abetter solution.

The problem I have with ZIP is that it is an aging format. It is being phased out on the windows side to the more popular RAR and the newer 7zip formats. ZIP also does not have a table of contents. That means that every time you want to see what is in your ZIP file you need to actually run an unzip command at some level to see the listing of the files.

TAR is much better and is widely considered standard in the UNIX and LINUX communities. TAR can be used with multiple compression formats and is the commonly accepted format for most packages on those platforms and has been around since 1979. TAR comes from the tape back up world. In fact, TAR stands for Tape ARchive. Being written for Tape archives, TAR was originally written for sequential I/O devices. This means the that as you are creating the archive, the data is streamed in. This make creating archives fast but also makes retrieving data out slow. The reason is because the TAR format does not keep a table of contents of the files in the archive. If you want to know what is in the archive you must actually runt the TAR command to stream out the list of files. After you do that you can extract the file you need.

Enter XAR. XAR is a relatively new archive format. XAR has been adopted by Apple as of Mac OS 10.5 for all install packages. XAR is different int he fact that it keep a full table of contents of the files in the archive at the very beginning of the file in XML format. this is handing because if you need a fast listing of the files in the archive, no matter how large the archive is, it's a simple matter of running the XAR command to get the table of contents shown to you. Light years faster than ZIP and even faster than TAR.

So how do we use XAR to archive many files? Well that depends on how you want to archive your data. We have our files organized in such a way that there are main folder levels of the names of the categories and then multiple "jobs" in each subdirectory. See below.

MAIN FOLDER---
\------------Client_01
\----------- Job_01
\----------- Job_02
\----------- Job_03
\----------- Etc.......
\------------Client_02
\------------ Job_01
\----------- Job_01
\----------- Job_02
\----------- Job_03
\----------- Etc.......

So lets say I want to only turn the "Job" folders into separate XAR archives. I could CD into each folder and run the XAR command to make an archive and wait for each one, moving to the next folder and then waiting. While this would work fine, it certainly would take some time considering the there are normally around 1000 jobs in each client folder and over 1000 clients. I also want to verify the data and then delete the original folder once its turned into an archive thereby saving over the half the size. Automation is the key here.

A shell script works great for this.
So the steps my script will make is:
1. Copy all the contents from one level deep to a new location using RSYNC. (I will talk about RSYNC in another post)
2. Change any names of folders removing any illegal characters.
3. Create a XAR archive of the folder.
4. Delete the original folder.
5. move to the next folder in the list.

Heres how I did it.

The command is run with: $ ./xarchive.sh [Source] [Destination]
Note that source and destination can be the same if you want to XAR archive and Delete in the same place. Or you can use a new destination to empty the original and archive it to new location.

#!/bin/bash

#find all the folders that have illegl names and change them.
#this command calls a perl script to do the work: fix_names.pl

find "$1" . -depth 1 -type d -print0 | xargs -0 ./fix_names.pl > renamed.text

(cd "$1"
find . -depth 1 -type d -print0 | xargs -0 stat -f "%N") > srcstats.txt
# this whole command prints out the full file path for each directory in the first argument.
# find . = Find everything in current dir.
# -depth 1 = Look level deep
# -type d = find Dir's
# -print0 = Prints the pathname of the found file
# xargs -0 = Changes xargs to expect a NULL char from the print0 command as a seperator. this is NULL char is added to the end of each file name and xargs then parses each file pathname as one item each.
# stat - displays the file infomation from each of xargs items.
# -f "%N" = Displays the name of each file item from xargs.
echo srcstats.txt ..................... DONE!

mkdir $2

sed -e 's:[A-Z]*..\(.*\):rsync -avrhzE --stats --progress "'"$1"'\1/" "'"$2"'\1" ; xar -vcf "'"$2"'\1.xar" "'"$2"'\1" ; rm -R "'"$2"'\1":' srcstats.txt > output.txt

echo output.txt ..................... DONE!

cp output.txt xarfiles.sh

chmod +x xarfiles.sh

echo xarfiles.sh ................... DONE!
echo executing xarfiles.sh . . . . . NOW!
./xarfiles.sh

Monday, November 23, 2009

Creating a live, hot, bootable backup of Mac OS X

There are many backup utilities and software the Mac OS X platform that will perform a live backup of your system.
There is the built in Time Machine that will backup your entire system as it runs and keep backing up files as change.
There are also many 3rd party applications that will run as a full backup and incremental of the entire system while it is mounted and running.
None of these were options that I wanted to follow.
Time Machine is great except for the fact that you cant easily restore from it to another computer in case of a hardware failure.
The other applications are great as well but most of them cost a lot of money and still don't give you what I wanted; a DMG file of my system hard drive.
In the past, they way I have cloned a full system was to restart the Mac form either the MacOS X DVD or a "Tech Drive" with a bootable OS on it. Then fire up Disk Utility and make a DMG image of the hard drive.
This worked great. All for the problem that I have to restart the Mac and its all hands on.
On a server the option to shut it down is now there. Let alone the fact that many of the G5 xserves out there ware headless which make it even harder to reboot and image the system drive.

So I had to come up with a way to make a full bootable copy of a live running system. And I wanted this all automated.

I discovered the Apple System Restore command: asr
ASR can copy a complete running system to another hard drive or existing DMG image.
The downside is that ASR needs and existing DMG and it must be an expandable sparseimage. Sparseimages are not restorable and they take up alot of space.
I wanted a read-only, compressed disk image.

Here is what I came up with:
1. Create a sparseimage file large enough to to clone the hard drive.
2. Name the sparseimage with the date and name of the server.
3. Mount the sparseimage and create a new compressed read-only DMG from the mounted sparseimage.
4. Delete the sparseimage keeping the compressed DMG image at half the size.

If I ever need to restore the system or clone its state to another Mac, I only need to use Disk Utility to restore the DMG to a Hard Drive.

Below is my sample shell script that I will be refining as time goes on.
I named this script: asrclone.sh

It takes two arguments, source hard drive and destination folder.
I type the command then use the drag and drop method the fill in the paths.

Syntax:

asrclone.sh [Source Path] [Destination Path]

Example:

$ ./asrclone.sh /Volumes/HardDrive /Volumes/Backup/Server1

File Contents:
#!/bin/bash

# get date

echo "The create date is: `(set \`date\`; echo $2-$3)`"
echo Building run script

# Create new sparse image with date in name using second arg for destination


echo hdiutil create -size 50g -type SPARSE -fs HFS+J "$2/server1-`(set \`date\`;echo $2-$3)`.sparseimage" > output.txt

# Attach image


echo hdiutil attach "$2/server1-`(set \`date\`;echo $2-$3)`.sparseimage" >> output.txt

# Run ASR to clone drive as first arg to now mounted untiled sparseimage drive


echo sudo asr restore --source "$1" --target /Volumes/untitled/ --erase --noprompt >> output.txt

# Create readonly compressed image for backup compression


echo sudo hdiutil create -format UDZO -srcfolder \"$1\ 1\" "$2/server1-`(set \`date\`;echo $2-$3)`.dmg" >> output.txt

# Unmount the sparseimage and remove it


echo hdiutil detach \"$1\ 1\" >> output.txt

echo rm "$2/server1-`(set \`date\`;echo $2-$3)`.sparseimage" >> output.txt

cp output.txt run.sh

chmod +x run.sh

echo Executing run script
./run.sh

echo removing text files
rm output.txt

echo removing run script
rm run.sh