Community Blogs

Installing and Using Mysql on Ubuntu

1. run following command in terminal
   sudo apt-get install mysql-server

    during the installation process it will ask for root password

2. to check whether the Mysql server is installed & running properly,run
   sudo netstat -tap | grep mysql

   you sholud see now the following lines or something similar:
   tcp        0      0 localhost.localdo:mysql *:*                     LISTEN      13059/mysqld

3. If in case your server is not running properly you can restart it by running following command
   sudo /etc/init.d/mysql restart

Using Mysql
4. when mysql is installed, you can start it by running:

 mysql -u root -p

the command prompt will change now to mysql>

5. to create database use:
    create database databasename;
6. to use database use:
    use databasename;

from here on you can create table,insert into table and peroform other mysql actions

Read more... Comment (6)

Convert ext2 to ext3 file system

The conversion procedure is very simple enough. Let us assume /dev/sda6 (ext2 now) mounted on /convert.  You will be seeing fstb entries like,

/dev/sda6         /convert             ext2    defaults        0 0

Unmount the partition

umount /dev/sda6

Enable Journal (converting to ext3) using tune2fs command,

tune2fs -j /dev/sda6

Edit /etc/fstab and for /dev/sda6 change the file system type to ext3. Finally, the entry should be like this,

/dev/sda6         /convert             ext3    defaults        1 2

Mount the partition using mount command,

mount -a

If above command doesn’t work, reboot the system and check.

Read more... Comment (0)

MultiPath TCP in the Linux Kernel

