Archive for Unix

bind dhcpd to single interface

In this example I will how you how to force dhcpd to bind to a individual interface, or multiple interfaces.  I am using Debian 5 in this example.

From /etc/init.d/dhcp3-server

You will notice this variable $INTERFACES is refrenced but never used anwhere else.  It is there for you to tell dhcpd which interface to listen on.  You can also add in multiple interfaces there, separated by a space.

INTERFACES=”eth1″

Comments

Unix – Delete special charaters by inode

Here we see that we have a back slash created by mistake.

user:/var/www/core# ls -l
total 56
-rw-r–r– 1 root     root      213 2009-06-01 07:14 \
-rw-r–r– 1 user user 378 2009-05-21 09:14 ads.php

We try to delete it but it is not possible because the back slash is a special charter.

user:/var/www/core# rm \
>

So we have to go and list out the inode numbers.  Those are the inode numbers in the first collum.

user:/var/www/core# ls -li
total 56
458132 -rw-r–r– 1 root     root      213 2009-06-01 07:14 \
457759 -rw-r–r– 1 user user 378 2009-05-21 09:14 ads.php

So now we use find to delete the inode number which in turn deletes the file.

user:/var/www/core# find . -inum 458132 -exec rm -i {} \;
rm: remove regular file `./\\’? y
user:/var/www/core# ls -l
total 52
-rw-r–r– 1 user user 378 2009-05-21 09:14 ads.php

Comments

back space not working in unix

So you just logged into your unix system and you started typing and then oops you typed a wrong letter I mean charater.

root@server# ssfdkjfkjf^?^?^?^?

What are those funky charaters at the end, yup they are me trying to use the back space, but I just end up getting further away from the charaters that I am tryign to delete.

So now for the majick solution.

root@server# stty erase ^?

so the command stty sets options for the terminal session. Then you are telling it what key you want to use to erase with. Which is what the ^? is the erase key being used, so type stty erase space key then back space key then Enter, and you should be back to sanity once again.

Comments

« Previous entries Next Page » Next Page »