Showing posts with label unix. Show all posts
Showing posts with label unix. Show all posts

Friday, November 23, 2007

::locate database error::

$ locate
locate: database too small: /var/db/locate.database

solution:

cd to /etc/periodic/weekly
and then:

$ ./310.locate

it should build up the database now

::freebsd - updating ports::

portsnap fetch
portsnap extract
portsnap fetch update

Monday, October 15, 2007

::colorful bash::

colorful bash tricks

if you wish to add color to your bash, e.g during listing files in a directory using ls, use this tricks

$ export CLICOLOR="yes"

and if you wish to make colorful bash as default for all users in shell, edit /etc/profiles and add the above line inside

Sunday, October 14, 2007

::fping::

fping

use fping to ping a set of IP ranges or simply to resolve the IP to hostname
Linux - fping (a program to hosts in parallel)
download: fping

Basic usage:
$ fping -s -g -d 72.20.25.185 72.20.25.190 -r 1

results:

security.org.au is alive
your.on.ugly-people.org is alive
put.your.pix.up.on.ugly-people.org is unreachable
Bush.can.save-teh.US is unreachable
is.here.to.save-teh.US is unreachable
highly.p0ision.us is unreachable

6 targets
2 alive
4 unreachable
0 unknown addresses

24 timeouts (waiting for response)
24 ICMP Echos sent
2 ICMP Echo Replies received
0 other ICMP received

0.00 ms (min round trip time)
0.00 ms (avg round trip time)
0.00 ms (max round trip time)
4.268 sec (elapsed real time)

for more usage refer to "man fping" or linuxscrew.com

one good tools for Windows with the same functions is Angry IP scanner
download: angryziber.com

Saturday, October 13, 2007

::change user informations::

how to change user informations (finger) such as:

Shell:
Full Name:
Office Location:
Office Phone:
Home Phone:
Other information:

this can be done using command: chfn

Sunday, September 2, 2007

::crontab for psybnc::

sometimes the psybnc process killed or crashed, so if you're not around you'll not be able to run your psybnc without defining cronjob

there's a file in your psybnc folder called psybncchk to check that your psybnc is running and if it is not running, the crontab will initialize the process again

crontab for psybnc 2.3.2-7

1. edit the psybncchk file:
---
#!/bin/sh
# This is the crontab script for psybnc.
#
# Please change the following path to your psybnc-directory.

PSYBNCPATH=/path-to-your/psybnc

# the rest should be kept as is

if test -r $PSYBNCPATH/psybnc.pid; then
PSYPID=$(cat $PSYBNCPATH/psybnc.pid)
if $(kill -CHLD $PSYPID >/dev/null 2>&1)
then
exit 0
fi
fi
cd $PSYBNCPATH
./psybnc &>/dev/null
---

2. chmod 700 psybncchk
#this will change permission to the psybncchk file

3. then define the crontab using command: crontab -e
0,10,20,30,40,50 * * * * /path-to-your/psybnc/psybncchk >/dev/null 2>&1

#to list your cronjob, check using crontab -l

http://pastebin.ca/678613

::changing default editor::

#default editor in UNIX/Linux is usually vi, but you can change the default editor to pico/nano/vim using this command:

export EDITOR=pico
#or
export EDITOR=nano
#or
export EDITOR=vim

#you may then edit your crontab using your preferred editor
crontab -e

// stats


afraid.org / freedns.afraid.org