Archive for March, 2008

Quickzi: How To Change MySQL Root Password

Here is how to change the mysql root password from the Linux command line. Replace “root” with any user name to change any mysql user password.

Change MySQL Password

# /etc/init.d/mysql stop
# mysqld --skip-grant-tables
# mysqladmin -u root password 'newpasswd'
# /etc/init.d/mysql start

Cheers!

Popularity: 6% [?]

Mysqladmin Change Password

Here is a quick tip on how to change mysql password for root using mysqladmin.

Mysqladmin change root password

First, you want to stop the mysql daemon.

# /etc/init.d/mysql stop

Second, issue a command to allow you to change the mysql root password by skipping the tables that grant permissions.

# mysqld --skip-grant-tables

Next, using mysqladmin you can now change the root password

# mysqladmin -u root password 'newpasswd'

That’s it! Now you can start the mysql daemon again.

# /etc/init.d/mysql start

Popularity: 4% [?]

It has been announced that Security-Enhanced Linux (SELinux) will now be available as an alternative security option to AppArmour in Ubuntu 8.04 “Hardy Heron”.

Security-Enhanced Linux (SELinux) is a Linux feature that provides a variety of security policies, including U.S. Department of Defense style mandatory access controls, through the use of Linux Security Modules (LSM) in the Linux kernel.

Here is How to install SELinux on Ubuntu 8.04 taken from the Ubuntu Wiki:

How To Install SELinux on Ubuntu 8.04 “Hardy Heron”

Installing SELinux in Hardy:

  1. Update /etc/apt/sources.list by appending the following:
  2. Update repo:
    • > apt-get update
  3. Install updated packages:
    • > apt-get upgrade
    • These packages have SELinux support patches:
      • libpam0g
      • openssh-server
      • grub
      • login
  4. Install selinux:
    • > apt-get install selinux
    • These packages will be removed:
      • apparmor
      • apparmor-utils
  5. Reboot

If using aptitude instead of apt-get, you will need to manually remove apparmor and apparmor-utils, deselect selinux-policy-dummy, and then choose selinux-policy-refpolicy.

Popularity: 5% [?]

5 Awesome Linux Videos

Take some time to watch the following Linux videos. They are all equally amazing.

Popularity: 4% [?]

10 Linux Commands You Probably Don’t Use

If you are a hard core systems administrator or Linux engineer you’ll probably recognize most of these Linux command line tricks. The following Linux command line tips are not typically used by your everyday Linux user.

Quickly Find a PID with pgrep

pgrep looks through the currently running processes and lists the process IDs which matches the selection criteria to stdout.

pgrep ssh

This will list all PIDs associated with the ssh process.

Execute The Last Executed Command

The heading sounds a bit confusing but it’s exactly what it does.

!!

This will execute the last command you used on the command line.

Execute The Last Command Starting With..

If you want to execute a command a command from history starting with the letter S you can use the following:

!s

This will execute the last command used on the command line that started with s.

Run a Command Repeatedly and Display the Output

watch runs command repeatedly, displaying its output (the first screenfull). This allows you to watch the program output change over time. By default, the program is run every 2 seconds. watch is very similar to tail.

watch -d ls -l

This will watch the current directory for any file changes and highlight the change when it occurs.

Save Quickly in VI/VIM

If you’re in a hurry, you can save and quit the file you’re editing in vi by exiting insert mode, holding shift, and hitting z twice.

Quickly Log Out of a Terminal

You can quickly log out of a terminal session by using: CTRL+D

Navigate to the Last Directory You Were In

cd - will take you to the last directory you were in.

Make Parent Directories the Smart Way

mkdir -p /home/adam/make/all/of/these/directories/ will create all directories as needed even if they do not exist. Why waste time doing something silly like: mkdir make ; cd make ; mkdir all ; cd all ; mkdir of ; cd of … you get the point. Use mkdir -p!

Delete the Entire Line

If you’ve just typed a long string of commands that you don’t need to enter anymore, delete the entire line by using: CTRL+U.

Set the Time stamp of a File

touch -c -t 0801010800 filename.c will show the time stamp as 2008-01-01 8:00. The format is (YYMMDDhhmm).

Can you think of any other Linux commands that are less known to the general Linux community?

Subscribe to my RSS feed here.

Popularity: 35% [?]

Why Doesn’t Linux Market to the Masses?

I’ve always wondered why there has yet to be a Linux distribution that has ventured into a big time marketing campaign for its Linux product. With Mac OSX stealing a lot of Microsoft’s market share due to a great marketing campaign with the “I’m a Mac, I’m a PC” television commercials, why have we yet to see any Linux commercials? Why are there no huge campaigns by big companies like Red Hat, Canonical (Ubuntu), or Novell to get users to switch to their product as an alternative to both Windows and Mac OSX?  I’ve come up with a few reasons why I think Linux doesn’t market to the masses.  If you have anything to add please feel free to leave a comment.

