Blog Navigation
Partners
Latest Activity
Phil gives the source code for implementing a MySQL singleton class in both PHP and Python.
Posted on: January 22nd, 2012 by Famous Phil
Its now time to become serious with my blog again after such a long lapse in real content.
When building new applications, it always seems like I start with the grand picture requiring no massive data storage and shortly after I begin, I find myself needing a database connection. I’ve made the mistake several times now of not starting with a dedicated database class that connects to MySQL, and I always find myself googling for pre-made classes that don’t do exactly what I need, so I’ve decided to post my own for future reference. As a result, I’m going to make sure that when I Google, I find my own reference before someone else’s
Hopefully this is useful to someone else.
PHP’s MySQL singleton class:
<?php
// Copyright (c) 2012 Philip Matuskiewicz www.famousphil.com
// To use:
// require_once("Mysql.php");
// $db = new Mysql();
class Mysql{
private $server = "localhost";
private $username = "";
private $password = "";
private $database_table = "";
private static $instance;
private function __construct(){
$this->connect();
}
public function connect(){
mysql_connect($this->server, $this->username, $this->password);
mysql_select_db($this->database_table);
$this->q("set names 'utf8'");
}
//query the database
public function q($query){
$r = mysql_query($query);
return $r;
}
//returns an array containing all the rows that were returned
public function qr($query){
$r = $this->q($query);
if (mysql_num_rows($r) > 0) {
$res = array();
while ($arr = mysql_fetch_array($r)) {
array_push($res, $arr);
}
return $res;
} else {
return null;
}
}
//number of rows returned
public function nr($query){
return mysql_num_rows($this->q($query));
}
//last inserted row id is returned
public function lid(){
return mysql_insert_id();
}
//close the database connection
public function c(){
mysql_close();
}
public static function singleton(){
if (!isset(self::$instance)) {
$c = __class__;
self::$instance = new $c;
}
return self::$instance;
}
public function __clone(){
trigger_error('no clone', E_USER_ERROR);
}
}
?>
The Python MySQL singleton implementation is similar, but includes an external file named config.py in this example
--> config.py (configuration information for the MySQL class)
dbhost = "localhost";
dblogin = "";
dbpassword = "";
dbname = "";
--> MySQL.py (The MySQL class)
#!/usr/bin/env python
# Copyright (c) 2012 Philip Matuskiewicz www.famousphil.com
#to include / use, insert the following lines in the code
#import imp;
#mysql = imp.load_source("MySQLConnector", "PATH_TO_PYTHON_FILE/mysql.py").MySQLConnector();
#result = mysql.tryquery("Mysql Query Here");
import sys;
import os;
import string;
import base64;
import MySQLdb;#mysql library (you will need to install this on the system)
#MySQL Singleton Class
class MySQLConnector(object):
_connection = None;
_instance = None;
def __init__(self):
try:
if MySQLConnector._instance == None:
MySQLConnector._instance = self;
MySQLConnector._instance.connect();
except Exception, e:
print "MySQL Error "+str(e);
def instance(self):
return MySQLConnector._instance;
def get_connection(self):
return MySQLConnector._connection;
def connect(self, debug=False):
try:
for line in open('includes/config.py'):
#this can be dangerous, but sources / executes lines in config.py, which contains the db info
#alternatively, you can just set the variables here manually
exec('%s = %s' % tuple(line.split('=', 1)));
MySQLConnector._connection = MySQLdb.connect(dbhost, dblogin, dbpassword, dbname);
if debug:
print "INFO: Database connection successfully established";
except Exception, e:
print "ERROR: MySQL Connection Couldn't be created... Fatal Error! "+str(e);
sys.exit();
def disconnect(self):
try:
MySQLConnector._connection.close();
except:
pass;#connection not open
#returns escaped data for insertion into mysql
def esc(self, esc):
return MySQLdb.escape_string(str(esc));
#query with no result returned
def query(self, sql):
cur = MySQLConnector._connection.cursor();
return cur.execute(sql);
def tryquery(self, sql):
try:
cur = MySQLConnector._connection.cursor();
return cur.execute(sql);
except:
return False;
#inserts and returns the inserted row id (last row id in PHP version)
def insert(self, sql):
cur = MySQLConnector._connection.cursor();
cur.execute(sql);
return self._connection.insert_id();
def tryinsert(self, sql):
try:
cur = MySQLConnector._connection.cursor();
cur.execute(sql);
return self._connection.insert_id();
except:
return -1;
#returns the first item of data
def queryrow(self, sql):
cur = MySQLConnector._connection.cursor();
cur.execute(sql);
return cur.fetchone();
#returns a list of data (array)
def queryrows(self, sql):
cur = MySQLConnector._connection.cursor();
cur.execute(sql);
return cur.fetchmany();
#end class MySQLConnector
Tags: mysql, php, Python, Singleton, Source Code
Posted in Programming, Technology
|| No Comments »
Posted on: January 21st, 2012 by Famous Phil
Phil’s Introduction to the post: This will be the last guest post that I accept indefinitely that doesn’t deal with a difficult problem that the poster hasn’t directly solved (basically, the same things I blog about). I feel that these posts are deteriorating the quality of my site, and guest posters are simply looking for high page rank back links to their sites, instead of writing unique, original content that creates better rankings. In a few days, I’ll be releasing some python source code for MySQL connectivity, Nginx for high traffic sites, and other tricky problems that I’m currently dealing with in attempt to re-rail my site back onto topic. Anyways, Rebecca Jones has written about Listening to Spotify on Linux (without WINE which is a Windows Execution Emulator for Linux), I hope that you enjoy her guest post.
Listen To Your Music In Spotify For Free Without Wine
Music aficionados who delight in listening to millions of tracks through Spotify’s free version but feel petered out of needing Wine at the same time have just got some good news to enjoy. The DRM-based music streaming service now announces a new free version specifically for Linux users. Spotify for free will now enable listeners to indulge in gripping tunes without calling out for Wine.
Integrated with a host of great user –friendly features, the music streaming application allows users to listen to millions of songs, any time they like. One can simply rifle through Spotify for a particular song and start playing in unprecedented clarity. For those unaware, Spotify is music based software which provides users with an intuitive medium to search download and play their favorite songs.
Almost like a new music collection, Spotify brings forth convenient access to unlimited tracks and features compatibility with home audio systems and smartphones. The app also lends support to users’ desktop and Mac for tunes that should follow everywhere. At the same time, the app allows users to discover and share music with their closed ones. In fact, users can even hear what their friends are listening to – just by hitting ‘play’ on any music post.
However, Spotify distinguishes from Last FM and Pandora in a couple of significant ways. To state, the app lets music buffs listen to entire albums on demand. But, be careful as there are certain obnoxiously genre-defying advertisements contained. Irrespective of the pros and cons that it comes with, the app still emerges to be an ideal pick. With this one around, people can seamlessly search up and down for songs and share them with amigos.
Although Spotify was extended to several platforms, the software did arch shoulders for those who would always need Wine just to listen to the music. Previously, the Linux version for Spotify used to function merely with paid accounts. Nevertheless, the free version of Spotify for Linux is now anticipated to make things simpler for enthusiasts by large.
The native Linux adaptation starts up pretty quickly and does not gulp down much of a listener’s time while delivering a better experience than Wine. As far as the enrollment is concerned, users will be required to register for an account at Spotify’s official website before kicking off their musical journey. But, a bit to dismay, registering feels a dearth of a Facebook account since the company has made it mandatory to have an account on the stated social networking site.
Besides Spotify for free without Wine, the music streaming service can be downloaded either in Premium which makes users shell our £9.99 per month or in Unlimited which costs just about £4.99 per month. Those who do not wish to fork their pennies out can simply download the free version. However, irrespective of which subscription has been settled upon, the software ensures a thorough, rich music experience. So, what are you waiting for? Just head towards Spotify and we believe the rest you know!
About the author: Rebecca is a blogger by profession. She loves writing on environment and technology. Beside this she is fond of books. She recently bought a AGP Graphics Card. These days she is busy in writing an article on Magnetic Earrings.
Tags: Linux, Spotify, Wine
Posted in Technology
|| No Comments »
Posted on: January 6th, 2012 by Famous Phil
Its amazing what a major boost in PR can do for a website in terms of guest posters. This will be the last guest post that I accept for a while so that I can post about more technical topics that I want my website to be focused around, and guest posters have a lot of difficulty providing the type of content that I strive to offer. Anyways, here is a guest post from Kristin Mullen that discusses credit cards for younger (college) students that kind of co-insides with the amount of college debt that I’m repaying.
There are hundreds of suggestions online telling students just how to manage their money. While most of these suggestions are valid, tips on how to handle your credit are potentially the most important. You may think that a credit card will help solve all of your problems, but the truth is that many young adults get into financial trouble fast when they don’t know how to manage their money productively.
Avoid Aggressive Credit Card Companies
Some colleges and universities allow credit card companies to set up booths and promote their low introductory interest rates to students on campus. They try to draw in these unsuspecting students with free gear like shirts and backpacks when they apply for a credit card. Many students fall into this trap and end up with a bunch of credit cards that they simply don’t need. Using all of these credit cards could result in the student drowning in debt that will take years to pay off.
Manage Your Credit Card Wisely
If you have thought through all of your options, and you decide you will need a credit card, make sure you manage it wisely. Get only one, and make sure you will be able to pay off the balance at the end of each month. Keeping a zero balance on your account from month to month will improve your credit rating, which could help you in the future with your financial aspirations.
Research different credit card companies and try to find a card with no annual fees, the lowest interest rate, and a grace period of 20 to 30 days before the company will charge you interest on your balance. Cards with one-time processing fees and low introductory interest rates that will rise after a few months are probably not the best for you. Also, look into credit cards that are secured by a bank deposit. With this type of card, you will use money from a savings account instead of using money you don’t have now, and the use of this card will still help you improve your credit score.
Once you have your credit card, don’t use it to buy anything you won’t be able to pay for right away. If you have an emergency, make sure you will still be able to make your monthly payments before using your credit card to solve the problem. Try to make payments larger than the minimum amount whenever possible so your interest rate will stay low. Finally, make your payments online or mail payments to the company several days before they are due to avoid late fees.
Build good credit
In order to build good credit, you will have to pay your bills on time and repay all of your debts as promised. As I have said, a good credit record will help you achieve your financial goals in the future, like buying a car or starting a business. Your future employer could also check your credit report before hiring you, so a bad credit score could keep you from getting a job.
To avoid financial trouble and improve your credit, you should follow these steps.
1) Pay all of your expenses on time.
2) Make all of your credit card payments on time.
3) Pay off your loans before you make other large purchases.
4) Only apply for the credit cards you need. Applying often could tip off lenders that you are in financial trouble, even if you are not.
5) Don’t let your checks bounce.
If You Get Into Financial Trouble, Seek Help
If you don’t know how much money you owe, use credit cards to pay other bills, or will have to miss payments or pay your bills late, then look for someone who can help. Dorm resident advisors, financial aid officers, or even a psychologist can help you figure out your financial dilemma. Your parents or guardians will most likely be your biggest supporters when trying to get out of debt, but you should also try to show them your determination to not make this mistake again.
Kristin Mullen is an author who writes guest posts on the topics of business, marketing, credit cards, and personal finance. Additionally, she works for a website that focuses on educating readers about online debt consolidation.
Posted in Student Life
|| No Comments »
Posted on: December 31st, 2011 by Famous Phil
It’s now time for the third(?) annual best/worst moments that I’ve made note of over the past year of my life. Unlike previous years where I threw things together at the last minute, this year, some (limited) advanced planning was made for this blog. Hopefully in future years, additional planning will make this traditional post actually worth reading. For this year, nonetheless, you’re going to have to suffer with the traditional thrown together at the last minute effect…
This year started like many others that I’ve had, a new season of learning (at college) and a bunch of side projects that never seemed to take off the ground where they were conceived. As the year progressed, I started looking into my future and applied to several top technology companies, got several callbacks, and turned down several offers. I finally found an offer that I could live with in New York City in July and I quickly relocated, but not before I got my two college degrees in Computer Science (both an MS, and a BS). If there is one major thing I learned about the job market, Computer Science is a very valuable degree to have, but you still have to be persistent to land the job that you want!
Over the past year in my current job, I’ve been working on two major projects, one which is a social clothing site, www.wearingsocial.com which was finished back in August with about 2 weeks of effort. The other more potent project is www.unroll.me, which is currently in a limited beta testing stage, it has gotten press on life hacker among other sites. Unroll.me is an email scanning engine that finds subscriptions in your email inbox and automatically clicks the unsubscribe link (or numerous other methods that can be used to unsubscribe). At this point in time, as its primary algorithm developer, I’d say that it is very accurate(90%+) in detecting unsubscribe emails and links, and it is fairly good (70%+) at actually unsubscribing from those emails. For the abilities of computers, and how many exceptions that I’ve written into the application, I’m personally very impressed at its abilities to find and unsubscribe from those nasty subscription emails! Of course, this application is constantly being improved by myself and others to ensure that it becomes much better than it currently is!
Now for something that I’ve been very quiet about over the past 6 months: On my own, I’ve been working on a new application that basically wakes me up in the morning. I find that my view of the outside world isn’t very good in the morning, and I always end up forgetting my umbrella, etc when leaving for work. So I’ve been developing an application in my spare time that can call my phone (landline, cellphone, etc) and tell me what time it is and give me a quick overview of today’s weather so that I can realize I need to bring an umbrella, dress up, etc. Once the initial version is released, I will consider adding abilities to connect to an email todo list, calendar, etc and read appointments off, similar to Apple’s Siri for iPhone. Of course, other ideas will also be welcome to those who want to use this application. The application is complete functionally, but is still waiting on its design which should be done within the next month, once it’s done; I will be releasing it here on FamousPhil.com and Matthouse.us. Of course, you can always check the project’s website to see if it is released: http://www.personalwakeup.com.
Finally, unless it is raining after 8pm EST, I will be attending the NYC Times Square New Years celebration with friends.
So with not much more to say, now for my traditional videos highlighting the best/worst YouTube videos of the year 2011! As always, thanks for reading, and here is to a very good new year! Welcome to 2012!
Here is a list of memorable videos (unfortunately, embedding is disabled on most videos now so I’ve provided links):
Oh the places you’ll (Actually) go: http://www.youtube.com/watch?v=wIP8lFWa_mg
Rescue Japan: http://www.youtube.com/watch?v=pk7fBLuLj5I&NR=1&feature=fvwp
High School Sucks – The Musical: http://www.youtube.com/watch?v=GWy_uauR-6k&hd=1
Homecoming Rally: http://www.youtube.com/watch?v=_GiaEs8Myfc&hd=1
The Stereotypes Song: http://www.youtube.com/watch?v=wCgx8zM3woQ&feature=relmfu
Gabriel Iglaeseas- Krispy Kreme Doughnuts: http://www.youtube.com/watch?v=a77Dw3tNv8o
Adele – Someone Like You – Piano By Ear: http://www.youtube.com/watch?v=y8b4_kGuj7k&feature=related
I can’t remember if I posted this last year, but I really like it: Stand by Me | Playing for Change – Song around the world: http://www.youtube.com/watch?v=Us-TVg40ExM&feature=relmfu
And who can forget the worst video of the year, it originally had millions of dislikes until it was taken down and moved to another account to soften the dislikes:
Rebecca Black – Friday: http://www.youtube.com/watch?v=kfVsfOSbJY0
Jibjab’s video this year was mediocre, but I’ll post the link anyways: http://www.youtube.com/watch?v=2zls4Ao3GyM
Posted in My Site, Personal
|| No Comments »
Posted on: December 28th, 2011 by Famous Phil
Sarah James was kind enough to provide a second guest post! I’d like to remind my readers that none of the content below has been thoroughly reviewed by myself and may contain inaccuracies. As an overall comment, although you can torrent over mobile broadband, be very careful about how much bandwidth (traffic / transfer usage) you use, most mobile carriers limit you to 5GB of data/month, and the ones that claim that it is unlimited data, they typically will kick you off their network if you consistently go above 5GB of usage per month (read the fine print of your contract if you don’t believe me). Torrents are like leaches on networks and they will use all the available transfer capabilities of your connection, so on the typical 3G/EVDO connection at a typical 60KB/s (512kbps), you can easily eat through your entire monthly allotment (5GB) in approximately 24 hours (or much less if your connection is better than the average) if you forget to turn your download off at night. Anyways, here is Sarah’s post.
Mobile broadband is a technical freedom that is right there at your fingertips. When you are using bit torrent with mobile broadband card, the download speed not only depends on your bandwidth but also on the number of seeders you are getting. You need to make sure that you very well know your broadband card and its bandwidth status in detail. Running below 54Mbps will not to be able to help you download with the speed you always wanted. One benefit with them is that it works very much like a DSL connection for around $60 a month. Cheaper plans are available with carriers.
What is Bit torrent?
Bit Torrent is a popular and useful way of downloading large files on the internet. In case you are planning to use Bit torrent on a regular basis, you must have a reliable broadband plan. This will encourage you to get the best from the file sharing platform. After downloading software, users are allowed to directly send and receive files. It’s the resource that shows the route to the file being searched.
Bit Torrent is an extensive peer to peer (P2P) file sharing communications protocol that distributes large amount of data to several users who are targeting to download same file at one point of time. Pieces of data are supplied to the new recipients by the original user that supplies downloading the file. This further reduces the cost as well as the burden on the uploader who uploads the original file and encourages the reduction of dependence on the original user who first uploaded the file. It is important to carefully select the broadband card plans so that you can use bit torrent with mobile broadband flawlessly.
Know the Risks – Minimize the Risks
There are several risks involved with the access of this technology. Here are some of the possible risks that you should be aware of –
Mobile Broadband Cards for Bit Torrent: Why?
Here are the reasons -
With the help of EV-DO and HSPA you can get on the net at 3G speed. You will get 50MB (basic plans) or 5GB (Average plans) or unlimited mobile broadband plans. If you are a typical user you will download over 20MB of data for web surfing. BT usually works fine on 3s 3G for users! Clients like Torrent have an inbuilt anti-leech feature which will easily cap your download speed in case you have a slow upload speed.
For using Bit torrent, a 5GB plan would suffice most of your needs. For power users that go through and through, nothing less than an unlimited plan should work conveniently. Even if the plan is unlimited, ‘prohibited’ uses can easily get you banned by providers like Bit torrent. This is done so that you don’t eat up the entire internet for yourself!
Tags: bit torrent, mobile broadband, torrent
Posted in Mobile Technology
|| No Comments »
Posted on: December 22nd, 2011 by Famous Phil
I bring you a guest post from Melanie Slaugh. She does get a majority of this topic right, except for this is also an excellent way to get humans to click blindly too. I set up a twitter bot at one point that posted a shortened URL to a website that I worked on to artificially boost its traffic and market it. Surprisingly, posting to the trending topics on twitter with a related link and text generates a lot of traffic since a lot of people click links blindly. Anyways, here is Melanie’s post.
URL shortening sites like Tinyurl.com and Bitly.com are the new haunts for Tweeters who do not want long URLs to consume their restricted typing space. However, shortened URLs have another, more insidious use. They allow spammers and hackers to evade the timeworn email filters and gain entry to your inbox.
Most email anti-spam counteragents were generated even before the usage of embedded URLs in emails, not to mention abridged ones. Most contemporary anti-spam programs track back the URL to see if the site it originates from is hazardous. However, a shortened URL can be utilized by hackers in two distinctive ways.
The first way is simple. They tie the site they want you to get directed to into one of the identified and reliable URL shortening sites available for free to the community. Because the URL shortening site itself is reliable, the link is trusted. However, the link does not connect you to the URL shortening site; it connects you where it was originally fixated.
Secondly, hackers can get especially resourceful. Once the email program’s anti-spam filters determine the misapplication of the URL shortening sites, as some have already done, hackers produce their own URL shortening sites. Basically, they shorten a site that’s previously shortened. So, when you click on the link, you get forwarded not once, but twice. The first transferal is safe, the next is a hackers.
This is “yet another example of cyber-criminals adopting new technology to bypass traditional security measures,” said Bradley Anstis, vice-president of technical strategy at M86.
“A lot of the traditional anti-spam engines were developed before Twitter, so they are not geared up to recognize embedded URLs as seen in blended email threats in spam, let alone shortened URLs that link to malicious, or compromised Web pages,” Anstis said.
Some frightening statistics:
In May 2011, the global ratio of spam in email traffic from new and previously unknown bad sources increased by 2.9 percentage points since April 2011 to 75.8% (1 in 1.32 emails).
The global ratio of email-borne viruses in email traffic from new and previously unknown bad sources was one in 222.3 emails (0.450 percent) in May, a decrease of 0.143 percentage points since April. (From Net-security.org)
So, what can you do to guard yourself from hackers? For one, never click on an email link if you do not have confidence in the sender. Two, even if you do have faith in the sender, do your best to get to the link organically, meaning follow the regular method. If you are tracking a delivery, go through the main website in the place of clicking on the link. These modestactivities will help to keep your computer, and the data it holds, safe from hackers.
Author Bio
Melanie Slaugh is enthusiastic about the growing prospects and opportunities of various industries and writing articles on various consumer goods and services as a freelance writer. She writes extensively for internet service providers and also topics related to internet providers in my area for presenting the consumers, the information they need to choose the right Internet package for them. She can be reached at slaugh.slaugh907 @ gmail.com.
Posted in Technology
|| No Comments »
Posted on: November 21st, 2011 by Famous Phil
Most of the Matthouse infrastructure is running on old Celeron processors and limited RAM, you may laugh at me, but that hardware has been very reliable and has lasted Matthouse for the better part of 3 years, and some of it may continue to power Matthouse well into the future! But there are some applications out there that require a little more juice to run well, and (unfortunately) Exchange falls into this category. I say it is unfortunate since the Exchange server hosts a handful (< 10) mailboxes, yet it costs quite a bit to maintain compared to other Mail Transfer Agents (MTA). So anyways, this blog is dedicated to the procedure that I took to migrate Exchange over to brand new, shiny, fast hardware.
First, I had Server 2008 R2 Datacenter as my operating system on both the existing server (denoted double) and the new server (denoted ruby). The servers could clearly communicate with each other within the same datacenter as well so that file / data transfers could be effective. The first thing to adding any server is to give the new server a name and know its network configuration details ahead of time. I’m not going to go into details about how to install Windows, since it’s pretty simple. Just make sure that you have the correct drivers installed for your server after the installation completes.
Note about installing Windows: just so that you don’t run into any issues with your system, make sure that your primary hard drive is attached to the first port for your motherboard’s interface, in my case, the first hard drive was connected to SATA 0. If you don’t do this, you’ll run into a lot of problems and waste a lot of time (like I did!). In addition, make sure that your BIOS has AHCI enabled prior to installing Windows, this also caused problems in my scenario. Once Windows is installed, make sure that you can disable write caching on your hard disk without the operating system freezing (in computer management, under storage, right click the disk and optimize for quick removal). If you followed the above, this shouldn’t cause Windows to hang, and will prevent Active Directory from incapacitating your system during the restart phase of the installation. In addition, this is a good time to name your computer, join it to some default workgroup, add remote administration features, and change the time zone / clock settings.
Before continuing, I’d also recommend disabling Internet Explorer’s advanced security features; this is done by going to the computer management main screen and scrolling down, finding IE ESC and turning it off (acknowledging all of the warnings). If you keep them on, you’ll find yourself doing way too much work to download necessary applications, etc. These features are only useful if you plan on doing general web surfing on the server (which I would not recommend for security reasons). I also activated windows, ran all the necessary windows updates (several reboots and optional updates as well). After this all has been done, I ended up rebooting the machine a final time.
At this point, I installed several applications (using IE to get Google Chrome initially).
Tags: active directory, exchange, exchange 2010, migration, owa, Transfer, upgrade, windows
Posted in Hosting / Server Administration, Technology
|| No Comments »
Posted on: November 17th, 2011 by Famous Phil
I bring you a guest post from Sarah James ( contactsarahjames [at] gmail [dot] com), this post is more or less Sarah’s view of Charter Communications which is a Cable ISP.
The Charter internet service is great when it works – not so much when it doesn’t. That’s not fully Charter’s fault of course, or at least it wasn’t in my case – the root of my problem was the fact that my new office existed on a street that has only just been built, and which had yet to be registered with any database up to and including the ne held by the Post Office.
Not ideal, especially when the Charter internet guys were due to show up on day one and install the system for me. Here’s how my tale of woes began:
The Post Office eventually updated my street address. But that updated didn’t appear anywhere outside of the Post Office’s own database for three weeks. I’m assuming that delivering fast internet updates isn’t a priority for an organisation that sometimes has problems delivering letters on time, if at all.
The Post Office was only the start of my problems. I had to order my Charter internet connection based on the address of a nearby building, which meant, when Charter came out to install it, that they wouldn’t fit it in the building I actually own. Fair enough. But it took ages to sort the whole thing out, going backwards and forwards between the Poster Office and Charter until I was blue in the face and a cast of thousands had turned up at both my actual address, and the address down the street I’d been using to get my stuff delivered in the first place.
I tried talking to Charter directly but of course you either end up in a queue a mile long or you have to use the online web chat assistant – who, given the speed and clarity of the Charter internet connection (once you’ve finally had it installed0, went unbelievably slowly. It was kind of like talking to a backwards six year old.
Question: with all this internet power at their fingertips, why are the web companies so bad at direct communication with their customers? On the one hand they sell these amazing services, which allow you to segue all sorts of communications requirements into a single connection (the payment plan is good too) – and on the other, they make communicating with them next to impossible (unless you’ve got all day to sit around doing nothing else except trying to get through to them).
Fortunately my Charter internet service has now been sorted – and I am enjoying the rapid broadband connection that I was promised in the first place. I have no beef with the quality of the service and the capabilities of the connection. I would just like to know why it takes around 12 different engineers to install a simple web connection. Though as I say the business with the Post Office can’t have helped much.
So come on, Charter, get it together in the back operations department. Use your own technology to power your online web assistant and maybe we’ll be able to get something done!
About the author:
Sarah James is associated with various internet security related companies including broadband expert as their freelance and staff writer. She has been linked with some of the best web media companies and offers various ways for internet solutions. She excels in writing articles related to internet security, charter internet plans, comcast deals etc.
Tags: Cable, Charter, ISP, problems
Posted in Technology
|| No Comments »
Posted on: November 13th, 2011 by Famous Phil
It has been some time since my last post, and I think this is going to be the norm for at least the next year, sadly. Today’s topic is based on information that I needed about IMAP (Internet Message Access Protocol) last week. Basically, I’m developing an application for conceptual.ly that allows for normal users to enter their login information for their email and then the application will unsubscribe them from internet mailing lists that people often dislike, yet get plentiful email from. Since the solution is completely artificial (and requires no human intervention), it exceeds what others have done in the past.
Unfortunately, computers are not able to think and identify patterns without a lot of help and special cases already entered into databases for them to compare against. Thankfully, emailing lists have certain unique identifiers that allow this application to effectively identify and remove users from mailing lists, although I will not disclose exactly how it is done since that research was done on company time and therefore remains property of Conceptual.ly. But I did want to take the time to publish a cheat sheet for those of you who need to communicate with IMAP servers via telnet.
CONNECTING: The general command to telnet to an insecure IMAP server is “telnet imap.server.com 143”, remembering that IMAP runs on port 143. If you’d like to connect through IMAPS over port 993, your computer will need OpenSSL and the command to do so is “openssl s_client -connect imap.server.com:993”. OpenSSL will take care of all the connection securing / establishing for you, the commands following the initial connection are exactly the same.
IDENTIFIERS: IMAP commands start with an identifier, I’ve seen “. “ as the identifier (a dot followed by a space) and I’ve also seen “a1 “ (a1 followed by a space) as the identifier. I’ve also seen incrementing the 1 to 2, 3, etc work, and reading the RFC was not specific to what had to be used. I typically use “. “ as my identifier and fall back to using a1 for all of the commands I enter, it has worked for every IMAP implementation I’ve dealt with thus far (including Gmail, Dovecot, AOL, and Exchange).
LOGIN: To login to the IMAP server, you need to enter the identifier followed by “login username password” replacing username and password with the appropriate login information. Note that your username may be your email address.
LIST: This command is typically followed by a login and lists all of the available mailboxes in the IMAP account. The syntax for this command is list “” “*” which simply gets all of the mailboxes and subfolders. The usual response is * LIST (\HasNoChildren) “.” “INBOX” which can easily be parsed, the \HasNoChildren can change if there are children. Usually with children, the output will make the actual folder (the last segment of the output) contain the parent and a . so that you can simply use this to formulate a connection to a specific folder to retrieve messages, etc. This isn’t always the case, so it is helpful to use IMAP over telnet to verify the response of the command for the specific IMAP server that you are connecting to.
STATUS: This command will return information about the folder you inquire about, I’ve only seen it return the total messages and unread messages in a folder in my experiences. The syntax of this command is “STATUS FOLDER (flags which are optional)”.
SELECT: In order to search or retrieve items from a folder, you must first select that folder. The syntax of this command is “SELECT FOLDER”.
SEARCH: This command has some ambiguity that caused me some difficulty that I will get to shortly. The syntax for search is “SEARCH (PARAMS)”. The parameters are identified in the RFC3501, but there are some specifics I’d like to talk about. First, I’ve found that SENTSINCE does not need to be in (), instead you would do “SEARCH SENTSINCE 01-01-11 (PARAMS)”. Next, if you want to search for more than 2 items using the OR syntax, you would need to use nested ORs, this might look like the following: “(OR (OR HEADER From yahoo.com BODY hello) BODY phil)” to search for a message that might be from yahoo.com (partial match) with the body containing hello, or just having “phil” in the body. This works similarly for the AND parameter. When search returns, it returns a space separated array of numbers which are identifiers for the FETCH command. Remember that to search, you have to SELECT the folder to search first.
FETCH: This command will retrieve messages from a folder, you must have selected that folder first before you can retrieve a message. Typically, messages are identified by a number which the FETCH command uses, so a SEARCH is generally executed before fetching messages. The syntax is “IDENTIFIER FETCH (PARAMS)”. IDENTIFIER is the number that search returned, and there are numerous PARAMS that you can do. I’ve seen (RFC822) work at grabbing the entire raw message source (both headers and body), but in AOL’s implementation it does not, so I’ve reverted back to getting the header and body of each message through 2 fetches, the first parameter is (RFC822.HEADER) and the second is (RFC822.TEXT). I do not believe that IMAP servers return a decoded version of the message in all cases, so I also used an email parsing engine in Python to decode the message source that these commands returned.
LOGOUT: The syntax for this command is “LOGOUT”. It simply disconnects you properly from the IMAP server.
For the needs of my program, these were all the commands I needed, so I’d strongly suggest that you look at RFC 3501 at http://tools.ietf.org/html/rfc3501 for more information about the IMAP protocol and its usage.
I would also like to note that GMail has added commands to their implementation that better follow the speed and reliability of their web interface, those commands can be found at http://code.google.com/apis/gmail/imap/ (this was kind of hidden from my initial searches for information about GMail’s IMAP implementation, so I wanted to make this more visible). If you use standard IMAP commands on Gmail, you can expect it to be much slower than other IMAP servers and much slower than their web interface.
Finally, AOL’s IMAP implementation doesn’t allow searching certain header fields and the body of the message, so I’d recommend testing your commands ahead of time to ensure you are getting responses that you expect. As a tradeoff, AOL’s IMAP implementation is very fast at returning messages via the FETCH command, so where the SEARCH lacks ability on AOL’s IMAP server, the speed in downloading messages far makes up for this lack of functionality. It is also possible that AOL’s IMAP implementation has certain extensions that I didn’t notice, so you may want to look into that possibility also if you’re dealing with their IMAP servers.
Hopefully this blog post can help someone save time so that they don’t have to do as much searching as I had to for connecting to IMAP servers.
Tags: email, IMAP, IMAPS, OpenSSL, Protocol, telnet
Posted in Programming, Technology
|| No Comments »
Posted on: October 27th, 2011 by Famous Phil
I bring you a guest post from Nadia Jones this week! I will return next week with a simplified IMAP reference guide.
Over the past few months, a large subset of the Linux community has been all ablaze in disagreement and controversy. The disagreement has been over a dramatic change in interface to a popular operating system (referred to in the Linux world as a “distro”) called Ubuntu.
Some Linux and Ubuntu Basics
Before we get into the details, I think it is important to understand the basics of Linux and Ubuntu. Linux refers to the kernel of the operating system, the core under-the-hood process that handles things like hardware management, etc. The Linux kernel is completely open source, so there are many distros wrapped around it, each with their own combination of software, graphical front-ends, and what have you. Ubuntu, maintained by a company called Canonical, is believed to be the most popular free Linux distro.
Ubuntu’s New Release: Unity
Up until version 11.04, which released April 2011, Ubuntu has used a graphical front-end called Gnome. It is considered stable by many users and has had a long period of usage in Ubuntu. With the release of 11.04, Canonical experimented with a new front-end called Unity. So far, users have complained Unity being very buggy, counter-intuitive, and oversimplified.
For example, Unity has a new docking bar locked on the right side of the screen that is very similar to Apple’s docking bar at the bottom of Mac OS X. The problem with this dock is that it looks exactly the same regardless of which programs you have open on your system. So if you are juggling four separate windows of Google Chrome, and all of them are minimized, there is no taskbar-like setup to easily pick and chose which one Window you want. You can only see the one Google Chrome logo on the dock. Click it, and all your Chrome windows appear on the screen at once. There are many examples like this, in which everything seems to take one or two clicks too many. Essentially, they tried taking a page from Apple and achieved very little.
Perhaps the bigger upset is the buggy elements of Unity. Linux distros (including Ubuntu) are known and developed for their high efficiency and reliability. Very modest computer systems can run on Linux distros with no problem for hundreds of days, with no problems and requiring no restart. With Unity, many users are reporting that they have to force restart their systems every work or so because the unity dock locks up, windows will freeze, or any number of glitch, buggy reasons.
Beyond User Experience, Where’s the Controversy
Bugs are a part of any operating system, and in due time, they will likely be fixed. And the flaws of the user interface can be tweaked and customized with enough frustration and elbow-grease, so this shouldn’t be a permanent source of contention either. With two of the biggest complaints of Unity being fixable, this begs the question: Why is there all this controversy?
The most sensible explanation lies in the normative ethics of open source software development. There have been countless cases of developers making mistakes and bad decisions in creating and updating software. Typically, however, the developers listen to the feedback of their users and fix their mistakes.
Yet, when Mark Shuttleworth of Canonical got overwhelming feedback from Gnome developers that they didn’t like Unity and didn’t think it was a good fit for their system, Shuttleworth shifts Ubuntu to use Unity as the default front-end anyway. This effectively forced a split in the Ubuntu community. Many intermediate to advanced users will either revert back to using Gnome or find a different distro altogether. Yet Canonical is pushing forward as if there is no disagreement or problem whatsoever.
Bottom Line
While I do feel like this whole situation is a complete blunder on Canonical’s part, I do not think it will lead to any type of dramatic end to the company. Sure, some great developers and innovative users in the community may leave, but Ubuntu’s grasp over the Linux community is too big to lose hold.
I do think that Unity is fundamentally more cumbersome than Gnome. For a interface that is spreading to more and more school districts, public libraries, and government buildings due to its free pricing and ease of use, I worry that Unity is a step in the wrong direction. Still, I’m sure that the fact it is free will prevail over whatever ease of use obstacles Unity has.
Author Bio:
This is a guest post by Nadia Jones who blogs at online college about education, college, student, teacher, money saving, movie related topics. You can reach her at nadia.jones5 @ gmail.com.
Tags: ubuntu, Unity
Posted in Technology
|| No Comments »