Advanced Web Ranking on Ubuntu: Fixing “SQLite Could Not Be Found” Issue

“SQLite Could Not Be Found Issue” that you see when running AWR on 64bit Linux(in my case Ubuntu 10.04 ) is caused by the fact that AWR relies on 32bit JRE(you can read about this on AWR’s forum). Problem could be fixed by installing 32bit JRE on the system.This short step by step guide cheat sheet will help:

If you’re on earlier version of Ubuntu this will generally do the trick:

sudo apt-get install ia32-sun-java6-bin

However if you’re on 10.04, then it’s a bit longer process, since you need to add partner repository first:

sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get install ia32-sun-java6-bin

That’s not all though. Now you need to edit launch script(AdvancedWebRanking.sh). Line #4 needs to be updated to contain path to proper JRE. Your final file should look something like:
#!/bin/sh
cd "Advanced Web Ranking"
export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH
/usr/lib/jvm/ia32-java-6-sun/bin/java -Xmx512M -classpath awr.jar com.caphyon.awebrank.Splash

TypePad to WordPress MU: Moving content with Technorati links, images, video and all that good stuff.

Getting content out of TypePad ain’t fun at fall. Getting content with images, technorati tags, videos is even more painful.

With default TypePad ‘export’ feature you’ll just get partial content(some limited number of posts AFAIR), no technorati tags, no images. Youtube videos are going to be there since that stuff is just an html that embed remote flash video player. So to make my life a bit easier I came up with few simple tricks/scripts of how to get everything out of TypePad and process it to import into WordPress with no pain.

Here is how it goes:

Continue reading

Moving TypePad blogs to WordPress MU: TypeLists

TypePad suck, no two ways about it. Why, in your right mind, would you want to use something so limited in functionality on the platform that you have no control over, when there are tons of open source solutions that are way better…

Strangely enough, TypePad being the way it is, made a lot of people wanting to switch to things like WordPress(well at least from what I hear :) . Moving a blog onto WordPress with 0-broken links, no missing images, while keeping all embedded things, such as YouTube videos and Technorati Tags fully functional with 0-downtime ain’t a simple task. Small blogs may not really care about everything I’ve mentioned, but some serious blogs out there however need all that done, done fast and done right the first time.

Continue reading

MySQL5 TINYINT, SMALLINT, MEDUIMINT, INT, BIGINT boundaries

From MySQL Documentation, boundaries of the numerical types are as follows:

Type Min Value Max Value Bytes
TINYINT -128 127 1
TINYINT UNSIGNED 0 255 1
SMALLINT -32,768 32,767 2
SMALLINT UNSIGNED 0 65,535 2
MEDIUMINT -8,388,608 8,388,607 3
MEDIUMINT UNSIGNED 0 16,777,215 3
INT -2,147,483,648 2147483647 4
INT UNSIGNED 0 4,294,967,295 4
BIGINT -9223372036854775808 9223372036854775807 8
BIGINT UNSIGNED 0 18446744073709551615 8

Dump MySQL table or SELECT resultset into CSV or TSV file

Full table select:


SELECT * INTO OUTFILE '/tmp/file.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM `table`;

Variations(for instance select from derived table):

SELECT tbl.* INTO OUTFILE '/tmp/file.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM (
SELECT t1.category_name, t2.full_name
FROM table1 t1
LEFT JOIN table2 t2 ON t1.category_id = t2.category_id
) AS tbl;

To add a heading row into the exported by MySQL CSV file you can use UNION statement:

SELECT 'Column Name 1', 'Column Name 2'
UNION
(
SELECT tbl.column1, tbl.column2 INTO OUTFILE '/tmp/file.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM table1 tbl
);

Note: /tmp/file.csv must writable by mysql process

Choosing Credit Card Fraud Detection Service: MaxMind® vs. FraudLabs™

Credit Card fraud detection service may seem like an unnecessary thing, but if you’re running(or building) an ecommerce site that may potentially have a lot of transactions it’s something that you may want to look into as a measure of minimizing your chargebacks and your processing fees as well.

There are bunch of companies that provide credit card fraud detection service, two of them I came across while searching for such service for our latest project. MaxMind and FraudLabs

Continue reading

Find and Replace Across Multiple Files

Need to replace broken links across 1000 html files?

If you’re using linux/unix/macosx it’s just fire up the terminal and use this:

find -iname "*.htm" -exec sed -i 's/search/replace/' {} \;

search – is regex(or a string in the simplest form) what you’re looking for

replace – is what you’re replacing your string with

If you’re on Windows, well then it’s a bit more complicated. There is a nice tool – TextCrawler, it’s free and does the trick.