Copy a table in SQL

In a relational database, sometimes there is a need to copy a table in SQL. This post talks about several different scenarios on doing this, and how to use SQL to accomplish each scenario.

Copy a table with all data

To copy a table with all the data, simply create a new table and populate the table with SELECT * from the original table. This will copy over the table structure as well as all the data that was in the original table.

The syntax you would use is

CREATE TABLE TABLE_NAME_2
SELECT * FROM TABLE_NAME 1;

Please note that this will not copy over the constraints or indexes associated with this table.

Continue reading

DNS Changer Malware and July 9, 2012

There’s a lot of discussion on the DNSChanger malware, with some articles using eye-catching headlines such as “malware may knock thousands off Internet on Monday.” I did some research on this topic and below are the facts around this malware.

What is DNS Changer

The DNSChanger malware was created in 2007. The affected computers had their DNS settings altered so that everytime that computer access the internet, it uses cybercriminal’s DNS server. The end result was that users would see unwanted ads, as well as being redirected to sites that were not their intended targets.

Continue reading

New Cyber Threat: Flame/Flamer/Skywiper Virus

Over the weekend, reports surfaced about a new malware called Flame (some called it Flamer, and some others called it Skywiper). Within a short period of time, all top antivirus vendors, for example Symantec, Kaspersky, and McAfee, published information on this malware. So far, this virus has been found to affect Windows machines, and it has been detected mostly in the Middle East.

The details on this threat, despite the scrutiny, are not 100% clear. What is known is that it is 20MB, a huge size for a threat. The reason it’s so large is because it has many different modules. The sheer size means that it will likely take antivirus vendors a long time to fully analyze Flame.

Continue reading

Download Pictures From Your Feature Phone Via Bluetooth

I have a feature phone that I took some pictures with, but there wasn’t an easy way for me to download those pictures to my computer. I’ve always thought that I’d figure out a way to do this, but never got to it. A few days ago I was finally able to do it via the following steps:

1. My feature phone has Bluetooth capabilities, so I figured a good path to go is to give my computer Bluetooh capability by purchasing a Bluetooth USB device. There are several you can find if you search for “USB Bluetooth.” The one I got was IOGEAR USB 2.1 Bluetooth Micro Adapter.

Continue reading

Check Server Load On Shared Host Using PHP

If you are using a shared hosting plan to host your website, chances are that you are sharing the same server with hundreds, and maybe even thousands, of other domains. Does this lead to performance issues? Quite possibly. But how do you check for that? Many hosting companies will post server status, but all that really gives you is whether the server is up or down. Server status does not tell you what’s the load on the server.

Continue reading

Change Domain Registrar

Recently I decided to change domain registrars for all the domains I have. Due to various reasons, my domains are registered through 3 separate registrars, and it made sense to consolidate into a single registrar. Below is the experience I went through, which should be pretty typical of everyone. Winning Registrar refers to the registrar I am transferring the domain to, and Losing Registrar refers to the registrar I am transferring the domain away from.

The steps are as follows:

1. Going into the console of the Losing Registrar, unlock the domain and write down the Auth Code.

Continue reading

How To Connect to SQL Server From Unix

One project I’ve had to work on recently requires me to pull data from Microsoft SQL Server from a Linux machine. It took me a lot of time to search the internet to find the proper software to install, configure, and get everything running. To save time for everyone else who may need to accomplish this task in the future, I list out the steps below:

Continue reading

How To Add Category RSS To Your Blog With Feedburner

Some blogs cover multiple categories, and your readers may only be interested in only a few of the categories, not all of them. You can offer your readers feeds that only cover specific categories. WordPress does offer this capability out of the box, but it’s not the default. Furthermore, you will want to burn all your category RSS feeds with Feedburner. Below I list the steps for adding category RSS to a WordPress blog using Feedburner:

Continue reading