Good Looking Burgers — What’s the secret?

Well here’s an interesting movie to watch

  • Share/Bookmark

Pranav Mistry – Sixth Sense

This is just awesome! This type of technology will revolutionize the world as we know. I’m sure the applications are great, but what boggles my mind is how smart this young fella is.  Watch the video and enjoy:

  • Share/Bookmark

Drupal Updating / Upgrading

Updating or Upgrading Drupal is not an easy task.  Compared to Wordpress, where the updating is simply a mouse-click away, Drupal requires you to do certain things that can take a bit of time in extremely extensive sites.  I recently had to update my Drupal installation from 6.12 to 6.14

Now this being my first Drupal installation, and as much as I love this CMS, the updating process can be a pain if not following the instructions carefully.  The instructions can be found in “upgrade.txt” file located in your drupal zip file, also you can find tons of instructions online.  An excellent website learnbythedrop.com can help you out a lot if you are looking for tutorials on Drupal.  Here’s the video I followed to help me update Drupal.  Posting it here so that it can get more recognition on the web!  They say you can fill an ocean, one drop at a time….

  • Share/Bookmark

Drupal 6 Installation issues

Drupal 6 requires php directive “register_globals” to be off.  This is not always the case depending on your hosting environment or even your own requirements as Drupal may not be the only thing residing on your virtual server.

There are several work arounds for the issue if you come across an error during installation asking you to turn “register_globals” off.  It may work for you or it may not work for you, but the final one will definitely do the job.  Just to be safe, try the fixes in the order below:

1.  You can always add or edit the .htaccess file in your root directory with the following line:

php_flag register_globals off

This may or may not work depending on whether the apache configuration on your host allows directives to be fed through the .htaccess file.  Find out more about .htaccess files by going to http://www.freewebmasterhelp.com/tutorials/htaccess/

2. So that didn’t work huh?  Fret not, here’s another solution.  Place a “php.ini” file in your root directory with the following line:

register_globals = 0

did that work?  Basically you are telling php to initialize with the setting for your directory.

3. Wait, we didn’t cover the fact that you may be running your own server! Well if you are lucky enough to have your own server and control over your php.ini file, simply change the register_globals variable to ‘off’  in your php.ini file.  More information can be found at the php website about how to configure your php.ini file.

4. You could also try adding the following line to your .htaccess file (it has been proven to work on 1&1 webservers):

AddType x-mapp-php5 .php

This directive simply tells the server to use php5 for .php files instead of php4 (which might be the default for several webhosts out there)

5.  Ok genius, nothing worked, now what? Yup, that was my case as well, nothing worked, seemed the host didn’t allow default settings to be changed.  Well there’s always the “ask your hosting provider” answer.  If you are so inclined to do so, send them an email and ask them how to turn the “register_globals” variable off for your particular site.  They might not be of much help, but you never know.  Or, (Yes!) there’s another method.  You can simply tell Drupal to ignore it when installing.  It requires you to change the install file located in modules/system directory called “system.install“.  Go ahead and find the line:

if (!empty($register_globals) && strtolower($register_globals) != ‘off’)

and change the “!=” to “==” .   The line should now read:


if (!empty($register_globals) && strtolower($register_globals) == ‘off’)

Curious to know what you are doing here?  Well you are simply telling the system.install file change the “not equal to” to “equal to”.   Basically, you fooled the system into treating a response which would mean that “register_globals” is “on” into treating it as “register_globals” is “off”.  You will not get any more errors when doing the install now.

Now, remember, it is unsafe to have register_globals on.  Your system is not fully secure if that directive is on.  So if you are willing to take the risk, you can implement the solutions provided in this post.

  • Share/Bookmark

Open Source CMS Comparitive Analysis

Are you looking for an open source CMS? There are way too many systems out there and everybody has its own choice, providing their own pros and cons about the various systems out there.  I came across a nice report which I felt like sharing with others who may be visiting these open source demo sites with the same dilemma as myself, which one is best?

Link to the report:
http://www.waterandstone.com/downloads/2008OpenSourceCMSMarketSurvey.pdf

While you are at it, couple of other sites that may be of interest to you are:

http://www.opensourcecms.com/
http://www.oscom.org/matrix/index.html

If anybody reading this has any thoughts on the open source CMS systems, please share.  I personally have liked playing with Drupal a lot.

  • Share/Bookmark