MultiPath TCP is an extension to TCP to transmit data of a single connection over multiple interfaces simultaneously. (

This allows a better throughput and better resilience in case of link-failures.

We have an implementation of MultiPath TCP in the Linux Kernel.

Visit to try out and contribute to our open-source project.




Read more... Comment (0)

First blog post...

Well, I guess I will start a little about me, how I got involved in Linux and where I hope it takes me in the future!

I'm Justin, 32 years old in NJ.  I work in law enforcement and I've been dabbling in the Linux realm for the past 5 years.  My first distro was Red Hat... I bought it off ebay and I had no idea what I was doing.  I got frustrated and continued with Windows but dual booted Ubuntu and a few other distros here and there.

Over the past 2 years I've been reading and using it for data recovery jobs for my friends.  Within the past year I've really made a push to use Linux primarily and I'm on a good track right now. 

While still very green with Linux I have learned a lot and it just never stops.  The flexibility, stability and high customization is what I like the most.  The open source community is amazing, the support is amazing and it's free! 

I wiped my windows hdd in my laptop and that is purely Linux.  My hopes are to show people how Linux will benefit them and for business how much money it can save. 


My wife and I operate a small internet store selling vinyl wall art and I haven't changed some of the art to a different format yet so I'm sorry to say I have to keep the XP machine around a bit longer.  Perhaps after the summer as boating will occupy most of my time (hah)!

I look forward to the community and hope to contact linux users in my area soon!




Using Ubuntu for Work/Play

Having been a student by day filmmaker by night.Ubuntu has really helped my quite a real bit.

Cinelerra,Kdenlive etc have helped me in many way for my film making process.As for being a student, Open Office Org has helped me create professional looking documents,letters(excuse letters) and even help build a website with HTML.

Being a filmmaker i do eventually need to do sound and video editing of some sort.Which brings me to my next question.

How do i incorporate Linux(Ubuntu) into my hobby?

Ubuntu is open source which enables me to save on licensing fees,extra add-ons,expensive new computers for just the new software.This was how it all started my tech guru had an old laptop from the office and had the Windows XP for his work purposes it had all sorts of programmes on it Windows Server to access his virtual office and his infrastructure.the old laptop had started to fail with Windows in it and all the high robust,complicated applications in it functioning,he had gotten a new laptop form the company to replace the failing one.He had use the old one for his personal purpose like watching his comedy shows and doing some mobile surfing at home or even on our holiday in New Zealand.Running on Ubuntu 8.10 it functioned well enough over my expectation.Back then i was living under a rock doing only with what i have and not sourcing out for better methods to do things like Video Editing.I had then remembered my guru sharing with me Ubuntu.

I had picked up Ubuntu again starting with 10.04 recently late last year,trying numerous times to make a download of Ubuntu from my computer and receiving the . ISO image i gave up! i went to and ordered my copy of the Live CD it came just about about 8 weeks ago and i have given it numerous test drives without fail having to please me each time i use it. 

My decision was final i had booted Ubuntu alongside my usual Win7 so each time i booted up my computer i would go to the BIOS menu and choose to boot for my other hard drive which had me a chuckle each time i boot up as it always remind me of my past living under a Cinelerra, OpenOffice. Org all in my computer each and user friendly.

As for my homework i'm using Open Office to type out essays,really does serve a purpose in my work both in scripting and in homework.

I took the option of using dual booting in my computers used all ubuntu and win combine


Now have you tried your fair share of Ubuntu!?!





Linux - How I Got Here... and Where I'm Headed

Sometimes, we all have to look back down the path we've taken to more fully understand that path that lies ahead.

I started my Linux Adventure a bit late in life. I've always had an interest in all things technical. My career for the majority of my working life was as an electronics technician (component level repair). I had aspirations at one time of gaining an engineering degree in electronics; other paths were taken, though.

My first experience with computers and programming and such was in 1979-80, when I was attending tech school. We were trained on kit-made 8080A computers that were so primitive that they were programmed directly via octal machine code. The outputs of the machines were led light displays. This was ridiculously simplistic by today's computing standards.

I didn't choose computers as my field of endeavor, though. I was much more interested in RF (radio frequency) and audio electronics. That decision probably made for a much different life than others would have. I regret lacking the vision that others had regarding the future of the computer. Hindsight shows me that I would have enjoyed a career in that field very much.

I did not have much interaction with computers from the early 80s till about 2000, with the exception of some fun times with a Commodore SX64 and some intriguing games from a company called Infocom. Oh, I had some experience with PC-type systems at the workplace in the early 90s, but I never really developed a passion for them.

I remember in the late 90s sitting at my kitchen table reading computer store ads and dreaming about getting a system for my home. I never could justify the money for it, unfortunately. I had other priorities. In 2000, my brother bought a new system for himself and passed his old system on to me. It was a little Pentium I - 90Mhz machine. I set that guy up and signed on to a bunch of free dial-up ISPs and off I went...

My current passion with computers and operating systems came about directly from my initial experiences with the Internet in 2000. Yeah, I was a little late coming to the party. I've been trying to catch up ever since. I have come a long way, though. I've been building my own systems since 2001 or so. I crossed over from MS Windows to GNU/Linux in 2006. I'm currently reading and learning all I can about the GNU/Linux operating system.

I made some resolutions in the new year to learn more about specific Linux subjects; one in particular was shell scripting. I'm currently reading and experimenting with that now. I'm also publishing some basic lessons regarding this stuff as I go along. I learned a long time ago that a great method for learning is to learn by teaching. I have to research and learn something before I can write an article about it here.

Whatever I learn, I like to pass on to others. That is the beating heart of the GNU/Linux Open Source community. I have learned so much from the selfless acts of others in this community that I am driven to give something back. It is a mission of mine to educate, to assist, to entertain, and to ease the transition of new Linux Adventurers into this wonderful community. I am no guru when it comes to Linux, but I have gained enough knowledge to get around without getting lost too often. I have much to learn yet, but when I do learn it, I'll be here or somewhere helping others to learn it too.

A man called Bruno inspired me.

I would one day love to earn a living writing technical related articles or books regarding GNU/Linux. I would like to be employed in some fashion that would allow me to use my knowledge in a GNU/Linux business environment; as a systems administrator or a technical writer for some company or other. Sadly, my late-coming to the party and the fact that I'm no young spring chicken anymore has hindered my abilities to secure any positions like these. I'm totally self-taught and hold no industry certifications. I would love to attend school again to learn more in this field, but again... it doesn't always work out that way.

I'm not at all sure what my future path is going to be like. It's a day-to-day thing right now. However, I will always be learning; and with any luck, I'll always be here passing it along to you.

Thanks for reading/commenting.



*This article was originally published on my Nocturnal Slacker v1.0 site at



Using ifconfig

What is ifconfig???

Well, ifconfig command has been used for years to manage network interface cards.Its is easy and small but gets the job done.

Using ifconfig

If ifconfig is used without any parameters it will show all the information of all the network interfaces(loopback,eth0,etc...). Information like : Link encap, hardware address and most especially RX packets and TX packets since with from these you can determine whether there is any errors in the network.

To display all information of all the network interfaces simply type:


However, to display information of a specific network interface like eth0 , simply type:

ifconfig eth0


ifconfig can be used not only to display network information but also to change them.


for example if you want to change the current ip address of eth0 from to you can simply type this command in the terminal to do so:

ifconfig eth0 up

However, you can pass some extra parameters while changing the ip address like subnet mask eg:

ifconfig eth0 netmask up

You can also bring a specific network up(on) or down(off) eg:

ifconfig eth0 up

ifconfig eth0 down

Using Virtual IP Addresses with ifconfig

Another rather useful way of using ifconfig is to add virtual IP addresses, which are just secondary IP addresses that are added to a network card. A network board with virtual IP addresses can listen to two different IP addresses, which is useful if you are configuring serv- ices on your server that all need their own IP addresses.

You can also use the virtual IP address within the same address range or on a different one. To add a virtual IP address, add :n where n is a number after the name of the network interface.For example, ifconfig eth0:0 adds the address as a virtual IP address to eth0. The number after the colon must be unique, you can add a second virtual IP address with ifconfig eth0:1, and so on.

Read more... Comment (0)

He's GNUing the Distance, He's GNUing for Speed: My Top 7 Favorite Games for Debian GNU/Linux

Often times when I talk with fellow computer enthusiasts, usually Microsoft users, I am met with derisive shouts proclaiming GNU/Linux to be devoid of quality games. With that in mind, I decided to voice my opinion on what I consider to be some of the best games available for the Debian GNU/Linux operating system.While most people choose five or ten for their top lists, I decided to go with seven as it is my lucky number. For my pricing descriptions, I shall borrow from Free Software Foundation founder Richard Stallman's classic quote, "'Free as in Freedom,' not 'Free as in Free Beer'" to denote titles that are financially free to download.

7.) Armagetron
For Debian-based systems:# apt-get install armagetronad
Price: "Free as in Free Beer"