Linux is Free

Lets face it. Linux is a free operating system. With that said, the most obvious question is why would a company like Canonical throw a million dollars at a campaign to get new users to switch from Microsoft Windows or Mac OSX to Ubuntu, when Ubuntu can be obtained for free?

Are Linux Users Too Cheap?

Another question that is worth asking is are Linux users cheap? Linux is free, most of the Linux software available is free, and a good majority of users who use Linux do so for the exact reason that it cost absolutely nothing. This definitely has to have an effect on a large companies motives to market Linux to the masses. Would Linux users actually pay for something? Would investing in a marketing campaign yield profitable results? Today, I can’t see how it would. It’s safe to assume that most large corporations perceive Linux users as too cheap to market to. It’s up to us as Linux users to prove them otherwise. How can we show them we’re a profitable market and boost Linux into a profitable and mainstream shelf product?

Rethinking and Corporate Backing

If Linux ever wants to gain more of a market share in the desktop computer world, we need to rethink how we market to new users. Corporate backing and a strong marketing campaign can bring on a great deal of new users and awareness of an alternative to Windows and Mac OSX. New users and a wider audience can bring a ton of good (and some bad) to the Linux desktop. Linux has done great thus far with word of mouth advertising, but it’s time to push Linux to the mainstream audience with some powerful marketing campaigns.

I’ve asked a lot of questions in this post that I don’t have an answer to. I’d like to hear your input. Please leave a comment.

Subscribe to my RSS feed here.

Popularity: 4% [?]

How To Speed Up Linux

The Wired How-To Wiki has some great tips on how to speed up Linux.

Most of the tips covered in this article involve using the command line and editing system files. Therefore, it goes without saying that you should be fairly comfortable with your command line skills before attempting any of these tweaks. However, if you’re new to Linux, these system tweaks can serve as excellent feet-wetting exercises.

The tips for speeding up Linux are broken down into the following categories:

  • Get Rid of Unnecessary Processes
  • Swap Less Often
  • Speed Up Your Applications
  • Things That Probably Won’t Help

Read more

Popularity: 4% [?]

The Best GIMP Plugins

Techzilo has a great list of the best GIMP Plugins available.

GIMP is the undisputed king of image editing in Linux platforms, and is next only to Photoshop in popularity in Windows and Mac platforms. With a large community of developers and an even larger pool of users, it is no surprise that GIMP is very popular.
Much like Firefox, GIMP’s strength lies in its plugins, which are developed by the open-source toting community. Since the users themselves develop them, they know all the needs and conceive a plugin for everything (well, except making a coffee for you ;) ).

And what better way for me to endorse GIMP than a list of good plugins? Most of them are aimed at web-designers and photographers, the main users of GIMP. There are also some to fix common problems of GIMP.

Web Design

Read more here

Popularity: 10% [?]

We Use Linux Because It’s Fun

Vlad Dolezal from the blog An Amazing Mind has an interesting take on why we use Linux.

 We tell people we use Linux because it’s secure. Or because it’s free, because it’s customizable, because it’s free (the other meaning), because it has excellent community support…

But all of that is just marketing bullshit. We tell that to non-Linuxers because they wouldn’t understand the real reason. And when we say those false reasons enough, we might even start to believe them ourselves.

But deep underneath, the real reason remains.

We use Linux because it’s fun!

It’s fun to tinker with your system. It’s fun to change all the settings, break the system, then have to go to recovery mode to repair it. It’s fun to have over a hundred distros to choose from. It’s fun to use the command line.

Let me say that again. It’s fun to use the command line.

No wonder non-Linuxers wouldn’t understand.

The point with us Linux fans is – we use Linux for it’s own sake. Sure, we like to get work done. Sure, we like to be secure from viruses. Sure, we like to save money. But those are only the side-effects. What we really like is playing with the system, poking around, and discovering completely pointless yet fascinating facts about the OS.

He goes on to list three main reasons Linux is so much fun.

I have to agree with Vlad for the most part.  Linux is fun to tinker with.  The customizable nature of Linux really allows you endless possibilities with how things are laid out and configured.  There are a ton of people out there who change their Linux Desktop theme every week just because they are bored.

Read the rest of the article here

Popularity: 2% [?]

The chage command changes the number of days between password changes and the date of the last password change. This information is used by the system to determine when a user must change his/her password.

Example:

adam@desktop:~$ sudo chage -l adam
Last password change : Mar 02, 2008
Password expires : Apr 11, 2008
Password inactive : never
Account expires : Mar 30, 2009
Minimum number of days between password change : 20
Maximum number of days between password change : 40
Number of days of warning before password expires : 7
adam@desktop:~$

Read the man page of chage here.

Popularity: 4% [?]