Jun 17 2010

Use an ssh server as a secure proxy [to access U.S.-only websites, and trick Megavideo for unlimited viewing!]

While trying to watch some World Cup matches online while in Mexico, I stumbled upon many U.S.-only sites. I started reading about proxies again, and while there’s some decent proxy lists out there, you still have to hunt for a good, fast one and when I tried many of them some videos would still have trouble opening.

Instead, I found this article on using an ssh connection as a proxy to route all internet requests through it. As they say, most webhosts provide ssh access and I’ve confirmed the method works with my DreamHost ssh connection, for example. I use the -C argument to compress data, and the connection is virtually as fast as with no proxy at all.

You can change Firefox’s settings directly, as they explain, but if you want a more practical way to switch back and forth between the default settings and the proxy, you can use FoxyProxy, a Firefox extension to handle different proxies and even specify which websites use which proxy. Just make sure to check the SOCKS option to get the ssh-proxy method working:

FoxyProxy settings for ssh server

FoxyProxy settings for ssh server

So this is cool if you’re abroad and want to get to Hulu, Pandora, or any U.S.-only site, or just want to encrypt your connection. It saved me the proxy testing, and everything has worked for me so far as it would with no proxy.

Unlimited Megavideo, other restricting sites?

Even if you’re in the U.S. and can access all these sites, I have found one more bonus benefit of the proxy setup for Megavideo fans, such as myself: when you exhaust your viewing time using your default computer connection, switch to the ssh proxy. Megavideo thinks the request comes from the computer you’re ssh’d into! Exhaust the proxy’s viewing limit, then come back to your computer to keep watching :) .

All methods to trick Megavideo I’ve seen involve resetting your router, if not digging deep into the browser’s cache settings, plus I never really got them to work consistently, so this has been a great, practical solution for me.

I also feel like this would work as a workaround for other sites that make you wait (Rapidshare, etc?) so give it a try.

May 27 2010

Make free VoIP calls to U.S. numbers from Android (even from abroad!) using Gizmo5, Google Voice, Sipdroid and GVoice Callback

I’m home in Mexico right now, and I was looking for the cheapest way to call people in the U.S. I happened to have a Gizmo5 account from a long time ago, and I snatched a Google Voice account when it was GrandCentral, and I found out you can use the two together to call U.S. numbers for free with VoIP wherever you are. It turns out my internet here is fast enough for VoIP, and I don’t have a data plan but I don’t mind having to call over wi-fi, so it was a great solution for me.

There’s actually lots of places online that tell you how to get Google Voice and Gizmo5 working together, but I went a bit farther and got the whole method working on my Android phone. I guess, for me, mostly just to feel like I’m making a free true phone call to the U.S., but it’s also useful if you are in someone else’s wireless network with no access to a computer, or if you have good enough 3G (I think it works on 3G as well but don’t take my word for it). In any case, here it is (I am, of course, assuming you have both Gizmo5 and Google Voice accounts):

Register your Gizmo5 phone number on Google Voice

(I read somewhere that you can’t add a Gizmo number to Google Voice unless you have at least one regular, verified U.S. phone added first, so make sure you have that, in case this step is not working for you).

The reason you have to use both services together is that Google Voice does not make calls in itself. It only makes calls through the phones you register with it. So we are gonna register the Gizmo5 number so that GV can make calls through it.

Since the method GV uses to make calls with your registered phones is to call them and thus connect them with the actual number you want to call, this works for free with Gizmo5, because all it sees is an inbound call from GV, and these are free of charge.

First you need to register your Gizmo5 number with Google Voice so it can be used as a callback number. Log onto Google Voice, go to Settings > Phones and click on Add a new phone. Give the number a name (I did “Gizmo”), write your Gizmo5 phone number and select “Gizmo” from the Phone Type drop-down menu.

Add your Gizmo5 number to Google Voice

Add your Gizmo5 number to Google Voice

You can already make calls for free on your computer

This is actually all the setup needed to make free calls using your computer.

  1. First open your Gizmo5 phone. This can be done either on the web interface by signing onto your account on www.gizmocall.com, or by downloading the Gizmo5 desktop app for your OS here and signing on to it (on an interesting sidenote, my Mac app used to be stuck “Connecting…” and it turned out it was cause I had a symbol in my password, which Gizmo5 itself does allow but apparently the app doensn’t? Kinda humorous but maybe applicable to you)
  2. Once you have Gizmo5 open, you need Google Voice to actually connect the call. Log into Google Voice, click on the Call button on the top left and write the desired U.S. number you want to call, then select your Gizmo phone from the Phone to ring drop-down.
  3. Start the call on Google Voice

    Start the call on Google Voice

  4. Finally, click on Connect. This should ring your Gizmo5 phone, which will simply detect a call from Google Voice. Answer that call on Gizmo5 and you will be connected to the number you dialed from GV.