An oldie-but-a-goodie, this Free Software title evokes the excitement of the original 1982 Tron film's light-cycle grid battles. Despite its minimalistic control scheme, it continues to thrill gamers like me who enjoy all the twists and turns that come from such a frenetic title.

6.) Osmos
Price: Pay what you want

I did not originally know what to make of this innocuous puzzle game when I purchased it as part of the second Humble Indie Bundle, as you play a microscopic organism intent on expansion. As the days went by, I found it to be a deceptively captivating release as well as a welcome bit of respite during my lunch hour at work.

5.) World of Goo
Price: Pay what you want

With my mother being a mechanical engineer, I grew up appreciating the logic and care that goes into building sound structures. This game is a problem-solving physics game where you must surmount obstacles of varying degrees of difficulty with exponentially increasing levels of ingenuity. A very whimsical title for gamers of all ages, it was available from the Humble Indie Bundle #2 in December of 2010 as a bonus game for earlier purchasers.   

4.) Braid
Price: Pay what you want

A delightful game betwixt Super Mario Brothers and Prince of Persia, Braid allows users to rewind time to prevent painful mistakes. This quantum quality underscores the game's story, which showcases the trials of a man named Tim as he attempts to reconcile a past relationship with a princess. With a combination of beautiful art direction and calming musical accompaniment, this was one of main reasons I purchased the Humble Indie Bundle #2 in December of 2010.

3.) Revenge of the Titans
Price: Pay what you want

This past week, I was home sick for several days with nothing to do but rest, work on college classwork and experiment on a Humble Indie Bundle title I purchased called Revenge of the Titans. Save for being sick, it was one of the most enjoyable experiences I've had in years playing tower defense real-time strategy games on PC.

2.) Frozen Bubble
For Debian-based systems:# apt-get install frozen-bubble
Price: "Free as in Free Beer"

With the crazed tempo of most modern PC and console games, it is a delight to find such an engaging title in the form of Frozen Bubble. With no blood, gore or violence to speak of, its a puzzle game suitable for any gamer. I have had much jocularity with my siblings over this release, and I intend to keep playing it for years to come.

1.) Nexuiz/(Xonotic)
Price: "Free as in Free Beer"

In contrast to the adorable penguins of Frozen Bubble is that of the first-person shooter Nexuiz (hereafter forked as Xonotic due to licensing issues) I have had many a goodhearted frag-fest with other fans of this FLOSS title over the years, including a memorable game of "hide-and-seek" involving rocket launchers. As soon as Xonotic sees its first official release, the fork shall be with me.