Mysql – Appending data

Problem:
Appending data from one table to another table where duplicate might exist.
Solution:
A simple “Insert into table2 select * from table1″ query will give errors saying “duplicate records exist”, to go around it, the following query should do the job:


INSERT INTO MASTERTABLE
SELECT *
FROM NEWTABLE
WHERE NEWTABLE.`UNIQUEID` NOT
IN (
SELECT `UNIQUEID`

FROM MASTERTABLE

)

  • Share/Bookmark

MySQL non-matching Records

Problem: Finding records in Table b that do not match records in Table a

This sort of problem may arise when you need to scrub a file against another or run a duplicate scan on a file against another to weed out any duplicates that may exist prior to doing whatever it is you need to do with that file. Lets assume that both the tables have a field called “PHONE” that identifies your clients as unique.
The query that you will need to run uses LEFT JOIN function

SELECT * FROM TableB b
LEFT OUTER JOIN TableA a ON b.`PHONE` = a.`PHONE`
WHERE a.`PHONE` IS NULL

This should do it.

  • Share/Bookmark

Scribus – Page Numbering

So I have been working with Scribus for the last few days for a project at work.  Being on Linux, I always look for software that let me do what needs to be done that are opensource, Scribus ended up being the perfect desktop publishing solution that works on Linux. If you are looking for Desktop publishing solution, Scribus can do the job for you and if I’m not mistaken, it works on multiple operating systems (including Windows).  Now my advice is that if you are going for Scribus, make sure you go for the latest version, even though it is from their nightly developped version, you are more likely to have better functions, more functions and a stable version if you do that.  I am currently using 1.3.3.6 and I think a better version is out already.  In any case, the post is to help with the page-numbering issue.

So I made my little booklet and realized that my page numbers were showing up wrong, after 10 or so pages, I started getting 1-2-3-4 repeated all over! What’s wrong? Apparently, you need to tell Scribus that you want more than 10 pages.  So on my master template, where I had put up a # sign to indicate I want the page number to come there, I had to put up ## signs for pages more than 20.  Simple solution, weird behaviour.

Thought I’d share this with the world.

  • Share/Bookmark

Converting flv to mpg in Ubuntu

In case you ever need to convert one of those flash videos that you find all over the web these days (for example on youtube.com), you can use your linux box very easily to do so. But first, download the .flv (flash video) file from the website. To do that, use “unplug” addon for Mozilla firefox (just go to the Firefox addon site and search for “unplug”).

The plugin gives you a few choices to download streaming video/audio from a site by giving you (what it assumes) to be the best link to download the media file.

So after you have downloaded the flv file, simply open up the terminal and run this command:

user@server:~$ ffmpeg -i get_video.flv -ab 56 -ar 22050 -b 500 -s 320X240 video.mpg
A great link that gives more information about this process is in my del.icio.us and here it is: http://ubuntuforums.org/showthread.php?p=1656936

  • Share/Bookmark

mysql – matching records

Problem:
Find records that match within two tables, TableA and TableB.

Solution:

Use a simple SELECT statement with a defined WHERE clause

Lets assume that TableA and TableB have a field called “Phone” which contains the phone number of the clients and these numbers are obviously stored in a unique index. So what we are going to do is run a simple query to find out which numbers in TableB match TableA.

Assuming you are using linux and you can run this query from the command prompt, this is the way to do it:

user@server:~/ mysql -u USERNAME -p
(the server will ask for your password, enter the password and press Enter)

Now you should be in mysql and the prompt should look different already

mysql> use DATABASENAME
(this command changes the database to the one where you have both the tables)
mysql> select * FROM TableB, TableA WHERE TableB.phone=TableA.phone;

This query will obviously select all fields from TableB and TableA. If you only wanted to select certain fields (for example “name” from TableB and “name” from TableA), then the query would change to:

mysql> select TableB.name, TableA.name FROM TableB, TableA WHERE TableB.phone=TableA.phone;

This will give you just the name column from TableB and name column from TableB.

Now what if you wanted to dump the query result into a text file for future use? Here’s the query:

mysql> SELECT TableB.name, TableA.name FROM TableB, TableA WHERE TableB.phone=TableA.phone INTO OUTFILE ‘/tmp/matchingnames.txt’;

That should do it.

  • Share/Bookmark