Friday, June 17, 2011

Remove service in Debian

Removing Unwanted Startup Files or Services in Debian

Under Debian Linux startup files are stored in /etc/init.d/ directory and symbolic linked between /etc/rcX.d/ directory exists. Debian Linux uses System V initialization scripts to start services at boot time from /etc/rcX.d/ directory. Debian Linux comes with different utilities to remove unwanted startup file:

(A) rcconf

This tool configures system services in connection with system runlevels. It turns on/off services using the scripts in /etc/init.d/. Rcconf works with System-V style runlevel configuration. It is a TUI(Text User Interface) frontend to the update-rc.d command.

Install rcconf in Debian

#apt-get install rcconf

To start rconf, login as root user and type rcconf

# rcconf

Select the service you would like to enable or disable.

(B) sysv-rc-conf

sysv-rc-conf provides a terminal GUI for managing "/etc/rc{runlevel}.d/" symlinks. The interface comes in two different flavors, one that simply allows turning services on or off and another that allows for more fine tuned management of the symlinks. Unlike most runlevel config programs, you can edit startup scripts for any runlevel, not just your current one.

Install sysv-rc-conf in debian

#apt-get install sysv-rc-conf

This will install sysv-rc-conf.Now you need to run the following command

# sysv-rc-conf

Select the service you would like to enable or disable.

Both sysv-rc-conf and rcconf are best tools to use on Remote Debian Linux or when GUI is not available

You can also use update-rc.d script as follows (update-rc.d removes any links in the /etc/rcX.d directories to the script /etc/init.d/service):

# update-rc.d -f {SERVICE-NAME} remove

For example to stop xinetd service you can type command as follows:

# update-rc.d -f xinetd remove

Friday, May 20, 2011

Manage quotas on AIX

Check quotas
quotacheck -vug /data/ecology

To edit User Limit Classes
j2edlimit -u /data/ecology

To assign class three to user 15003 for filesystem Ecology
j2edlimit -a 3 -u 15003 /data/ecology

Check quotas
quotacheck -vug /data/ecology

List quota for user 15003
quota -u 15003

Thursday, September 23, 2010

Fix Kerberos Authentication

authconfig --useshadow --enablemd5 --enablekrb5 --krb5realm=EC.AUCKLAND.AC.NZ --krb5kdc=kerberos.ec.auckland.ac.nz --krb5adminserver=kerberos.ec.auckland.ac.nz --updateall

Wednesday, March 31, 2010

List all files in DataStorage with their sizes

find /data -fstype jfs2 2>/dev/null -type f -exec ls -lau {} \;|awk '{user=$3; group=$4; size=$5; date=$6; month=$7; time=$8; $1=""; $2=""; $3=""; $4="";$5="";$6="";$7="";$8="";print user,group,size,date,month,time,$0}' > file-size-access-2010-03-25

Output is like this:

cogneuro bestgrid 1275692 11 Mar 20:06 /data/cogneuro/Permanent Folder from M Drive/Software/Win_View/Coherence.pdf

To convert to comma delimiter file use in CentOS:

sed -r 's/ /,/;s/ /,/;s/ /,/;s/ /,/;s/ /,/;s/\s+/,/' file-size-access-2010-03-25 > file-size-access-2010-03-25.csv

Thursday, January 28, 2010

NFS connection to VMWare


To connect NFS share to VMWare as a DataStorage
VMkernel Port with external IP should be created and connected to any virtual switch with external NIC connected.

Access Control Lists (ACLs) in AIX

Brian Browning requested to make his share accessible by him and Sharon with new UIDs and from old server with old UID. Old UID was 1016 and group 1000.
New UIDs (341808 and 24713) should have full access to the share.

Commands:

- to see ACL for object:
aclget /data/stat/browning/
output
*
* ACL_type AIXC
*
attributes:
base permissions
owner(1016): rwx
group(1000): ---
others: ---
extended permissions
enabled
permit rwx u:341808
permit rwx u:24713

- to edit ACL
set EDITOE variable:
export EDITOR=/usr/bin/vi
edit ACL:
acledit -v /data/stat/browning/

- to propogate new rights to other objects:
aclget /data/stat/browning/ | aclput -v -R /data/stat/browning/

Monday, November 2, 2009

Sakai Stats

[root@sakai backup]$ cat sakaistat.sh
mysql -pSakaiMySQL sakai -t < /var/backup/sakaistat.sql > /var/backup/sakaistat.txt
mail -s "Sakai usage stats" a.kharuk@auckland.ac.nz < /var/backup/sakaistat.txt

[root@sakai backup]$ cat sakaistat.sql
select "Total Users" as Property, count(user_id) as Amount from SAKAI_USER
union
select "System Users" as Property, count(user_id) as Amount from SAKAI_USER where type='system'
union
select "Registered users with e-mails" as Property, count(user_id) as Amount from SAKAI_USER where email is not null and type='registered'
union
select "Registered users without e-mails" as Property, count(user_id) as Amount from SAKAI_USER where email is null and type='registered'
union
select "Guests with e-mails" as Property, count(user_id) as Amount from SAKAI_USER where email is not null and type='guest'
union
select "Guests without e-mails" as Property, count(user_id) as Amount from SAKAI_USER where email is null and type='guest'
union
select "--------------------------------" as Property, 0 as Amount
union
select "Total sites" as Property, count(site_id) as Amount from SAKAI_SITE
union
select "Total Projects" as Property, count(site_id) as Amount from SAKAI_SITE where type="project"
union
select "Total My Workspaces" as Property, count(site_id) as Amount from SAKAI_SITE where title="My Workspace";

select a.month, ifnull(a.registered_with," ") as reg_email, ifnull(b.registered_without," ") as reg_noemail, ifnull(c.guests," ") as guests, ifnull(d.projects," ") as projects, ifnull(e.workspaces," ") as workspaces from
(select concat(year(createdon), "-", lpad(month(createdon),2,"0")) as month, count(user_id) as registered_with
from SAKAI_USER where type="registered" and email is not null group by year(createdon),month(createdon)) as a
left join
(select concat(year(createdon), "-", lpad(month(createdon),2,"0")) as month, count(user_id) as registered_without
from SAKAI_USER where type="registered" and email is null group by year(createdon),month(createdon)) as b
on a.month=b.month left join
(select concat(year(createdon), "-", lpad(month(createdon),2,"0")) as month, count(user_id) as guests
from SAKAI_USER where type="guest" group by year(createdon),month(createdon)) as c
on a.month=c.month left join
(select concat(year(createdon), "-", lpad(month(createdon),2,"0")) as month, count(site_id) as projects
from SAKAI_SITE where type="project" group by year(createdon),month(createdon)) as d
on a.month=d.month left join
(select concat(year(createdon), "-", lpad(month(createdon),2,"0")) as month, count(site_id) as workspaces
from SAKAI_SITE where title="My workspace" group by year(createdon),month(createdon)) e
on a.month=e.month;

Script file is sakai.bestgrid.org:/var/backup/sakaistat.sql