Friday, October 7, 2011

How to install kubuntu-desktop

I played with my laptop in struggling to install libgtk2.0-dev. Unfortunately my ubuntu-desktop crashed, I was unable to log-on via the GUI anymore and only able to have the command prompt.

I tried to reinstall ubuntu-desktop but the system doesn't happy at all.
Since I need to get this laptop going immediately, I tried to change the desktop with kbuntu.
here is the command i'm using
sudo apt-get install kubuntu-desktop

I also had to change my network setting to dhcp as well. It was using static before.

auto lo eth0
iface eth0 inet dhcp
iface lo inet loopback


Saturday, August 20, 2011

Create VIEW on MySQL

Here is the example to create a VIEW on MySQL

mysql> CREATE TABLE t (qty INT, price INT);
mysql> INSERT INTO t VALUES(3, 50);
mysql> CREATE VIEW v AS SELECT qty, price, qty*price AS value FROM t;
mysql> SELECT * FROM v;


Saturday, August 6, 2011

Move a table into different database on MySQL

I'm working with MySQL lately so I want to record some notes on the experience so I can refer back to this post when I need it again in the future.

Here is the command:
alter table old_db.foo rename new_db.foo

Simple, isn't it?

Sunday, June 26, 2011

To find out what application is listening on a port

I keep forgotten the command as mentioned on the subject of this blog.
Hopefully I can find out this command easily without having to googling anymore.
lsof -i :80