Archive

Archive for the ‘Linux’ Category

Basic System admin Tips in Debian

December 15, 2011 Leave a comment

How to change Log in message.(MOTD-Message of The Day)

sudo vim /etc/motd

 If you want to avoid /etc/motd to be overwritten with the old version upon reboot you also have to edit the following

sudo vim /etc/default/rcS

in this file change the EDITMOTD “yes” to “no”

Changing the computer name

sudo vim /etc/hostname

Categories: Sys Admin Tags: , ,

Recover MySQL root Password

August 6, 2010 Leave a comment

You Can Recover MySql database root password easily by following steps

Step 1: Stop MySql Service

# /etc/init.d/mysql stop

You will see:

Stopping MySql database server: mysqld

Step 2: Start MySql With Out Password

# mysqld_safe –skip-grany-tables &

You Will See:

[1] 5988

Starting mysqld daemon with databases from /var/lib/mysql

mysqld_safe[6025]: started

Step 3: Connect to mysql server using mysql client

# mysql -u root

You Will See:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.15-Debian_1-log

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql>

Step 4: Setup New MySql root user Password

mysql> use mysql;
mysql> update user set password=PASSWORD(“NEW-ROOT-PASSWORD”) where User=’root’;
mysql> flush privileges;
mysql> quit

Step 5: Stop MySql Server

# /etc/init.d/mysql stop

You Will See:

Stopping MySQL database server: mysqld
STOPPING server from pid file /var/run/mysqld/mysqld.pid
mysqld_safe[6186]: ended

[1]+  Done                    mysqld_safe –skip-grant-tables

Step 6: Stop MySql Server and Login as root

# /etc/init.d/mysql start
# mysql -u root -p


Categories: Linux, MySql Tags: , , ,

Setup easy web development environment (XAMPP)

May 7, 2009 Leave a comment

This is a how-to for setting up a web development environment easily. This guide will install the XAMPP lampp stack into /opt, setup an easy way to start it up and shut it down, and link a folder in your home directory to the webserver.

WARNING
This guide is aimed at a development environment only and should not be used as a public webserver. To setup a public webserver follow the directions on the Ubuntu wiki https://help.ubuntu.com/community/ApacheMySQLPHP

As this is Ubuntu, all the major parts of a typical web server are included (in the main repo, or on the Ubuntu Server CD) and this is a great way to setup a server. The ubuntu developers have prepared a great web server and have made the process as seemless as possible.

But what if even the official way is still to complicated? What if you just want a quick web server for development?

Fortunately there is the XAMPP project: http://www.apachefriends.org/en/xampp.html. The XAMPP project bundles Apache, PHP4 & 5, Perl, mySQL, and a bunch of other utilities/applications into an simple package for Mac OSX, Windows, Solaris, and Linux. Obviously this HOWTO only deals with the linux version.

For those of you with already existing Apache/mySQL/php installations it installs everything into /opt so it doesn’t conflict with any other installation, and it is completely setup and ready to run.

Install XAMPP