If you have not already installed these games via terminal or purchased them, I hope you will give them a chance. Until then, GNU yourself a favor and enjoy your favorite games on the only operating system that is free as in free speech and free as in free beer.


Pinguy OS LTS Update: 10.04.2 [Ubuntu Remaster]

An update for Pinguy OS 10.04 LTS was released today: 10.04.2. For those who are not familiar with Pinguy OS: it's an Ubuntu remaster with a lot of useful default applications "built to have eye candy (Gloobus Preview, GNOME Do, Docky, Nautilus Elementary) and for every part of it to be user-friendly". It comes with a lot of applications we've featured on WebUpd8 so if you want a ready-to-use Linux distro, you should really try Pinguy OS. I like to call it "Ubuntu after a week of customization" but lately it's getting way past "a week".

Pinguy OS 10.04.2 comes with some of the features from 10.10 that were missing in 10.04 like the Sound Menu applet or the new Ubuntu Software Center. Pinguy OS also comes with a new default application: TeamViewer 6, a popular application for remote control, desktop sharing and file transfer between computers.

Full story: Pinguy OS LTS Update: 10.04.2 [Ubuntu Remaster]

Read more... Comment (0)

Useful Mysql Commands

To login (from unix shell) use -h only if needed.

# [mysql dir]/bin/mysql -h hostname -u root -p

Create a database on the sql server.

mysql> create database [databasename];

List all databases on the sql server.

mysql> show databases;

Switch to a database.

mysql> use [db name];

To see all the tables in the db.

mysql> show tables;

To see database's field formats.

mysql> describe [table name];

To delete a db.

mysql> drop database [database name];

To delete a table.

mysql> drop table [table name];

Show all data in a table.

mysql> SELECT * FROM [table name];

Returns the columns and column information pertaining to the designated table.

mysql> show columns from [table name];

Show certain selected rows with the value "whatever".

mysql> SELECT * FROM [table name] WHERE [field name] = "whatever";

Show all records containing the name "Bob" AND the phone number '3444444'.

mysql> SELECT * FROM [table name] WHERE name = "Bob" AND phone_number = '3444444';

Show all records not containing the name "Bob" AND the phone number '3444444' order by the phone_number field.

mysql> SELECT * FROM [table name] WHERE name != "Bob" AND phone_number = '3444444' order by phone_number;

Show all records starting with the letters 'bob' AND the phone number '3444444'.

mysql> SELECT * FROM [table name] WHERE name like "Bob%" AND phone_number = '3444444';

Show all records starting with the letters 'bob' AND the phone number '3444444' limit to records 1 through 5.

mysql> SELECT * FROM [table name] WHERE name like "Bob%" AND phone_number = '3444444' limit 1,5;

Use a regular expression to find records. Use "REGEXP BINARY" to force case-sensitivity. This finds any record beginning with a.

mysql> SELECT * FROM [table name] WHERE rec RLIKE "^a";

Show unique records.

mysql> SELECT DISTINCT [column name] FROM [table name];

Show selected records sorted in an ascending (asc) or descending (desc).

mysql> SELECT [col1],[col2] FROM [table name] ORDER BY [col2] DESC;

Return number of rows.

mysql> SELECT COUNT(*) FROM [table name];

Sum column.

mysql> SELECT SUM(*) FROM [table name];

Join tables on common columns.

mysql> select lookup.illustrationid, lookup.personid,person.birthday from lookup left join person on lookup.personid=person.personid=statement to join birthday in person table with primary illustration id;

Creating a new user. Login as root. Switch to the MySQL db. Make the user. Update privs.

# mysql -u root -p
mysql> use mysql;
mysql> INSERT INTO user (Host,User,Password) VALUES('%','username',PASSWORD('password'));
mysql> flush privileges;

Change a users password from unix shell.

# [mysql dir]/bin/mysqladmin -u username -h -p password 'new-password'

Change a users password from MySQL prompt. Login as root. Set the password. Update privs.

# mysql -u root -p
mysql> SET PASSWORD FOR 'user'@'hostname' = PASSWORD('passwordhere');
mysql> flush privileges;

Recover a MySQL root password. Stop the MySQL server process. Start again with no grant tables. Login to MySQL as root. Set new password. Exit MySQL and restart MySQL server.

