Category Archives: Blogging

Core Dump files slowing down website

For last few days, or rather weeks, my blog was really slow. Infact the site was throwing resource limit error at times. I contacted my webhosting provider, but they just replied they cannot find anything. So I decided to do some investigation on my own.

First step was to check memory and CPU usage, which turned out to be very high, almost 100%. The fishy thing I figured out was disk space usage, which was way above data I have, so I checked the file system. I figured out hundreds of core.XXXXX files. A little googling showed that these were dump files created by Apache for memory dump, in case some error / crash occured. Deleting these extra files did solve the issue.

More info on the topic

https://wordpress.org/support/topic/hacked-with-strange-core-files

https://wordpress.org/support/topic/arrrg-so-many-core-files

http://en.wikipedia.org/wiki/Core_dump

Taking backup of WordPress site

For sometime now I was planning to try out some things/experimentation with this blog. But before that I wanted to take a backup of whole thing in case I mess up stuff.

Now when I say taking a backup, I am not much worried about wordpress files as such as I know I can just download and install wordpress anytime. Most of the cpanels come with wordpress installation these days or the software can be downloaded from http://wordpress.org/download/. In case you have a customized theme or images, you can simply ftp into your web root folder (www), and copy the wordpress directory to a location where you want to back it up.

For me the only important thing was database. Mostly posts, comments, category and tags. So here are the steps to do that.

  1. Login to your phpmyadmin (or any other way you access your database/ check with your service provider)
  2. Go to your wordpress database, it has tables most probably in form of wp_name. We are concerned about- wp_comments, wp_postmeta, wp_posts, wp_terms, wp_term_relationships, wp_term_taxonomy.
    Note, I am not copying user related or wordpress related information as it is always good to create new information when installing new setup. I am only concerned about the real stuff- post related stuff to be backed up.
  3. Now Click export at the top panel  in PHPMyAdmin. Use  custom as export method.
    Choose the tables you want to export (mentioned above), default format is sql, we can leave that as it is.
    The only thing of concern on this page is “Maximal length of created query” field. I figured out that the default value was too low for me. Adding 2 extra zeros to default “50000” helped me. If your posts are larger, you might need one more zero. The way to check it, is to open the exported sql file and see wp_posts data is available.
  4. Click on Go and you have your backup sql script ready.

Getting the script is one thing and using it another. We need to make sure that the script we just created will actually work. That is simpler than taking backup.

I created a new wordpress installation locally and imported the sql file created above into my new installation.

mysql -u kamal -p -v -h localhost wordpress <D:\data.sql

And this is how my backup blog was ready. That’s it

Antivirus Marketing strategy?

It has happened to me twice now. Days before my anti-virus subscription is about to finish, I start getting messages that some virus or worm has infected my system which was successfully cleaned up by the anti-virus. Just wondering if this is some marketing strategy by these anti-virus companies to tell us about the importance of their software or a sheer coincidence?

Blogging- is beautiful

Ever noticed the ‘Next Blog’ button blogs hosted on blogspot. I was reading a friend’s blog and saw this next blog link, I mean, it must have always been there, but today I thought of giving it a shot. It started pouring random blogs, from people far-far away, never seen or heard of, sharing their thoughts, pics, news. Sharing there Christmas stories from last year (it was good to see that I am not the only one not posting to blog regularly 🙂 ), writing about there first day at college, the countries they are visiting, blogs dedicated to favorite shows and bands, computer games, technologies, plus a lot of random information. And then it started showing blogs of different languages so I lost interest. But it was interesting to see so many people sharing their thoughts through blogs.

Creating a website, in less than an hour, for free

Over the weekend a friend discussed his idea of creating a web portal for some specific services with me. The failed entrepreneur in me liked his idea and encouraged him to go ahead (anyone, who is trying, should be encouraged). He shared some wireframes for his portal, but he was not sure how will it actually look on the web. So after returning home, I decided to get some basic version of the website up on the internet to help him. Resulting in the journey mentioned below.

Step 1: I knew I will have to share my email address with service providers (hosting space/ domain name etc.). And as I am looking for free stuff, it would be more than possible that I come across some fake websites. So I thought of creating a dummy email id which could be used to register to all these websites.

Step 2: Now I needed a domain name. I could buy, but as this was just a dummy site, why waste money. Next option is using subdomain from web hosting provider. Here I had to look for a free web hosting provider, and my past experience with free hosting providers is ‘don’t trust them’. The site can go down anytime without notice (its for free. What were you expecting?). So I thought of getting a free domain name, yes, a co.cc domain. I registered a domain with http://www.co.cc/, which I could use with any service provider.

Step 3: Now I needed web hosting. I googled around some free web hosting sites, zeroed upon one (checked features and reviews), registered, and bam, it is not working. Moved to second one, registered, and this time it worked. It was awardspace.com. I got Linux hosting with Apache, PHP, MYSQL. Basically all I needed, for free. I set up the nameservers for the domain and all is good. (Ofcourse I tried a hello world example, I am still the same old fashioned developer at heart).

Step 4: Now we have all set to host our web pages. I had the wireframe with me, and I had frontpage, I could easily create the HTML pages. BUT, from my past experience, I knew designing web pages is a sin for a developer (“Are you colorblind! Why are all the pages grey?”). So instead I pinged a designer friend and asked for some templates. Who suggested checking http://projectw.org for free html/ php templates (you will find more interesting stuff on the forum, but handle with care :D). Ok so I had a template with me, now I needed to customize it for my pages. Actually this was the part which took most of the time. Once done! I just had to upload the pages to my website using ftp. And we are done.

Wasn’t it simple. If instead of a website you are trying to create a blog, you can simply upload the blogging software. Infact most of control panels come with blogging softwares, so that is actually simpler.

If you don’t have your website yet, what are you waiting for? Go ahead! Get your hands dirty.

Uploading images with wordpress

When I was trying to upload the dilber image while writing this post, I was surprised to find out that the image was not getting uploaded and worpress throwing back HTTP error.

After googling around, I figured out the similar problem here. Though in my case .htaccess file was blank (in root www directory of wordpress). I added following lines to the file and uploaded.

 <IfModule mod_security.c>
<Files async-upload.php>
SecFilterEngine Off
SecFilterScanPOST Off
</Files>
</IfModule>

This solved the problem for now. Does anyone have detailed idea on this issue?