Listing all your blogposts

March 30th, 2010 § 0 comments § permalink

So here is a quick snapshot at how to get all your wordpress blogposts using python [or wordpresslib to be specific]

#!/usr/bin/env python
import wordpresslib
import tinyurl
wordpress = raw_input('Wordpress URL:')
user = raw_input('Username:')
password = raw_input('Password:')
# prepare client object
wp = wordpresslib.WordPressClient(wordpress, user, password)
# select blog id
wp.selectBlog(0)
posts = wp.getRecentPosts(100)
for p in posts:
if p.title.find("p=")<0:
    print p.title," - ",tinyurl.create_one(p.link)
Now that is real easy to use IMHO, i just started using this in one of my scripts. It is easy to use this and plug into other systems which use python !
Resources:
http://code.google.com/p/wordpress-library/
http://pypi.python.org/pypi/TinyUrl/0.1.0

RHEL5 : Yum to munin

March 18th, 2010 § 3 comments § permalink

So here are some dead easy ways of getting munin and munin-node installed on your RHEL5 server.

First add RPM Forge repository
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

Then just fire

yum install munin munin-node

Now, you have your munin running. Lets turn our attention to monit.

First add this new repo to you
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm

Then go ahead and install monit using
yum install monit

Now this my friend was real easy ! Have fun , more later.

Jailed in FreeBSD

March 8th, 2010 § 2 comments § permalink

Well, working on freeBSD right now some immediate learnings for most linux users

  • Ports is as good as apt-get [and i would say much better, when i started installing stuff]
  • You will need to start with installing vim and bash to make your life a lot easier

So the target was to install python and nginx, both of which are very easy to install once you understand how the whole ports collection system works. So here is the guide to installing nginx

portsnap fetch – This gets the portsnap collection file

portsnap update – This updates the collection directory at /usr/ports

Then goto /usr/ports/www/nginx and use make, it throws up a very nice module selection menu which i really like. I do wish that apt-get was like this when it came to installing stuff like this. The final step is a make install Simple is it not.

Python is very similar when you want to install as well ! More as i finish my installation and tweaking, having some issues with nginx latency !

Twitter background generator version 0.1

September 18th, 2009 § 0 comments § permalink

Working on a very basic twitter background generator, right now focusing on how to get the sidebar width right. It is very much under use at my twitter handle @dipankarsarkar (http://twitter.com/dipankarsarkar). The core idea is to be abe to communicate more information about what i do as a person using the background image. Some features that I personally want are

  • Transparency for the sidebar – The image underneath should be visible, right now its a grey opaque color.
  • A right sidebar – After some research , I figured out that the safest and optimal width to cater for is 1200px, with the core content on the left sidebar though. More thoughts on that as I deploy some new changes.
  • Better fonts – Although new fonts / languages can be deployed. The code is not flexible enough right now to add new fonts.

That is a long enough list for the day :) , attaching the background with this as well. Let me know in case having cool backgrounds excite you.

Nginx upload module – efficient uploads

August 20th, 2009 § 0 comments § permalink

I was just having a look at some forums and saw some people talking about how to handle large parallel uploads. I have been having a look at this plugin which comes with NGINX and played around with it. Extremely useful if you use nginx in your stack and are getting killed by massive uploads.

Have fun!!

http://www.grid.net.ru/nginx/upload.en.html