Archive

Posts Tagged ‘sysadmin’

Linux: lowercasing the filenames

May 22nd, 2009 bayu No comments

I really hate uppercase when it comes to filenames. It’s really simple to translate words to lowercase using perl’s “tr”.

  my @FILES=`ls /path/to/bignames`;
  foreach my $line (@FILES){
    $line=trim($line);
 
  	if ($line ne "" && $line !~ /^./ && $line =~ /[A-Z]+/) {
  	  my $smalline = $line;
	    $smalline =~ tr/[A-Z]/[a-z]/;
      $out=`mv -v $line $smalline`;
    }

and this is the complete rename-to-lowercase script.

Please read terms of use before downloading the script(s)

Categories: linux Tags: , , , , ,

Linux: system crashes when virtualbox installed above the xen kernel

May 20th, 2009 bayu No comments

I did it in Centos 5.2 and RHEL 5.
see http://www.virtualbox.org/ticket/203

Categories: linux Tags: , , ,

solaris: view attached devices

May 19th, 2009 bayu No comments

I was really miss a great tool to see installed devices in linux, lspci, that I couldn’t find in solaris. Doing some googling-job, i found a similar tool with lspci.. well this one actually can gives me a more detail (or complicated) than lspci. To see them Issue the command:

# prtconf -v

This will give you a very detailed report of devices attached to the machine. don’t use -v (verbose) if you hates the verbosity :)

Confused? Use this cool script to get a more readable output using the prtconf as its stdin (read the note on its header).

Categories: solaris Tags: , ,

solaris: installing sudo in solaris 10 x86

May 4th, 2009 bayu No comments

Download :
ftp://ftp.sunfreeware.com/pub/freeware/intel/10/sudo-1.7.1-sol10-x86-local.gz
ftp://ftp.sunfreeware.com/pub/freeware/intel/10/libiconv-1.11-sol10-x86-local.gz
ftp://ftp.sunfreeware.com/pub/freeware/intel/10/libintl-3.4.0-sol10-x86-local.gz
ftp://ftp.sunfreeware.com/pub/freeware/intel/10/libgcc-3.4.6-sol10-x86-local.gz

Install :

# gzip -d *
# pkgadd -d sudo-1.7.1-sol10-x86-local
# pkgadd -d libiconv-1.11-sol10-x86-local
# pkgadd -d libintl-3.4.0-sol10-x86-local
# pkgadd -d libgcc-3.4.6-sol10-x86-local

Configure:

# vi /usr/local/etc/sudoers

why use sunfreeware.com?

Categories: solaris Tags: , , , ,

solaris: Installing bash 4 on sun solaris 10 x86

May 4th, 2009 bayu No comments
Categories: solaris Tags: , , , , ,

solaris: adding openssh to core solaris installation

May 4th, 2009 bayu No comments

Have you ever confused about how to install a minimal-but-enough installation of solaris OS? Well I had.

It was some time ago I wanted to install Sun Solaris without graphical environment, but I still want some services like ssh and ftp server, and the powerful shell bash. You can always customize the software installation at the installation process, but I found it a bit frustating, because I have to examine the package one-by-one. On the other hand, installing a software by hand from the DVD might takes time to look for the right software since the filename is shortened.

Read more…

Linux: Changing the kernel semaphore setting in linux

May 4th, 2009 bayu No comments

To check shared memory segment, semaphore array, and message queue limits, issue the ipcs -l command.

Modify the kernel parameters by adding the following entries to the default system control configuration file,
/etc/sysctl.conf:
kernel.sem = 250 256000 32 1024
Set the numbers as needed, and the above numbers are respectively :
1.max semaphores per array
2.max semaphores system wide
3.max ops per semop call
4.max number of arrays
where :
max semaphores system wide = max number of arrays x max semaphores/array

Run sysctl with -p parameter to load in sysctl settings from the default file /etc/sysctl.conf.
sysctl -p
The entries from the sysctl.conf file are read during startup by the network initialization script.
On some distributions you may be required to add sysctl -p in one of the system initialization files (for example, rc.local) so that kernel parameters are set after each reboot.

Categories: linux Tags: , , ,

Linux: Fixing a broken grub

May 3rd, 2009 bayu No comments

The grub corrupted or replaced by another boot loader? follow this steps to fix it.

  1. Boot the system using any linux live having grub installed in it.
  2. Under the root user, execute “grub” to access the grub prompt.
  3. Use “find /boot/grub/stage1″ command in the grub prompt to find where the file is. The result should be like (hd0,2), (hd0,0), etc
  4. Use “root (hd0,2)” command, the (h0,2) taken according to the result in 3rd step.
  5. Use “setup (hd0,2)” command to install grub in the partition, or just (hd0) to install it on the Master Boot Record (MBR) of the disk 0.

good luck!

Categories: linux Tags: , , , , ,

Installing MySQL replication in solaris

May 3rd, 2009 bayu No comments

Replication is one of the MySQL technology to replicate the whole database, whether it will be used for load balancing, data backup, or High Availability (need 3rd party software or script to switch the connection).

This post sill show you a step-by-step installation of MySQL in Sun Solaris. I’m using MySQL 5.0.51a in this post, but it is applicable to other versions. First, download the MySQL from http://dev.mysql.com/downloads or your favorite mirror closest to you.

Read more…

Categories: solaris Tags: , , , , , ,

Solaris: disabling DHCP

May 3rd, 2009 bayu No comments

This is how to stop the machine requesting IP address to the DHCP server.

  1. Delete /etc/dhcp.[interface-name] file
  2. Put the hostname inside /etc/hostname.[interface=name]
  3. Put the static IP and hostname inside /etc/hosts
  4. Restart the system
Categories: solaris Tags: , , , ,

Switch to our mobile site