If you’re happy with calling from your computer over the Gizmo5 interface, you’re done! To use this method on Android, keep reading below. Basically, Sipdroid and GVoice Callback will do on Android the job Google Voice and the Gizmo5 client (or web interface) do together on a PC, respectively.

Install and setup Sipdroid

Note: If you have the actual Google Voice app installed on the Android phone, you should have it NOT be the default for outgoing calls by going to the app and then Menu > Settings > Do not Google Voice to make any calls (or Ask every time I make a call).

Sipdroid will act as the Gizmo5 client on the Android phone. Go to the Market and search for “Sipdroid”. The actual app is called “Sipdroid VoIP”. Download and install it.

Open Sipdroid and go to Menu > Settings > SIP Account Settings. Fill these out as follows:

  • Authorization Username: Gizmo username or Gizmo number (747*) will work. I used username.
  • Password: Gizmo password
  • Server: proxy01.sipphone.com
  • Domain: leave empty
  • Username/Caller ID: leave empty (Important! Apparently there’s a bug unless you leave this blank)
  • Port: leave default (5060)
  • Protocol: UDP

Sipdroid setup

Sipdroid setup

You should see the notification icon go green once your settings are correct. For Preferred Call Type, choose Phone so it (like the Google Voice app) doesn’t interfere with outbound calls.

Have Sipdroid not interfere with outbound calls

Have Sipdroid not interfere with outbound calls

Additionally, if you’re planning to try this over 3G, you should check Use 3G inside Call Options.

Setup GVoice Callback to be able to catch outbound calls and connect them through Gizmo5 (Sipdroid)

That’s it for Sipdroid. Leave it open (it stays open anyways even if you click Back or Home). Go back to the Market and search for “GVoice Callback”. Download and install.

Open the app and fill out the main screen as follows:

  • Callback is enabled when…: I have this set to Ask me every time. This allows to either make a normal call when I dial a number or choose to make it through Sipdroid using GV.
  • Your callback number: Your Gizmo5 number
  • Phone type: Gizmo (Important)
  • Google Voice login information: speaks for itself
GVoice Callback setup

GVoice Callback setup

Click on Finish. GVoice Callback should work for a bit logging you into GV, then it will say the settings are saved and exit automatically.

Make a call from your Android

Make sure Sipdroid is running (the green circle should be in the notification bar), and wi-fi (or 3G), obviously, then simply dial a U.S. number on Android the way you would for any other number (that is, use the Dialer or click on their phone number from the Contacts app or whatever). The way I set it up on GVoice Callback (Ask me everytime), I get a popup asking if I want to place the call using GVoice Callback or call normally. Click on Use GVoice Callback.

Use GVoice Callback

Use CVoice Callback

That’s it! GVoice Callback will work for a bit:

GVoice Callback connecting the call

GVoice Callback connecting the call

Then it will call Gizmo5 (Sipdroid) and connect the call. Same as the desktop Gizmo5 client, Sipdroid only sees an inbound call from GVoice Callback, so it’ll open and you have to slide up to answer the call. At this point you will, at last, be connected to the original number you dialed:

Slide up to answer the call

Slide up to answer the call

I hope this is useful. Again, since it’s an inbound call to Gizmo5, you don’t get any balance deducted (in fact I have no balance on Gizmo5 at all). The method works well for me. Sound quality is decent over my wireless network, and hey, it’s free after all! Feel free to leave comments about 3G performance if you give it a try.

May 23 2010

Connect to UPenn’s AirPennNet on Android [2.1+]

At last, I recently found a way to connect to AirPennNet on Android 2.1 and up, as outlined in this post:

  1. Select AirPennNet from recognized access points
  2. Select EAP method: TTLS
  3. Select Phase 2 authentication: PAP
  4. Leave CA certificate and Client certificate set to N/A
  5. Set Identify to your PennKey username
  6. Leave Anonymous identity blank
  7. Set Wireless password to your PennKey password

May 4 2010

More SVN tips

Flag a file to be ignored by SVN updates/commits

Good tip here

Use svn and git together

See this (though when they say “/opt/local/libexex/git-core” they have a typo and they mean “/opt/local/libexec/git-core”) and this

May 4 2010

Make a previous revision the HEAD revision on SVN

If you want to change revision A (usually the current revision) back to a previous revision B and apply all changes, use the following command from the main svn directory on your working copy:

svn merge -r A:B .

Note: Notice the dot at the end of that command to update the entire directory!

After that you can commit changes and you will effectively had brought back the repository revision back to a previous one.

May 2 2010

Activate HTC G1 on wi-fi without a data plan SIM card

I remember somewhere in my head the CyanogenMod ROM having the option to choose a wireless network instead of an APN when you do a clean install and find yourself on the “Touch the android to begin” screen to start activating your phone, but lately I haven’t found that option anymore.