Two easy steps:

  1. Download the most recent version of XAMPP: (at time of writing 1.5.3a)
    http://prdownloads.sourceforge.net/x…ar.gz?download
    (Source URL: http://www.apachefriends.org/en/xampp-linux.html#374)
  2. Extract the archive to /opt using sudo: (make sure you are in the directory that you downloaded the archive to)
    Code:
    sudo tar xvfz xampp-linux-1.5.3a.tar.gz -C /opt

Start XAMPP

To start it up, open a terminal and type this:

Code:
sudo /opt/lampp/lampp start

Stop XAMPP

To stop it, open a terminal and type this:

Code:
sudo /opt/lampp/lampp stop

Additional XAMPP commands

To see additional commands, open a terminal and type this:

Code:
sudo /opt/lampp/lampp

Sweet XAMPP Control Panel

To use the sweet gtk/python control panel:

Run in a terminal:

Code:
gedit ~/.local/share/applications/xampp-control-panel.desktop

Paste the following into the open file and save and exit.

Code:
[Desktop Entry]
Comment=Start/Stop XAMPP
Name=XAMPP Control Panel
Exec=gksudo "python /opt/lampp/share/xampp-control-panel/xampp-control-panel.py"
Icon[en_CA]=/usr/share/icons/Tango/scalable/devices/network-wired.svg
Encoding=UTF-8
Terminal=false
Name[en_CA]=XAMPP Control Panel
Comment[en_CA]=Start/Stop XAMPP
Type=Application
Icon=/usr/share/icons/Tango/scalable/devices/network-wired.svg

“XAMPP Control Panel” will show up in your applications menu under Internet. Use the Alacarte Menu Editor to move it around.

Test to see if XAMPP is running

Once XAMPP is up and running open firefox and go to: http://localhost/

You should see the XAMPP test page:

Location of files and uploading

XAMPP by default uses /opt/lampp/htdocs as the root web directory. The easiest way to start working on files is to link a folder in your home directory into this directory.
My user name is peter so I have /home/peter/public_html linked to /opt/lampp/htdocs/peter. So if I navigate to http://localhost/peter/ I get a listing of all the files/folders in that directory. (As long is there isn’t a index.php/html/etc file)
To set this up, run in a terminal:

  1. Make public_html directory in home directory:
    Code:
    mkdir ~/public_html
  2. Link to /opt/lampp/htdocs
    Code:
    sudo ln -s ~/public_html /opt/lampp/htdocs/$USER

Now any files and folders you place in ~/public_html will be published to your personal webserver.

Bookmark http://localhost/username to make this easy to access.

WARNING – SECURITY
http://www.apachefriends.org/en/xampp-linux.html#381
Open holes:

  1. The MySQL administrator (root) has no password.
  2. The MySQL daemon is accessible via network.
  3. ProFTPD uses the password “lampp” for user “nobody”.
  4. PhpMyAdmin is accessible via network.
  5. Examples are accessible via network.
  6. MySQL and Apache running under the same user (nobody).

This doesn’t leave your whole system wide open, but someone could hack your XAMPP installation, so be wary.
To fix most of the security weaknesses open a terminal and run:

Code:
sudo /opt/lampp/lampp security

Ten Major Differences in Linux and Windows

May 27, 2008 1 comment

  1. Reduces the risk of carpal tunnel syndrome
  2. When linux is properly installed, there no longer a need to use the mouse. Chances of you using a mouse is close to zero.

  3. Use the extra cash for rewards
  4. Linux is 100% free while Windows Vista Ultimate costs $398.99 at the time of writing. Companies that pay a licensing annually could have used the money for other things like buying an additional server to reduce the load or even give a bigger bonus to its loyal employees.

  5. Formats are free, freedom is preserved
  6. Linux file formats can be accessed in a variety of ways because they are free. Windows on the other hand makes you lock your own data in secret formats that can only be accessed with tools leased to you at the vendor’s price. “What we will get with Microsoft is a three-year lease on a health record we need to keep for 100 years”

  7. Zero risk in violating license agreements
  8. Linux is open source so you are unlikely to violate any license agreement. All the software is happily yours. With MS Windows you likely already violate all kinds of licenses and you could be pronounced a computer pirate if only a smart lawyer was after you. The worldwide PC software piracy rate for 2004 is at 35%. Which means that 3 out of 10 people are likely to get into real trouble.

  9. Transparent vs Proprietary
  10. MS Windows is based on DOS, Linux is based on UNIX. MS Windows Graphical User Interface (GUI) is based on Microsoft-own marketing-driven specifications. Linux GUI is based on industry-standard network-transparent X-Windows.

  11. Better network, processing capabilities
  12. Linux beats Windows hands down on network features, as a development platform, in data processing capabilities, and as a scientific workstation. MS Windows desktop has a more polished appearance, simple general business applications, and many more games for kids (less intellectual games compared to linux’s).

  13. Customizable
  14. Linux is customizable in a way that Windows is not. For example, NASlite is a version of Linux that runs off a single floppy disk and converts an old computer into a file server. This ultra small edition of Linux is capable of networking, file sharing and being a web server.

  15. Flexibility
  16. Windows must boot from a primary partition. Linux can boot from either a primary partition or a logical partition inside an extended partition. Windows must boot from the first hard disk. Linux can boot from any hard disk in the computer.

  17. Mobility
  18. Windows allows programs to store user information (files and settings) anywhere. This makes it impossibly hard to backup user data files and settings and to switch to a new computer. In contrast, Linux stores all user data in the home directory making it much easier to migrate from an old computer to a new one. If home directories are segregated in their own partition, you can even upgrade from one version of Linux to another without having to migrate user data and settings.

  19. Proven Security
  20. Why isn’t Linux affected by viruses? Simply because its code has been open source for more than a decade, tested by people all around the world, and not by a single development team like in the case of Windows. This leads to a lightning fast finding and fixing for exploitable holes in Linux. So that my friends, proves Linux as having an extremely enhanced security and lesser chances of exploits compared to Windows.

Categories: Linux Vs Windows Tags: ,

What is Linux And what Linux Have?

May 27, 2008 2 comments

Linux is the name usually given to any Unix-like computer operating system that uses the Linux Kernel. Linux is one of the most prominent examples of free software and open source development. Source code can be freely modified, used, and redistributed by anyone.

The system’s utilities and libraries usually come from the GNU operating system, announced in 1983 by Richard Stallman.

The nameLinux comes from the Linux kernel, started in 1991 by Linus Torvalds.

The GNU contribution is the basis for the alternative name GNU/Linux.

Predominantly known for its use in servers, Linux is supported by corporations such as Dell, Hewlett-Packard, IBM, Novell, Oracle Corporation, Red Hat, and Sun Microsystems.

It is used as an operating system for a wide variety of computer hardware, including desktop computers, supercomputers, E-book readers, video game systems such as the PlayStation 2 and PlayStation 3, several arcade games, and embedded devices such as mobile phones and routers.

%d bloggers like this: