Archive

Archive for the ‘Administration’ Category

Virtual CD/DVD Driver in Ubuntu

June 19th, 2009

Do you want a virtual CD/DVD software like MagicDisc or DAEMON Tools in Windows for your Ubuntu/Linux machine? I can introduce you an acceptable (and free) one: AcetoneISO

AcetoneISO

AcetoneISO, is a feature-rich and complete software application to manage CD/DVD images. Thanks to powerful open source tools such as fuseiso, AcetoneISO will let You mount typical proprietary images formats of the Windows world such as ISO BIN NRG MDF IMG and do plenty of other things.

- From AcetoneISO Homepage

The use of AcetoneISO is pretty easy and much similar to DAEMON Tools. Just give AcetoneISO a try, and save time of burning a CD/DVD :)

P/S: By the way, you can find some interesting information of how to mount a ISO file at UbuntuForums.

Administration, Tips , , , ,

MySQL error 1045 (28000): Access denied for user …

June 16th, 2009

Hello everybody,

Today, my task is configuring a MySQL server to allow connections from remote computers. The problem I has met is that although port 3306 on the router was already opened, users from internet still could not connect to my MySQL Server. Here is my error message:

tuyent@local:~$ mysql -u tuyent -p -h remote-computer
Enter password: 
ERROR 1045 (28000): Access denied for user 'tuyent'@'local' (using password: YES)

Well, here is my solution:
- Step 1: Double check that the port 3306 is already opened.
- Step 2: Open MySQL configuration file (/etc/mysql/my.cnf), comment the line

# bind-address            = 127.0.0.1

- Step 3: Restart the MySQL server

$ sudo /etc/init.d/mysql restart

- Step 4: Go to mysql command line and grant permission for user

mysql> grant all on *.* to 'tuyent'@'%' identified by 'password';
mysql> grant all on *.* to 'tuyent'@'localhost' identified by 'password';
mysql> flush privileges;

Note: Remember to grant permission on both from localhost and from anywhere (’%’ indicator), and flush all privileges.

Works fine for me :)

Administration, Coding , , , , ,

Backing Up and Restoring MySQL Database with MySQL Commands

June 15th, 2009

Original post from: devshed.com

Do you need to change your web host or switch your database server? This is probably the only time when you really think of backing up your MySQL data. If you’ve got a website with a database or your custom database running for your applications, it is imperative that you make regular backups of the database.

The easiest way to backup your database would be to telnet to the your database server machine and use the mysqldump command to dump your whole database to a backup file.

Playing with mysqldump

If you have either a shell or telnet access to your database server, you can backup the database using mysqldump. By default, the output of the command will dump the contents of the database in SQL statements to your console. This output can then be piped or redirected to any location you want. If you plan to backup your database, you can pipe the output to a sql file, which will contain the SQL statements to recreate and populate the database tables when you wish to restore your database. There are more adventurous ways to use the output of mysqldump.

A Simple Database Backup:

You can use mysqldump to create a simple backup of your database using the following syntax.

mysqldump -u [username] -p [password] [databasename] > [backupfile.sql]
  • [username] – this is your database username
  • [password] – this is the password for your database
  • [databasename] – the name of your database
  • [backupfile.sql] – the file to which the backup should be written.

The resultant dump file will contain all the SQL statements needed to create the table and populate the table in a new database server. To backup your database ‘Customers’ with the username ’sadmin’ and password ‘pass21′ to a file custback.sql, you would issue the command:

mysqldump -u sadmin -p pass21 Customers > custback.sql

You can also ask mysqldump to add a drop table command before every create command by using the option –add-drop-table. This option is useful if you would like to create a backup file which can rewrite an existing database without having to delete the older database manually first.

mysqldump --add-drop-table -u sadmin -p pass21 Customers > custback.sql

Backing up only specified tables

If you’d like restrict the backup to only certain tables of your database, you can also specify the tables you want to backup. Let’s say that you want to backup only customer_master & customer_details from the Customers database, you do that by issuing

mysqldump --add-drop-table -u sadmin -p pass21 Customers customer_master customer_details > custback.sql

So the syntax for the command to issue is:

mysqldump -u [username] -p [password] [databasename] [table1 table2 ....]
  • [tables] – This is a list of tables to backup. Each table is separated by a space.

Read more…

Administration, Coding , , ,

Linux Remote Desktop For Controlling Windows (rdesktop)

June 15th, 2009

I am responsible for couple of windows servers and windows xp workstations too. When I work from home, I need a way to get into Windows XP/2000/Vista/2003 server for work.

rdesktop

Since I have Debain Linux at home, I needed a way to login into Microsoft windows desktop from Linux OS. Many of us working at tech support use rdesktop to connect to customers’ windows XP box.

Especially it is very useful to configure Outlook or something else when customers do not understand how to configure or troubleshoot problem. This is the best way to fix a problem.

Fortunately, Linux has rdesktop utility. It is a client for remote desktop protocol (RDP), used in a number of Microsoft products including Windows NT Terminal Server, Windows 2000 Server, Windows XP and Windows 2003 Server. You do not need to install VNC server. All you need is rdesktop client on Linux or BSD workstation.

Install rdesktop

$ sudo apt-get install rdesktop

Connect to MS Windows 2000/2003 server from Linux, type the following command at a shell prompt (connect to Windows server called mw2sn100.mycorp.com)

$ rdesktop mw2sn100.mycorp.com

Or connect to windows XP/Vista workstation having IP 192.168.1.17:

$ rdesktop 192.168.1.17

Please note that you must first enable remote desktop connection under Windows Server/XP.

* Go to Windows XP Desktop
* Right Click on My Computer
* Select properties
* Select Remote tab
* Enable Remote desktop.
* Save the changes.

Make sure enterprise firewall allows incoming connection on TCP port 3389. rdesktop supports many other options, see man page of rdesktop or visit main website of rdesktop for more information.

Original Post from: cyberciti.biz

Administration , , , ,

SSH Tunnel + SOCKS Proxy Forwarding = Secure Browsing

June 15th, 2009

When you are at the coffee shop, or at a conference, and you are not sure that you want to send all your data over the wi-fi network in plaintext, you want a secure tunnel to browse. This happened to me recently and I stumbled across a neat feature of OpenSSH (the ssh client on everyone’s computer). The wonders of ssh never cease to amaze me!

You can use the “-D” flag of openssh to create a SOCKS proxy.

The command first:

$ ssh -D 9999 username@ip-address-of-ssh-server

This of course connects you to the server specified by “ip-address-of-ssh-server”. Needless to say, you (username) must have an ssh account on the server. In addition, this will create a SOCKS proxy on port “9999″ of your computer. This is a tunnel to the server. Now all you have to do is set the preference in Firefox to use a SOCKS proxy. The proxy is, of course, “localhost”, with the port 9999.

Now when you browse, all the connections you make to websites will seem to originate from the server to which you SSH-ed. In addition, all outgoing and incoming data for the browsing session will be encrypted since it passes through the SSH connection.

Source: Ubuntu Blog

Administration , , ,

Host multiple sites on IIS 7 and Windows Server 2008

May 10th, 2009

Hi there, this is how i host multiple web sites on my Windows Server Machine, using IIS 7.

Step 1: Edit hosts file to add fake names

  • Open file “C:\Windows\System32\drivers\etc\hosts” by your favourite text processor. Remember that only Administrator have the right to edit this file. You can choose “Run as Administrator” when running text processor if you log in to the other users rather than Administrator.
  • Go to the last line of “hosts” file and insert this line:
    127.0.0.1 yourdomain.com
    hosts
  • Test the hosts file by going to cmd and ping yourdomain.com. If the reply is from loopback address, you have done this step.
    ping

Step 2: IIS 7 Configuration

  • Create new Web Site with these following parameters:
    newwebstite

Step 3: Configure your domain’s DNS

  • Point @ address to your server’s IP.

Step 4: Congratulations, enjoy your website ;)

Administration , , ,