Wednesday, November 28, 2012

How to install wkhtmltopdf on CentOS 6.3

I was recently upgrading a server and I came across a problem that does not seem well documented on the internet. I have a CentOS 64bit Server running the latest version of WHM/cpanel. A client needed wkhtmltopdf installed for one of his websites so I thought I would show you how to install it on CentOS.

You can download wkhtmltopdf from this website: http://code.google.com/p/wkhtmltopdf/downloads/list

The first time I tried to install this I went with the latest version. At the time of writing this it was wkhtmltoimage-0.11.0_rc1 Linux Static Binary (amd64). However all I got when I tried to write a pdf was:

QPixmap: Cannot create a QPixmap when no GUI is being used
QPixmap: Cannot create a QPixmap when no GUI is being used
QPixmap: Cannot create a QPixmap when no GUI is being used
QPixmap: Cannot create a QPixmap when no GUI is being used
Segmentation fault

This turned out to be because it was not a stable release so do not make the same mistake I made and download the latest release candidate. Rather download the stable version. At the time of writing this, the latest version is 0.99.

http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-amd64.tar.bz2

The following commands should get wkhtmltopdf working on cPanel server:

# wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-amd64.tar.bz2
# tar xvjf wkhtmltopdf-0.9.9-static-amd64.tar.bz2
# mv wkhtmltopdf-amd64 /usr/bin/wkhtmltopdf
#chmod 777 /usr/bin/wkhtmltopdf

To test wkhtmltopdf run the following command:

# whktmltopdf http://www.google.com google.pdf

You should see a file in your directory called google.pdf. 

Hope this helped you save time. 

Thursday, November 1, 2012

Thats Racist - A discussion about Trevor Noah's show

I guess this story starts with me apologizing to Trevor Noah for taking some of his posts out of context as he says I have. Apparently I took his tweets the wrong way. For those of you who are not familiar with the story let me give you some context.

I went to Trevor Noah's show Thats Racist!. I actually enjoyed most of the show. I laughed at the Woolworths jokes, I laughed at his depiction of white racists. It was all pretty funny. The bit that annoyed me was in the last 20 min of the show.

Trevor spent a lot of time focusing on white racists, and I understand that. There are some white racists in some communities. One just has to spend 30 minutes reading News24.com comments to realize how far some white people have to progress.

What I did not enjoy was the focus on mostly white racism. It actually annoyed me a little (and at the time perhaps I was overly sensitive). I was wondering, why is this last part focused on just white racists? Where is the lecture for racists of all colours?

To me personally this made me feel like Trevor missed an opportunity to highlight racism in all culture groups. For instance, while some whites are racist you can not ignore the clear racism of some blacks. For instance, no whites were involved in the racist xenophobic attacks that swept our country back a couple of years.

Whites are on the receiving end of racism constantly as well. A couple of weeks ago I took a friend to Cecilia Makiwane Hospital next to Mdantsane near East London. Our black friend was allowed through the front door of the hospital, but the security guard cut us two whities off and made us walk the long way around and take the side entrance.

We constantly have it being reinforced into us that we are white and unwelcome. By reading our media sources there is almost every week someone having a go at white people simply because of the colour of our skin.

I woke up this morning and what do I see on my news feeds? Hate speech and racism directed at whites again from a student body of the African National Congress.




These constant attacks in the media keep building up on the psyche of white South Africans and has a negative polarizing affect.

Trevor, I guess the reason why you don't speak about it that much is because you are not on the receiving end of this type of racism. Its there, its real and its constant.

Remember, in all populations you get a small minority that are racist. Whites and black. There are a lot more black people than white people, so the minority of racist black people.... actually feels like pretty sustained and constant racism due to the large black population in South Africa.

Your lack of balance in your show is what upset me, which is why I tweeted you (in now regrettable anger).

This is the tweet I sent:


Went to watch  last night. Enjoyed the jokes, not the patronizing lecture. Wont be buying tickets again.


You then replied to me with a comment about where you and I stand:


 it wasn't patronizing it's my opinion. But now we both know where we stand.


However what you also did right after you retweeted me was post the following comment:


Some people like comedy until you make them think. You laugh at Zuma jokes but can't laugh at apartheid jokes? 


You have 500 000 followers. This instantly started two things. An instant hate group and an instant support group. It was the strangest thing ever, but because of the way you retweeted me and then commented, I literally had hundreds of people telling me what a scumbag I was for being racist.

I know later you said that you were not calling me racist as per:


 ps. I don't blame you or "white people" for anything. I blame racists. Our racists happened to be white. It's sad but true.
. Yo I wasn't referring to you and I never called you racist. I love constructive criticism & that's why I replied to you.


I just want to go on record here that it did not seem to me or your supporters that you were not calling me racist. If the several hundred people instantly hating on me are anything to go on.

Now I know I am not a racist. I grew up in a multicultural society and I am in a very happy multicultural marriage. I have very close friendships with mates of all cultures and from several different continents.

I don't complain about BEE and I don't complain about AA. I understand the importance of them for our social development.  I'm pretty pissed off at the shoddy implementation and management of it that has lead to the creation of a cartel that monopolized most of the benefits of it.

I spend my free time getting involved in local politics to uplift my community. I am involved with charity work that supports several of the orphanages and townships in town. I know while doing all of this my skin colour counts against me. I know the impact that I can have to try uplift our society will be limited by the colour of my skin.

So what's the point of my post to you? I want you to know that there is a racism problem in South Africa, and its not just the whites. All groups and all cultures are doing it. Do not just focus on one cultural group. When you give your lecture/opinion at the end of the show perhaps you could direct it at everyone.

There are plenty of us whities in this country (the majority of us), that mean well and were brought up in the new South Africa. We are willing to live and die to grow this country and all its people. We are not racists. We have come very far in the last 20 years as a cultural group and are still improving.

At the end of the day South Africa is the cradle of ALL humanity. Every single human on the face of this planet has a great ancestor that originally came from South Africa. There is no one that should not be welcome or included in South Africa.

As the South African motto goes, "ǃke e: ǀxarra ǁke" - diverse people unite

UPDATE:

Both Trevor and I have deleted our tweets but at least constructive dialog came out of this in the end.


 I've deleted that retweet because it was never meant to get people to attack you.