August 2015
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Categories

August 2015
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Clear contents of a file in UNIX

Clear contents of a file in UNIX

$cat /dev/null > file

or

$true > file

AIX : Machine Type & Serial Number

AIX : Machine Type & Serial Number

uname -m for the serial number

uname -M for the machine type and model

Viewing file systems that 90% and more using awk & sed

This works with AIX

df -g | egrep -v “Filesystem|proc|tmp” | sed ‘s/\%//’ | awk ‘$4 >= 90 {print $4 “%\t” $7}’

df -k | sed 1d | awk ‘$4>90 {print}’

This works with Solaris and Linux

df -k | egrep -v “proc|fd|cdrom|mnttab|run|tmp|Filesystem” | sed ‘s/\%//’ | awk ‘$5 >= 90 {print $5 “%\t” $6}’

Configure ipfilter on Solaris10 as a host based firewall

1- Start by check ipfilter status if it’s running you can go ahead and configure rules

-bash-3.00$ svcs -a|grep -i ipfil online 10:29:37 svc:/network/ipfilter:default

if it’s disabled enable it

#svcadm enable ipfilter

2- Display rules

#bash-3.00ipfstat -io block out all pass out quick on lo0 all pass out quick on eri0 proto tcp/udp from […]

Clear DNS cache solaris

Clear DNS cache You can clear DNS cache in Solaris by doing the following

#/etc/init.d/nscd stop #/etc/init.d/nscd start

List PID’s for processes listening on ports solaris

List PID’s for processes listening on ports To list PID’s for processes listening on ports

#pfiles `ptree | awk ‘{print $1}’` | egrep ‘^[0-9]|port:’

disable the inetd service

Symptoms

Repeated attempts by unprivileged users to stop the inetd server may transition the inetd service to the “maintenance” state, thereby moving all internet services managed by inetd(1M) to the “offline” state.

To determine the state of the inetd service, the following command can be run:

$ svcs inetd STATE STIME FMRI maintenance 12:00:23 svc:/network/inetd:default […]

install ssh client on Centos

install ssh client on Centos

To install openssh on a CentOS:

yum install openssh

 

And if you want to install the client (ssh command) you have to run:

yum install openssh-clients

install dig, host, and nslookup – bind-utils on CentOS

if you want to use on of the linux commands:

dig, host or nslookup on a CentOS machine and you get the error message:

-bash: nslookup: command not found

you have to install the bind-utils package.

Just run the command:

yum install bind-utils

Solaris 10 – create an init script

First of all, we need to understand the procedure of the boot in Solaris. Next, follows a description of the boot sequence in Solaris.

Overview of the boot sequence in Solaris When Solaris boots up, it runs “init”. “init” looks in /etc/inittab to find out what runlevel it needs to boot into On Solaris, this […]