Disabling unneeded services in CentOS

Found this great blog article about disabling unneeded Services, here is a brief over view of the services you can disable on a server Checking what services are running (run this as root). chkconfig --list | grep on Turning off the services chkconfig --level 0123456 <Service Name> off Services Safe to turn off on a server isdn gpm pcmcia sendmail Reference Source http://prefetch.

Read more

Share

Creating an account in ALOM on a T2000

Get into ALOM (from console for ‘#.’ minus quotes) to add the user run the following ‘useradd ’ To assign a password this account run ‘userpassword ’ Assigning permissions to the user account ‘userperm [a|u|c|r]’ e.g. full permissions would be ‘userperm aucr’ Permission Level Description

Read more

Share

Adding NTFS Support into Centos and Fedora Core

Here are some useful link which i used to get my external harddisk mounted to to the systems for backing data up. CentOs - http://wiki.centos.org/TipsAndTricks/NTFSPartitions yum install fuse fuse-ntfs-3g dkms dkms-fuse Install NTFS driver for Fedora With repositories like Fedora Extras it’s now very easy to add NTFS support to Fedora: # yum -y install ntfs-3g Then you can simply mount NTFS file systems using the option -t ntfs-3g. You can find more detailed information about this driver at http://www.

Read more

Share

Finding out how many physical CPU's you have in a SUN Box

When running ‘psrinfo’ on a T2000 it will display all of the cores as CPU’s. Runing ‘psrinfo -p’ will display only the physical CPU’s. Example # psrinfo 0 on-line since 02/20/2007 00:48:07 1 on-line since 02/20/2007 00:48:08 2 on-line since 02/20/2007 00:48:08 3 on-line since 02/20/2007 00:48:08 4 on-line since 02/20/2007 00:48:08 5 on-line since 02/20/2007 00:48:08 6 on-line since 02/20/2007 00:48:08 7 on-line since 02/20/2007 00:48:08 8 on-line since 02/20/2007 00:48:08 9 on-line since 02/20/2007 00:48:08 10 on-line since 02/20/2007 00:48:08 11 on-line since 02/20/2007 00:48:08 12 on-line since 02/20/2007 00:48:08 13 on-line since 02/20/2007 00:48:08 14 on-line since 02/20/2007 00:48:08 15 on-line since 02/20/2007 00:48:08 16 on-line since 02/20/2007 00:48:08 17 on-line since 02/20/2007 00:48:08 18 on-line since 02/20/2007 00:48:08 19 on-line since 02/20/2007 00:48:08 20 on-line since 02/20/2007 00:48:08 21 on-line since 02/20/2007 00:48:08 22 on-line since 02/20/2007 00:48:08 23 on-line since 02/20/2007 00:48:08 24 on-line since 02/20/2007 00:48:08 25 on-line since 02/20/2007 00:48:08 26 on-line since 02/20/2007 00:48:08 27 on-line since 02/20/2007 00:48:08 28 on-line since 02/20/2007 00:48:08 29 on-line since 02/20/2007 00:48:08 30 on-line since 02/20/2007 00:48:08 31 on-line since 02/20/2007 00:48:08 # psrinfo -p 1

Read more

Share

Displaying yesterdays date in solaris

Sounds like a daft thing to do i know but for a couple of my scripts this is needed # echo `TZ=GMT+24 date +"%D"` This method doesnt always work, depends on what time of day you call this. I have also found a perl method of doing this as well # perl -e '($d,$m,$y)=(localtime(time-86400))[3..5];$m+=1;$y+=1900;print "$m/$d/$yn";'

Read more

Share

Mod Rewrite rule to block certain user agents

Code RewriteCond %{HTTP_USER_AGENT} (.*)iOpus-I-M(.*) [NC] RewriteRule .* - [F] Note iOpus-I-M is a use agent for a load test application which could be use for eating your bandwidth

Read more

Share

How to enable SNMP with a JVM

This is useful to do when you are wishing to monitor the Memory allocation with in your java application. HowTo Add the following to JVM_OPTS -Dcom.sun.management.config.file=/export/home/pcanham/jvmsnmp/management.properties Contents of management.properties is com.sun.management.snmp.interface=0.0.0.0 com.sun.management.snmp.port=1161 com.sun.management.snmp.trap=1162 com.sun.management.snmp.acl=false If wishing ACL create a file called snmp.acl and the change ‘com.sun.management.snmp.acl=false’ to ‘com.sun.management.snmp.acl=snmp.acl’ Make sure only owner has read and write access nobody and group are not allowed any access -rw------- 1 pcanham other 356 Aug 8 16:01 snmp.

Read more

Share

Blocking Users in Sendmail

Instructions Go to ‘/etc/mail’ Put a line in ‘/etc/mail/access’ along the lines of ‘email address DISCARD’ Update table ‘makemap hash access.db < access’ Example Browse to folder cd /etc/mail Edit access vi access # joebloggs@example.com - email address being blocked # due to being invalid joebloggs@example.com DISCARD Update table makemap hash access.db < access

Read more

Share

Solaris Package Tips

View the files that make up a Solaris package /usr/sbin/pkgchk -l SUNWcsr | grep Pathname | sed 's/Pathname: (.*)/1/' Check which package a file belongs to /usr/sbin/pkgchk -lp somefile

Read more

Share

Displaying EPOCH Date in Solaris

Solaris 10 #!/bin/sh /usr/bin/truss /usr/bin/date 2>&1 | nawk -F= '/^time()/ {gsub(/ /,"",$2);print $2}' exit $? Solaris 9 and below /usr/bin/perl -e 'printf "%dn", time;'

Read more

Share