# /etc/init.d/mysql stop
# mysqld_safe --skip-grant-tables &
# mysql -u root
mysql> use mysql;
mysql> update user set password=PASSWORD("newrootpassword") where User='root';
mysql> flush privileges;
mysql> quit
# /etc/init.d/mysql stop
# /etc/init.d/mysql start

Set a root password if there is on root password.

# mysqladmin -u root password newpassword

Update a root password.

# mysqladmin -u root -p oldpassword newpassword

Allow the user "bob" to connect to the server from localhost using the password "passwd". Login as root. Switch to the MySQL db. Give privs. Update privs.

# mysql -u root -p
mysql> use mysql;
mysql> grant usage on *.* to bob@localhost identified by 'passwd';
mysql> flush privileges;

Give user privilages for a db. Login as root. Switch to the MySQL db. Grant privs. Update privs.

# mysql -u root -p
mysql> use mysql;
mysql> INSERT INTO db (Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv) VALUES ('%','databasename','username','Y','Y','Y','Y','Y','N');
mysql> flush privileges;
mysql> grant all privileges on databasename.* to username@localhost;
mysql> flush privileges;

To update info already in a table.

mysql> UPDATE [table name] SET Select_priv = 'Y',Insert_priv = 'Y',Update_priv = 'Y' where [field name] = 'user';

Delete a row(s) from a table.

mysql> DELETE from [table name] where [field name] = 'whatever';

Update database permissions/privilages.

mysql> flush privileges;

Delete a column.

mysql> alter table [table name] drop column [column name];

Add a new column to db.

mysql> alter table [table name] add column [new column name] varchar (20);

Change column name.

mysql> alter table [table name] change [old column name] [new column name] varchar (50);

Make a unique column so you get no dupes.

mysql> alter table [table name] add unique ([column name]);

Make a column bigger.

mysql> alter table [table name] modify [column name] VARCHAR(3);

Delete unique from table.

mysql> alter table [table name] drop index [colmn name];

Load a CSV file into a table.

mysql> LOAD DATA INFILE '/tmp/filename.csv' replace INTO TABLE [table name] FIELDS TERMINATED BY ',' LINES TERMINATED BY ' ' (field1,field2,field3);

Dump all databases for backup. Backup file is sql commands to recreate all db's.

# [mysql dir]/bin/mysqldump -u root -ppassword --opt >/tmp/alldatabases.sql

Dump one database for backup.

# [mysql dir]/bin/mysqldump -u username -ppassword --databases databasename >/tmp/databasename.sql

Dump a table from a database.

# [mysql dir]/bin/mysqldump -c -u username -ppassword databasename tablename > /tmp/databasename.tablename.sql

Restore database (or database table) from backup.

# [mysql dir]/bin/mysql -u username -ppassword databasename < /tmp/databasename.sql

Create Table Example 1.

mysql> CREATE TABLE [table name] (firstname VARCHAR(20), middleinitial VARCHAR(3), lastname VARCHAR(35),suffix VARCHAR(3),officeid VARCHAR(10),userid VARCHAR(15),username VARCHAR(8),email VARCHAR(35),phone VARCHAR(25), groups VARCHAR(15),datestamp DATE,timestamp time,pgpemail VARCHAR(255));

Create Table Example 2.

mysql> create table [table name] (personid int(50) not null auto_increment primary key,firstname varchar(35),middlename varchar(50),lastnamevarchar(50) default 'bato');


FTP file transfer with an automated bash script

This is a really quick blog post, I don't wanna bother you with a complete article related to FTP, this morning I've had to automate a batch job, this job needs to transfer local data to a remote FTP server here's what I've done:


ftp -n -v $HOST << EOT
cd upload
ls -la

The script automatically connects to a remote server "" with a defined username/password pair (remoteusername, remotepasswd) and execute some commands in the middle, in my case :

cd upload
ls -la

but of course you can customize with your own commands

This is not a tech article and not even something cool, just useful as a quick tip for a newbie, hope it helps..



Page 3 of 14

Upcoming Linux Foundation Courses

  1. LFD331 Developing Linux Device Drivers
    25 Aug » 29 Aug - Virtual
  2. LFS422 High Availability Linux Architecture
    08 Sep » 11 Sep - Raleigh, NC
  3. LFS426 Linux Performance Tuning
    08 Sep » 11 Sep - New York

View All Upcoming Courses

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board