May 2009

Accidental Ctrl+S Locks and Freezes Linux Terminal / SSH / Telnet

Ctrl+S happens to be a rather handy and popular combination as it’s used in Windows applications to save your current working data. I accidentally used it several times in Vim and it keeps locking the screen up and halting the interactivity — basically, after Ctrl+S I can’t do anything to the terminal (window). I use …

Accidental Ctrl+S Locks and Freezes Linux Terminal / SSH / Telnet Read More »

How to change Vim syntax highlighting colors?

Unbuntu has auto-configured Vim to use syntax highlighting for text (mostly, programs and configuration files of course) editing, the problem however, is that some of the colors appear to be darker than wanted on SSH console and it’s a little hard to recognize comfortably. So how can we change the default colors of the syntax …

How to change Vim syntax highlighting colors? Read More »

How to know if your site has been penalized by Google for malicious software or suspicious content?

Back when WordPress was pretty young there’s some loopholes that enable hackers to inject unauthorized and dangerous HTML code into your website pages, thus promoting the distribution of malware that damages the end users computer. I was once there and got penalized by Google for one of my sites. However, they are gentle enough to …

How to know if your site has been penalized by Google for malicious software or suspicious content? Read More »

MySQL: Huge Table Not Responding after Adding Index

Today I’m optimizing some MySQL tables with large number of records — 1 million of them, yeah, I know — , it’s simply impossible to deal with such big chunks of data without proper indexing. So there I was, adding a variety of indexes to a few of the columns. It’s expected it’d take a …

MySQL: Huge Table Not Responding after Adding Index Read More »

MySQL: Counting Number of Records or Rows by a Foreign Column (from Another Table)

Well, MySQL doesn’t actually have anything called Foreign Key, it’s just my way of saying a alien column from another table. Let’s say 2 tables are related, 1 is books and the other is subjects. Any book in book table falls into one of the subjects, thus having a subject column referencing the ID of …

MySQL: Counting Number of Records or Rows by a Foreign Column (from Another Table) Read More »

MySQL: Update Multiple Rows or Records with One Single Query

As MySQL doesn’t have inherent support for updating more than one rows or records with a single update query as it does for insert query, in a situation which needs us to perform updating to tens of thousands or even millions of records, one update query for each row seems to be too much. Reducing …

MySQL: Update Multiple Rows or Records with One Single Query Read More »

MySQL: Replace Substring with Another String – the MySQL String Replace Function

To find / identify a part of an original string and replace it with another string in a SQL query with MySQL, use REPLACE(), the string replace function. For example, you may want to replace all spaces in one of the varchar or text fields to a single dash: UPDATE `table` SET `old_field` = REPLACE(`old_field`, …

MySQL: Replace Substring with Another String – the MySQL String Replace Function Read More »

MySQL: Deleting Duplicate Rows or Records | Selecting Unique Rows into A New Table

One of the principles of data integrity is to reduce data redundancy as much as possible and wipe out any duplicate database table entries. Another reason for this is that you need to add unique indexing to one or a group of table columns and you need the one column or combination of columns to …

MySQL: Deleting Duplicate Rows or Records | Selecting Unique Rows into A New Table Read More »

Dynadot Affiliate Program Review – Not Worth the While

I joined Dynadot at the commencement of .tel domains and tried my luck to get some domainers to register a domain with them. Maybe it’s because they just don’t care about expanding via affiliates, the system might be a little buggy or not so affiliate friendly in that once the referred friend signed up an …

Dynadot Affiliate Program Review – Not Worth the While Read More »

Build Simple Amazon Affiliate Text Links with just ASIN (10 digit ISBN) and Your Amazon Associate Tracking ID

Amazon Affiliate system does a great job presenting you a variety of ways to make associate affiliate links so that you can take credit of their products that you have referred to others. Today I messed around a little bit with their generators and finally come to a simple solution to generate affiliate links dynamically …

Build Simple Amazon Affiliate Text Links with just ASIN (10 digit ISBN) and Your Amazon Associate Tracking ID Read More »

1 tip about ALTER TABLE xxx ADD INDEX yyy

Proper indexing can work wonders for large databases in query efficiency, it’s a compromise of disk storage in exchange for sorting speed. For databases with millions of records, indexing takes considerable amount of disk storage, and, AGONIZING lengths of time to create. I recently compiled a database with one table mytable consisting of over 4 …

1 tip about ALTER TABLE xxx ADD INDEX yyy Read More »

Largest U.S. Bankruptcies, 1980–Present

Just imagine, that much amounts of money just vaporized into thin air at a cause of nothing. Company Bankruptcy date Total assets pre-bankruptcy (in millions) Lehman Brothers Holdings, Inc. 9/15/2008 $691,063 Worldcom, Inc.1 7/21/2002 $103,914 Enron Corp.2 12/2/2001 $65,503 Conesco, Inc. 12/17/2002 $61,392 Pacific Gas and Electric Co. 4/06/2001 $36,152 Texaco, Inc. 4/12/1987 $34,940 Financial …

Largest U.S. Bankruptcies, 1980–Present Read More »

Google AdWords mistake (a bug?)

Naturally, you’d never expect an AdSense ad of a site to appear on itself. But this I just encountered, indicates an inherent *bug* of AdWords. Or is it? But I’ll never understand otherwise. What’s the point? Maybe there’s an option for the AdWords advertiser to opt out of his advertisement listing being published on his …

Google AdWords mistake (a bug?) Read More »

MySQL: INSERT INTO … SELECT … FROM … Selectively on Table Columns / Fields to Combine Multiple Tables into One

While you can always fulfill tasks such as creating a new table out of existing ones in MySQL by the help of PHP, it’d be much faster and way more efficient with native SQL queries. Consider when you need to combine a few tables into one, more precisely, you need just certain fields / columns …

MySQL: INSERT INTO … SELECT … FROM … Selectively on Table Columns / Fields to Combine Multiple Tables into One Read More »

DreamHost Review: Pros and Cons plus Uptime Charts

I’ve been DreamHost since 2006 and that’s more than 3 years of hosting experience with them on a shared plan ($9.95 / month). For those who’d prefer scanning instead of reading, I’ll sum up my points in short lists: Pros Affordable price with generous offerings in disk storage and monthly transfer. Full pack of features …

DreamHost Review: Pros and Cons plus Uptime Charts Read More »

MySQL: Insert if doesn’t exist otherwise update the existing row

A good practice of increasing SQL efficiency is to reduce the number of separate queries as much as possible. In a situation where you want a row updated if it exists and inserted if it doesn’t may take a newbie MySQL developer to write 2 independent queries, namely: first, check if the row exists with …

MySQL: Insert if doesn’t exist otherwise update the existing row Read More »

Scroll to Top