Un-TAR multiple .tgz (or tar.gz/tar) files at once!

Lost your MySQL root password?

Found this on www.mysql.com (here: http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html)

In a Unix environment, the procedure for resetting the root password is as follows:

  1. Log on to your system as either the Unix root user or as the same user that the mysqld server runs as.
  2. Locate the .pid file that contains the server’s process ID. The exact location and name of this file depend on your distribution, hostname, and configuration. Common locations are /var/lib/mysql/, /var/run/mysqld/, and /usr/local/mysql/data/. Generally, the filename has the extension of .pid and begins with either mysqld or your system’s hostname.You can stop the MySQL server by sending a normal kill (not kill -9) to the mysqld process, using the pathname of the .pid file in the following command:
    shell> kill `cat /mysql-data-directory/host_name.pid`

    Note the use of backticks rather than forward quotes with the cat command; these cause the output of cat to be substituted into the kill command.

  3. Create a text file and place the following command within it on a single line:
    SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPassword');

    Save the file with any name. For this example the file will be ~/mysql-init.

  4. Restart the MySQL server with the special --init-file=~/mysql-init option:
    shell> mysqld_safe --init-file=~/mysql-init &

    The contents of the init-file are executed at server startup, changing the root password. After the server has started successfully you should delete ~/mysql-init.

  5. You should be able to connect using the new password.

Alternatively, on any platform, you can set the new password using the mysql client(but this approach is less secure):

  1. Stop mysqld and restart it with the --skip-grant-tables --user=root options (Windows users omit the --user=root portion).
  2. Connect to the mysqld server with this command:
    shell> mysql -u root
  3. Issue the following statements in the mysql client:
    mysql> UPDATE mysql.user SET Password=PASSWORD('newpwd')
            	WHERE User='root'; mysql> FLUSH PRIVILEGES;
  4. Replace “newpwd” with the actual root password that you want to use.
  5. You should be able to connect using the new password.

Smart Array 532 with VMware ESX 2.5.3

Problem encountered with a HP Smart Array 532 controller with VMware ESX 2.5.3 when installed in an already configured server.
The controller was found by the service console, but not configured in modules.conf and vmmodules.conf.

* Installed an additional RAID controller.
* LSPCI found the controller, but no disks showed in VM Manager.
* Ran KUDZU and found the controller, but still no luck in VM Manager.
* Added a new CCISS in /etc/modules.conf and in /etc/vmware/vmmodules.conf.
* Rebooted the server and was able to use the added disk.

Experiments with Linux, VMware Workstation and a virtual workstation.

Install log for my Ubuntu server on a HP Compaq nc6220.

Why?

– My reason for installing a minimal version of linux on my laptop is to use it as a base for running VMware Workstation with my other workrelated stuff on. This way I can use cloning, non-persistent disks and other nice features of VMware to keep my work-images nice and tidy.

The plan.1.

Install minimal version of linux dist (as it turns out it is an Ubuntu server
without any services/daemons running).
2. Install XServer (Xorg).
3. Install a small window manager (Fluxbox)
 – I will also install a Mozilla Firefox. I may need a browser..
4. Install VMWare Workstation.
5. Get USB automount to work (I have a few VM’s on an external USB drive).

The Hardware.

I have a HP Compaq nc6220 as a work laptop. It is a pretty lousy piece of hardware and I have had a bunch of problems with it in Windows. It has an Intel Graphics chip (i915) that share RAM. Not good! It has 2 GB of RAM and a 80 GB harddrive. There is a gigabit LAN card and a wireless 802.11b/g card for networking and bluetooth support.

How did I do?

1. Install Ubuntu Server.

So, I downloaded the server version of Ubuntu Efty(?) with kernel version 2.6.17-10-server and installed from a CDROM. No problems encountered. I was asked which NIC I wanted to use as default and my choice is the gigabit card.

Since this is a test I’d like to keep my existing installation of windows on one partition and give the new Ubuntu install another partition. The installer was very helpful and even allowed me to change my windows partition size (which I didn’t so I don’t know if it actually work).

When asked if I wanted to install LAMP or DNS I answered NO. I want this to be a lightweight background system without any burdens I don’t really need. Installatin finished, reboot. NICE black screen with white text. Logon TADA!!

2. Install Xserver.

Since I will run VMware Workstation on the machine (not VMware server) I must have a graphical interface to be able to interact with my VM’s. My choice is the Xorg Xserver and it installed without any problems. I used the available i815 graphic chip in the config and it seems to work just fine.

3. Install small windows manager.

I choose Fluxbox since I’m allready familiar with it and it has a decently small fingerprint on hardware resources.
apt-get install fluxbox (and a few helper apps like fluxconf etc). No problems.

Then I installed the Mozilla-Firefox web browser. Not entirely necessary, but if I know me I will need to use the web from this install to troubleshoot this or that.

4. Install VMware Workstation

Then I downloaded vmware workstation 5.5.3 (see, I knew I’d need firefox for something!), unpacked and ran sudo ./vmware-install.pl

Followed instructions and also ran the config script. I let it configure NAT’ed network and internal network and voila! I’m up and running VMware. Nice!

5. Automount USB drives.

Now, this is not fully working yet. My drive is recognized and I can mount it manually (mount -t ntfs /dev/sda1 /media/usb1 (yes,
I know, ntfs won’t do later on. Have to change that)), but I cant access it as a normal user. No problem to play with stuff as root (sudo), but as my normal user I get permission denied.

Tried “chmod 777 /media/usb1” and that makes the folder accessible. But as soon as I mount the drive the permissions are changed.

OK, I found a tip on a web-page stating that this line in /etc/fstab would do the trick:

/dev/sda1       /media/usb1     ntfs nls=utf8,umask=0222    0       0

and it did. My problem is off course NTFS. Now, I don’t think that I will use fstab for this, but I guess that I can mount a drive with UMASK functionality. Some more searching to do..
Installation done! What now?

Well, I installed a Windows XP Pro in a VM from a CD and it worked lika a charm. I even got the lousy windows theme playing through registration/setup. A few things to do with the virtual machine though; install vmware tools for one, patch, patch, patch..

Stuff that needed mending:

1. Graphics resolution was not right. I choose 1400*1050 in xorg.conf but the resolution became 1280*1024. Not very good on a screen optimized for 1400*1050.

apt-get install 915Resolution (install software)
915Resolution -l (check bios resolutions)
nano -w /etc/default/915resolution. Enter your preffered resolution.