Today at 12PM EST, our new president Barack Obama was sworn into office. Truly an amazing day.
President Obama has long been a champion of social media and internet technology (or just technology in general) and now the WhiteHouse website has a new feature... A blog!
There are already 5 entries in the blog (obviously prepared in advance) but that is a good start!
Be interesting to see how often this is updated and how transparent this administration will be. The promise of real transparency has been made along the campaign and so far it sure seems like that will be the case. I hope so.
Add the blog's RSS feed to your reader and stay up to date.
I've been wondering lately if I am alienating myself from my readers by covering many different topics on this blog. My posts range from software development to money management to internet marketing. It's hard to build up a dedicated readership when my topics don't seem to stay on any certain topic ;)
So should I stick to a single topic? I don't think so. This is a personal blog and it should reflect the things that interest me or the events going on in my life right now. That is why I will write an article on how I created the software that runs this blog to an article on how to increase your website conversions.
To me, being able to use many different skills to earn a living online is very useful information. In the end, this blog is not designed or intended for me to make money off of. Just an outlet for me and a way to get my ideas out there.
Love it or hate it...
Technorati Tags: blog, development, internet marketing, marketing, software
I am so tired of dealing with comment spammers. Even though I use custom software that I wrote to run this blog, I still use the Akismet comment spam detector run by the boys & girls at Wordpress. The Akismet system is an awesome tool and catches a ton of spam for me but a good amount still gets through.
I began logging every time my software found a spam message around 6 months ago. After 2 weeks I had caught nearly 12,000 spam messages. I would sit and watch my logs just fly with spammers using custom software to bang away at my server trying to litter my blog with comment spam.
I finally wrote a script to block IP addresses that had posted more than 15 spam messages over the last 7 days. It would use the pf firewall that I use on all my FreeBSD servers.
Since then I have blocked over 1,000 hosts (IP addresses) from even connecting to my server. That is totally amazing how fast spammers move and how many servers they have in play to hammer even a tiny blog like my own. Obviously spam is a big problem and it is no longer limited to just email.
I eventually had to turn off Trackback support because the spammers were hitting that as well. The Akismet filter isn't designed to work with trackback requests but I was still able to block quite a number of those requests. I eventually disabled it because it appeared to be under some sort of bot attack because it got to be so bad that it effected the performance of my server.
When deciding to blog for fun, or profit, there are other things you have to consider other than just what you will write about. Get in touch with that inner geek and it will help you down the line.
Technorati Tags: blog, comment spam, firewall, freebsd, geek, spam
Ever wanted to be a rock star? I think we all have at one point. I mean, what's not to love about it. They rock on stage, party all night and have their pick of the hottest ladies at the show. Sure that all seemed great when we were younger but what about becoming a modern day rock star?
What is a modern day rock star?
Good question. That could probably be defined as any one who truly stands out in their industry. For instance, Michael Arrington could be considered a rock star in the blogging world for the huge success he has seen from TechCrunch, the blog he started in 2005 that covers internet startups and has achieved behemoth status in the blogosphere.
Examples from the affiliate marketing world would include John Chow, Zac Johnson and Neil Patel. These 3 guys are recognized as experts in their industry and have been able to build up a solid reputation and a large following. Whether or not these guys are actual experts I have no idea and I don't know any of them personally. What I do know is that I read their blogs every day and find a great value in their writings a lot of the time.
Point is that they have been able to build a (cult like) following and are able to leverage that into large profits while attempting to help people in the process.
How do you become a rock star?
What the hell are you asking me for? Seriously though I don't have an answer to that question. I don't know that there is a specific formula but I am sure it is a mixture of charisma, experience, hard work, education and a degree of transparency.
If you can figure out a way to give away value — actual or perceived — for free and do it in a way that is magnetic, chances are you will slowly build a large following. As your following grows, so can your profits.
There are many ways to pass value to your following. Obviously blogging is a slam dunk but there are many other methods. Before blogging was so popular there were forums, which provided an excellent vehicle for users to interact with each other as well as the "rock stars" of the community. Look at the success of Fark — it all started with a niche and a forum.
Are you a rock star?
Everyone has some rock star qualities about them. Well, nearly everyone. Not everyone has the over all mixture that is required to really stand out. That's OK because you don't need to be a rock star to be hugely successful. If you want to be a rock star then I suggest you get started right away. Throw yourself out there and see how it goes. Don't let self doubt or other hang ups stop you.
Bottom line: you never know until you try.
P.S. Yes, I realize how corny the "rock star" thing is...
I stumbled across an article today titled How To Make $1,000,000 By Blogging. It's an awesome read and pretty funny through out the entire piece. It's basic outline is that you use the money you make from your blogging to buy lottery tickets to win $1,000,000+.
The moral of the story is that blogging is not a get rich quick scheme. I've written before about how I plan to make a million bucks this year and in the post I give an outline of my overall plans to achieve this goal. A lot of people feel that they can throw together a blog, mix in a few ads and post a few times a week and they are good as gold. Unfortunately, it's never that easy!
When you look at the TechCrunch's and the John Chow's of the blogosphere, there is an underlying theme to be found — hard work. There isn't much in life, that's worth anything, that comes to you easily. Building a million dollar blog, or website in general, is no exception.
If you are willing to put in the blood, sweat & tears you will be successful. Stay motivated and never give up, even when you fail (and continue to fail). Get up, try again, repeat. Throw enough sh*t on the wall and eventually some will stick (probably have that saying incorrect but I'm a city boy, what do you want from me)
In my opinion there is no better opportunity for an entrepreneur than the internet. Instant access to a global marketplace and relatively inexpensive methods to setup shop. It's never been easier for us dreamers to "make it happen" than right now. My question to you is... what are you waiting for?
Technorati Tags: blog, make money online, marketing, millions
I woke up this morning at about 3:15 AM when my oldest daughter came into my room complaining about her cough. She hasn't been feeling good so I had her come to sleep with my wife and I. I couldn't fall back asleep.
I laid there thinking about everything going on in my life right now. It's a very busy and exciting time for me. I lay awake for nearly 2 hours, just me and my thoughts. I've had a lot on my mind lately and I didn't realize that I had won a very prestigious award yesterday.
Chris Bloczynski had bestowed upon me the coveted "Fan of the Week" award!
I really was shocked to see my mug being shown in my Google Reader as I made my way through my daily RSS feeds this morning.
The picture that I use of me across the web is a funny one to me. I'm laid out on my buddies beat up couch at his bachelor pad. Stained carpets, mini fridge full of beer (in the living room) and 2 day old pizza in the oven. A real bachelor pad.
Anyways, thanks to Chris for the post about me. I'll have to see what else I can do to win more cool stuff!
Technorati Tags: award, blog, chris bloczynski
OK, the title is a little misleading. I love the flatpages. I recently deployed them on this blog for the about and contact pages and they were working fine. This morning I noticed that they were raising a 404 (Page Not Found) error. That's where my "WTF" in the title comes in. Here is a check list to solve this flatpage issue.
- Add the middleware and app as directed on the flatpages documentation page.
- Make sure you have the correct SITE_ID in settings.py and make sure the flatpage is assigned to that site.
- Check that you have flatpages/default.html in one of your template paths.
- Verify that your default.html template is extending the correct base template
Number 4 was my problem. I have been working on the code to allow multiple template sets to be selected in the admin interface. In doing that, I re-factored the base layout to be in template/base/base.html but the default.html was still extending base_blog.html. Doh!
I wish there was something logged somewhere though that would let me know there was an error rendering the flatpage. The 404 was pretty cryptic.
Technorati Tags: django, blog, python, 404, development
There are other articles written about this, but I felt the need to write a better one. Ahem.
Meat and potatoes time.
In your settings.py file, set 2 new variables:
# 'PING' blog indexing sites.
PING_BLOG_INDEX = True# List of blog index ping URL's
BLOG_INDEX = ['http://rpc.technorati.com/rpc/ping',
'http://blogsearch.google.com/ping/RPC2',
'http://rpc.weblogs.com/RPC2']
PING_BLOG_INDEX is self explanatory. BLOG_INDEX is a list of blog XMLRPC url's that this application is going to use to notify the remote website (blog indexer) that your blog has been updated.
Let's create a new file in your blog application directory and name it ping.py. This file will hold the code that actually pings the blog indexers. Here it is:
from django.conf import settingsdef pingSites(entry, blog_name):
for site in settings.BLOG_INDEX:
try:
rpc = xmlrpclib.Server(site)
try:
p = rpc.weblogUpdates.extendedPing(blog_name,
settings.SITE_URL,
entry.get_absolute_url(),
settings.SITE_URL + '/feeds/rss2'
)
except:
# May not support extendedPing()
# Try normal ping
p = rpc.weblogUpdates.ping(blog_name,
settings.SITE_URL)if p.has_key('flerror') and p['flerror'] == True:
errlog(p['message'])
except:
errlog('pingSites: %s, exception!' % (site))
A few notes on the above code:
- errlog() is a function I have that just logs errors via syslog for my review. If you don't want to track the errors then a simple "pass" will do. I am just anal about errors and like to follow them. Heh, I said anal.
- This code assumes 2 things. One is that you have a "SITE_URL" option in your settings.py file. It should just be something like "SITE_URL = 'http://www.petersanchez.com'". And two is that your "Entry" model (the model that stores your blog posts) has a "get_absolute_url()" method. If it currently doesn't, I have to ask: What's wrong with you? Add one!
- You probably need to change the '/feeds/rss2' line to match the URL for your own RSS feed. Don't have an RSS feed on your blog yet? Write one, its super simple. Doc's are here.
Now lets edit your blogs models.py file be sure to import the pingSites() function that we just created in ping.py.
from your_project.blog.ping import pingSites
In your "Entry" model (mine is named "Entry", your mileage may vary) create a custom save() function.
def save(self):
# Save first, ping second (if configured)
super(Entry, self).save()
if settings.PING_BLOG_INDEX:
blog = Blog.objects.all()[0]
pingSites(self, blog.name)
Notes on above code:
- The 'blog' variable used in my example is because the software I wrote supports multiple blogs from a single installation. If you don't have a similar setup, just remove the "blog = Blog...." line and replace "blog.name" with the name of your blog. For example: pingSites(self, 'Joe Blow Blog')
That's it. You should be good to go. Next time you update your blog the blogosphere will immediately know about it via the blog indexers.
Technorati Tags: blog, development, django, geek, python
This is a quick write up about adding support for Amazon S3 to your Django weblog. I added support for metaWeblog API by using the this write up from All Your Pixel. Most, if not all, blogging clients support the metaWeblog API so I think it was a good choice.
Why use Amazon S3?
- It's super cheap (probably cost you less than $1/mo)
- Performance is improved by moving static media away from your Django/Apache instance.
- Amazon worries about managing and scaling the storage back end.
First off, let's edit the settings.py that is in your Django project's directory. We will want to add your Amazon access information. Note: You can get your access information by signing up for S3 at the Amazon site. Add the following to your settings.py file:
AWS_ACCESS_KEY = 'Your Key'
AWS_SECRET_ACCESS_KEY = 'Your Secret Key'
BUCKET_NAME = 'Your Bucket Name'
AWS_S3_URL = 'http://s3.amazonaws.com'
So, I am going to assume you are using the xmlrpc.py and metaweblog.py that was provided in the All Your Pixel posting (linked above). Be sure you are importing the Django project settings file by using:
from django.conf import settings
This will also require the Python S3 module that is provided by Amazon. Get this file and add it to your project, or your Python path. Import that module, and the mimetypes module which is used to guess the type of the file being uploaded.
from yourproject import S3
import mimetypes
Now we will create, or edit, the metaWeblog_newMediaObject method. This is what is called when your blogging client attaches, or uploads, a media file to your blog post.
def metaWeblog_newMediaObject(user, blogid, struct):
ret = {}
fext = os.path.splitext(struct['name'])[1].lower()
fname = generate_fname() + fext
try:
conn = S3.AWSAuthConnection(settings.AWS_ACCESS_KEY,
settings.AWS_SECRET_ACCESS_KEY)
buckets = conn.list_all_my_buckets()
if not settings.BUCKET_NAME in [b.name for b in buckets.entries]:
# BUCKET_NAME doesn't exist, create it!
res = conn.create_bucket(settings.BUCKET_NAME)
if res.http_response.status != 200:
raise
filename = 'uploads/' + fname
res = conn.get(settings.BUCKET_NAME, filename)
while res.http_response.status == 200:
# File exists, generate new filename
fname = generate_fname() + fext
filename = 'uploads/' + fname
res = conn.get(settings.BUCKET_NAME, filename)
content_type = mimetypes.guess_type(filename)[0]
if not content_type:
content_type = 'text/plain'
res = conn.put(settings.BUCKET_NAME,
filename,
S3.S3Object(struct['bits'].__str__()),
{'x-amz-acl': 'public-read',
'Content-Type': content_type}
)
if res.http_response.status == 200:
ret['url'] = '%s/%s/%s' % (settings.AWS_S3_URL,
settings.BUCKET_NAME,
filename)
except:
pass
return ret
I should mention that the method generate_fname(), which is used above, is just a function to generate a MD5 hash which will be used as a file name of the new file being added. It is not required, but you may want to use something similar. A quick run down of what this code does:
1 - Generates a file name to use.
2 - Creates an S3 instance.
3 - Gets a list of all your S3 buckets.
4 - Checks to see that the bucket you want to use exists. If not, it creates it.
5 - Checks to see if the file already exists. If so, it generates a new file name.
6 - Guesses the file type.
7 - Uploads the file to S3.
8 - Returns the file URL to your blogging client.
That's it! There are a few other articles written about this. Check them out as well!
Technorati Tags: amazon s3, blog, development, django, geek, python
Woooooops =) In my haste last night, I accidently added a change that wasn't completed yet, and it effected individual post views. The result was an Internal Server Error, it was related to the comment form. Sorry about that, and thanks for the emails letting me know there was an issue.
Just need to remember to test as much as possible before taking newer code live. I mean it really isn't that big of a deal as this is just a personal site, but still the habit should be in place.
Technorati Tags: blog, development, geek, oops




