Categories
Uncategorized

Fixing the Google+ Issue on Bangla Lion

For some reasons, many Bangla Lion users are randomly not being able to consume many static contents from Google+. They are also not being able to download any email attachments from Gmail. What’s happening? Google serves their content from googleusercontent.com. Gmail attachments are also served from a sub-domain of this domain. For some unknown reasons we can not access that domain sometimes, sometimes we can.

Just a few moments ago, when I complained to Bangla Lion customer care, the customer manager helped me fix the problem. What we did?

1) First we set no proxies. On my Firefox 5, I had proxies set to system proxies. Bangla Lion’s customer manager suggested that I should set no proxy or automatic detection for proxies. I changed it to no proxy. For this, I went to Firefox Menu > Options > Options > Advanced > Network > Settings (I am using FF5).

2) Then I went to “Network and Sharing Center” > “Change Adapter Settings”. I right clicked on my Bangla Lion connection (I am using the indoor device, so mine is a wired network) and selected “Properties”. In the “Networking” tab, I double clicked on the TCP/IPv4 entry. The dialog box I got, it let me define how my IP address and DNS addresses are obtained. I manually set the DNS Servers to: 4.2.2.8 & 4.2.2.2 .

The customer manager also gave me another pair of DNS in case I still have an issue: 4.2.2.5 & 8.8.8.8
This was supposedly a good sign of proper customer service, which I had read the other day on https://www.salesforce.com/products/guide/lead-gen/.

3) I cleared my browser’s cache and everything was okay. To test things, I have restarted my router several times to see what happens when I am assigned to different IP address. Everything looks fine.

So, the description I gave so far is very specific to Windows 7 and Firefox. A general instruction for any OS and any browser should be:

1) Make sure you’re not using any proxies.

2) Change your network’s DNS to: 4.2.2.8 & 4.2.2.2 or 4.2.2.5 & 8.8.8.8

3) Clear the cache and offline data.

I am satisfied with Bangla Lion’s customer care, at least they put some people who knows something. When GP started image optimization, it was a night mare. +1 to Bangla Lion for their informative customer care service.

Categories
Uncategorized

Quick JSON Parsing with C#

It’s quite sad that Microsoft doesn’t ship a decent JSON parser with .NET, not even the latest .NET 4. If we look at the web, everyone uses JSON today. Without no out of the box support for JSON, I was having much troubles consuming different APIs Services. But just a few moments ago, I found the JSON.NET project on CodePlex. The library has cool Linq integration that makes JSON parsing easier.

For test purposes, I am outputting this JSON string on http://localhost/json.php :

After downloading the JSON.NET package, I added a reference to “Newtonsoft.Json.dll”. Then used the following code snippet (C#) to parse the data and print the values from a console app:

Categories
PHP Python

A Python Script Every PHP Developer would love

PHP’s mail() function is one of the best things in the language. It is also the item most people suffer with while working locally. So whats the problem? The problem is we usually don’t have a SMTP server installed on our local machines (while we do in our production servers). PHP doesn’t do magic, it can’t send the emails without a SMTP server. Since you don’t have one, don’t go nuts seeing PHP can’t deliver your email 🙂

Remembering this problem, I spent 20 minutes hacking a Python script that does the magic for your PHP setup. The Python script creates a dummy SMTP server and listens to the port you select (defaults to 25). Keep the script running while using the mail() function in PHP. You shall get detailed yet readable mail data printed on your screen.

So isn’t there the nice smtp4dev tool and mail servers like postfix? Why re-invent the wheel? Ah, good question. Postfix is cool and it actually sends the email depending on your configuration. But it’s not probably a good option for debugging purposes. Do you want your mailbox filled up with test emails? 😉 Also AFAIK, it has no way to run on Windows. And I admit, sometimes emails are delivered quite late while using postfix. On the other hand, smtp4dev is a nice tool for similar purposes but it’s not cross OS either. It’s Windows only. Besides, it crashes if you try to send emails in French (probably an issue with Unicode). My python script solves this issue. It doesn’t fill up your mailbox, it handles French (and other languages with special chars) and most importantly runs on all the major OS.

Enough talks! So where’s the script? It’s right here:

How do I run it? First create a new file named: capture_email.py and copy-paste the codes into that file. If you’re on Linux or Mac, you already have Python 😀 Just type this command and hit enter:

If you’re on Windows, download a version of Python from http://python.org and install it. I recommend using Python version 2.5+ but less than 3. Python 3 is not supported. Double click on the file to run it.

Now that the script is running, try sending an email with mail() in PHP. Keep any eye on the Terminal/Command prompt for the output.

If something goes wrong, please let me know. Hope this script will be useful for the PHP devs out there. 🙂