I’ve read many ways to try to do it through wi-fi, but the one that I find easiest and that has always worked for me is to connect the phone to my computer as it is on that screen, open the terminal on my computer, and then do:

adb shell
am start -a android.intent.action.MAIN -n com.android.settings/.Settings

This opens the Settings screen on the phone and then you can connect to a wireless network from there.

Apr 1 2010

Easily password-protect files on Mac

Cryptor is a nice and easy way to password-protect files on OS X

Mar 31 2010

Schedule email for automatic future delivery

I was looking into how to schedule email to be sent automatically at a later time (tired of trying to remember birthdays?) I suppose you could do it with sendmail/mail and a script scheduled to run at a certain time, but for more GUIish solutions, I found a couple options:

  1. Install Thunderbird 2 here and use the Send Later add-on (as of now, Send Later doesn’t install on Thunderbird 3),
  2. Use Deferred Sender (works with any email account) or
  3. If you’re on Windows, there’s this guide for Outlook 2007

Mar 30 2010

Can’t find Google Maps on the Market?

I have an HTC G1 and I’ve been playing around with CyanogenMod on it for a while. Every time a new Google Maps came out, it would not show up on the Market at all; I would always have to download the .apk from somewhere.

I could never really find a reason why on any forums and few people seemed to have a similar problem. It turns out, it’s because I have a Mexican SIM card in my phone and I guess Google Maps is kind of a US-only app? In any case, I downloaded MarketEnabler, installed the .apk on my phone, and set up T-Mobile as my carrier to fake (click-and-hold):


Click and hold US T-Mobile

When opening the Market after that, Google Maps (along with a bunch of other US apps I didn’t know about) showed up as it should.

Google Maps on the Market

Google Maps shows up

Note: As far as I’ve seen, when you reboot the phone, the Market goes back to recognizing the SIM carrier so you have to repeat the MarketEnabler process.

Mar 29 2010

Simple svn usage

I just started really using svn. This is the way I would’ve liked it explained to me:

An svn repository is like a regular server, except it keeps track of changes to the files you upload in a neat way (and much more but that’s the main idea). Once you have the repository set up (I have Dreamhost and they make it really easy) you can start uploading anything that you want to keep track of, usually a project of some sort.

You commit changes to the repository (modifying, adding, deleting stuff) in svn. svn calls every change that you commit a revision and the default revision is zero when the repo is first created and empty. I’ve only used repos as a place to upload and keep track of my projects; that’s the simplest way to use it.

Let’s say I created my repo at svn.noemartinez.com/myproject. There’s many protocols you can access your repo through, depending on the setup. Dreamhost lets you setup http/https (using “http://” prefix) users when you create the repo, but you can also access it using your existing ssh users (using “svn+ssh” prefix) for the domain.

One thing is, when you try to use the raw URLs, either http://svn.noemartinez.com/myproject or svn+ssh://svn.noemartinez.com/myproject, svn will take the username that you’re logged in with at the computer you’re using to access the repo, which is sometimes (usually) not the same as the http/ssh user you want to access the repo through. To use a the right user, the –username argument works for http (as the man page for svn says), for example

svn list --username [user] http://svn.noemartinez.com/myproject

but for ssh you have to use the syntax:

svn list svn+ssh://[user]@svn.noemartinez.com/myproject

In any case, the main svn commands you end up using for a simple project, in my opinion, are import, export, checkout, update and commit.

Usually, at the beginning you have an empty repo set up, and a bunch of files locally in a computer that you want to end up managing with svn (say, a folder called project). Initially, they are “unversioned” (meaning the svn repo is not linked to them and svn doesn’t know they’re in your computer). To import unversioned files to the repo at first, you use the import command, like this:

svn import --username [user] [path to project] http://svn.noemartinez.com/myproject

From then onwards, the folder project will be saved on the repository. However, the original project folder on the computer is still not a working copy (SVN still isn’t linked to it). To begin editing a working copy whose changes will be kept track of, you have to checkout the project from SVN now that it’s there. Use the command like this:

svn checkout --username [user] http://svn.noemartinez.com/myproject my-working-copy

So now you have a copy of the project in the folder my-working-copy that’s linked to the repo. You can go ahead and modify your project as much as you want. After some changes, or when you have something new working, for example, you’ll want to start updating the project on the repo. To do this, go to the folder you want to commit (usually the top folder, my-working-copy in this case), and use the commit command:

svn commit -m "I got a new feature working"

This submits all changes to the repository, creating a new revision of the project, and attaching the message “I got a new feature working” to this revision.

If you want to make sure your project is updated to the latest version (with all the changes all other users may have commited), use the update command:

svn update

Finally, if you ever want to have a copy of the project without all the svn information, that is, to have an unversioned copy again, use the export command, either using the repo directly, or using your working copy:

svn export --username [user] http://svn.noemartinez.com/myproject my-exported-project


svn export --username [user] my-working-copy my-exported-project