Showing posts with label sysadmin. Show all posts
Showing posts with label sysadmin. Show all posts

Wednesday, November 30, 2011

linux: network manager keeps removing the nameserver i set in resolv.conf!

I want to always have Google's public DNS servers (8.8.8.8, 8.8.4.4) in my /etc/resolv.conf

However my WiFi settings are set to DHCP (for both office and home) and whenever I get a DHCP address, I also get the DNS servers configured on the DHCP server. These server settings overwrite my /etc/resolv.conf and I lose the

Having to set the nameservers manually in /etc/resolv.conf on each DHCP connection is too painful, so I found a simple and effective solution to this problem:

$ sudo vim /etc/dhcp3/dhclient.conf
# ensure the following line is uncommented in dhclient.conf:
# prepend domain-name-servers 8.8.8.8,8.8.4.4;

$ sudo service network-manager restart



This configures the DHCP client to always prepend the list of DNS servers obtained from DHCP with "8.8.8.8, 8.8.4.4" - and it works like a charm!

Wednesday, November 16, 2011

how to add multiple ip addresses to loopback and ping an AVD's host machine

From my Android Virtual Device I was trying to figure out how to connect to a service running on the same machine running the emulator.

For example, let's say I'm running Apache on my laptop, and also running the AVD on my laptop. In a browser on my laptop I can type "http://localhost/index.html" to test the index.html present in my Apache webroot.

But if I put "http://localhost/index.html" in the Android browser in the AVD, I don't get anything. That's because 'localhost' refers to the AVD itself, not the host outside the AVD.

This stackoverflow question saved the day: it turns out that from within the AVD you can ping the host machine at 10.0.2.2 - this is a kind of hard-coded virtual IP address in Android emulators for the host box.


Next, I wanted to make 10.0.2.2 go to localhost so that when I play a URL from the logs like http://10.0.2.2:8080/sms/srs?merch_txn_id=AK0AqgCkAMIAwwB5AOMAeA%3D%3D&i3p_db=ptsqa_fortumo3&i3p_host=10.0.2.2%3A5432&country=US
I don't want to have to replace 10.0.2.2 with localhost every time in every URL.

This part of the puzzle was solved by this very helpful link : I simply had to create a virtual IP address for the loopback device via:
ip -4 addr add 10.0.2.2/32 dev lo

After this we can see that 10.0.2.2 is an alias for the loopback interface, "lo":

[02:24:26] ~ $ ip addr
1: lo:  mtu 16436 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet 10.0.2.2/32 scope global lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever

Tuesday, November 8, 2011

does I3P leak memory?

I was suspecting my tomcat6 test app (I3P) was guilty of a memleak.

So I installed munin and munin-node on my box so that I could get pretty memory curves. The default munin setup doesn't plot graphs for specific processes out of the box. I eventually figured out that 'multips_memory' was the plugin for the job.

I was trying to get munin's multips_memory plugin to show me the RSS (Resident Set Size, not the other one :P - see 'man ps') of tomcat6. I wasn't getting any values in munin's multips_memory for "tomcat6" because multips_memory only checks the command name (which isn't 'tomcat' in my case). Tomcat's command line is a huge mess:

/usr/lib/jvm/java-6-sun/bin/java -Djava.util.logging.config.file=/var/lib/tomcat6/conf/logging.properties -Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xms512m -Xmx512m -Djava.endorsed.dirs=/usr/share/tomcat6/endorsed -classpath /usr/share/tomcat6/bin/bootstrap.jar -Dcatalina.base=/var/lib/tomcat6 -Dcatalina.home=/usr/share/tomcat6 -Djava.io.tmpdir=/tmp/tomcat6-tmp org.apache.catalina.startup.Bootstrap start 
 
The command name is thus /usr/lib/jvm/java-6-sun/bin/java which doesn't contain the string "tomcat" that I'm interested in. So that's why multips_memory couldn't find tomcat6 on my system... Great, here comes another tweakathon :P

So I went about adjusting the multips_memory code to suit my purposes:
[SNIP]
.
.
.
    ps -eo $monitor,args | gawk '
BEGIN              { total = "U"; } # U = Unknown. 
/grep/             { next; }
/'"$name"'/        { total = total + ($1*1024); }
END                { print "'"$fieldname"'.value", total; }'
done
.
.
.
[/SNIP]

What the above snippet does is match against the entire command+args of the processes against the string of interest using gawk. In other words, I'm now using "ps -eo args" instead of "ps -eo comm" which is necessary to find "tomcat6" in /usr/bin/java's arguments. Also, I changed the gawk regex match to search the entire line (not just $2 since the matching args for my search string could be $3 or $4 etc). I also made the search more inclusive by matching a substring instead of the exact string name  (removed the ^ and $ from the regular expression).

It works like a charm. Munin is now reporting beautiful (and worrying) memory graphs for my selected processes:




And then it struck me that this is pretty handy code. I sometimes need to see how much RAM a particular process is taking.

Every so often I see bad stuff about the tomcat app I'm testing:

4 Nov, 2011 12:58:23 AM com.aaa.bbb.application.modules.AppLauncherModule$1 uncaughtException SEVERE: Uncaught exception from Thread[Timer-0,5,main] java.lang.OutOfMemoryError: Java heap space

in the tomcat logs [/var/log/tomcat6/catalina.out]. The OOM forces a "sudo service tomcat6 restart" - really it must be a memleak.

So here's the result of this effort - a shell script inspired by the multips_memory munin plugin that that tells you how much memory all the instances of Java (e.g.) are consuming. See the usage() below for more details.


#!/bin/bash
#
# meminfo: A simple utility to display the memory usage of given process(es)
#
###############################################################################

# Default values of arguments:
VERBOSE=0
MEMORY_TYPE=rss
ARGS_TYPE=args
THIS_PROGRAM=$(basename $0)



usage()
{
cat << EOF

USAGE: $THIS_PROGRAM [arguments]

SUMMARY: A simple utility to display the memory consumption of given process(es) on this machine.

ARGUMENTS: (all optional)
    -h      Show this message
    -a      The type of arguments specified in 'ps -o'. Can be either 'args' or 'comm' (default: args)
                args: match against the full command name + argument 
                comm: match against the command name only
    -m      Specify memory type (default: rss) - see "man ps"
    -p      The process_string: can be simply a name or a regular expression.
                This argument is optional: if not supplied, all processes are considered.
    -v      Verbose mode: show debugging information

Each line of 'ps -e' is matched against the string using gawk: so you may have to escape special characters like '/' and ':" etc for gawk regex matching.

EXAMPLES:
$THIS_PROGRAM tomcat6
[show tomcat6 RSS memory usage]

$THIS_PROGRAM java
[show total memory usage by all java processes]

$THIS_PROGRAM -m vsz \\/usr\\/bin\\/java.*eclipse.*
[show memory VSZ taken by eclipse]

$THIS_PROGRAM ".usr.bin.java.+eclipse.+"
[simpler version of the above example]

$THIS_PROGRAM "\/usr\/bin\/java -Djava.library.path=\/usr\/lib\/jni -Dosgi.requiredJavaVersion=1.5 -XX:MaxPermSize=256m -Xms40m -Xmx512m -jar \/home\/ambar\/workspace\/tools\/eclipse\/\/plugins\/org.eclipse.equinox.launcher_1.2.0.v20110502.jar"
[very-specific command and args]

EOF
}


while getopts "hvm:a:p:" OPTION
do
    case $OPTION in
        h)
            usage
            exit 0
            ;;
        v)
            VERBOSE=1
            ;;
        a)
            ARGS_TYPE=$OPTARG
            ;;
        m)
            MEMORY_TYPE=$OPTARG
            ;;
        p)
            PROCESS_STRING=$OPTARG
            ;;
        ?)
            usage
            exit 1
            ;;
    esac
done



# another way to set default values, not needed here though
#: ${MEMORY_TYPE:=rss}
#: ${ARGS_TYPE:=args}
#: ${VERBOSE:=0}


if [[ -z $PROCESS_STRING ]]  # if no process name, then override ARGS_TYPE to args so that we calculate the FULL memory usage of all processes
then
    ARGS_TYPE=args
fi

ps -eo $MEMORY_TYPE,$ARGS_TYPE | gawk '
BEGIN                   { total = "U"; } # U = Unknown. 
/'$THIS_PROGRAM'/       { next; }
/grep/                  { next; }
/'"$PROCESS_STRING"'/   { total = total + ($1*1024); if('$VERBOSE'==1) {print "\n\t", $0; print "\tCUMULATIVE USAGE: ", total} }
END                     { mbs = total/(1024*1024); printf("\nTotal '$MEMORY_TYPE' memory used by all '$PROCESS_STRING' processes: %d bytes == %11.3f MB\n", total, mbs); }'

I learnt quite a bit: it's the first time I used getopts, basename, and integrated an awk script (that consumes bash variables) in a shell script. The whole endeavor seemed like a pointless digression at first, but now I think it was totally worth my time :)

And now it's time to show off the results of this little adventure:

[02:43:27] /var/log/tomcat6 $ meminfo -p eclipse -a args -m vsz

Total vsz memory used by all eclipse processes: 5109342208 bytes ==    4872.648 MB
[02:43:36] /var/log/tomcat6 $ meminfo -p tomcat6

Total rss memory used by all tomcat6 processes: 474861568 bytes ==     452.863 MB
[02:43:41] /var/log/tomcat6 $ meminfo 

Total rss memory used by all  processes: 4642054144 bytes ==    4427.008 MB

Thursday, August 25, 2011

linux: vnstat rocks!

vnstat is a superb tool to monitor monthly bandwidth usage.

I get notified by my ISP when I hit my monthly download quota (25 GB) that my speed will now be reduced to 256 kbps. Sometimes I'm left wondering how the heck I hit 25 gigs of downloading. So I started looking for a tool on Ubuntu that would monitor my bandwidth usage and show me daily/weekly/monthly download totals.

Requirements: It should work silently and unobtrusively in the background, and it should start automatically on reboot like a daemon. It would be nice to have it display graphical graphs. Also nice to have it display realtime stats (e.g. current rx and tx speeds).

There are quite a few tools that I found: bandwidthd, bwmon, bwbar etc (complete list here: http://www.ubuntugeek.com/bandwidth-monitoring-tools-for-ubuntu-users.html).

I didn't try all of them, but the most popular (or the one that appears at the top of the google search results for "bandwidth monitor tool ubuntu") is bandwidthd, and I just didn't have the patience to get it to work. There's no user manual, no real how-to and I gave up quickly on it.

vnstat saved the day. It exactly meets my requirements. You don't need to install it from the tarball either (in fact, that didn't work too well for me, I kept getting post-install configuration errors), and if you're on ubuntu, vnstat is in the standard apt repositories.

vnStat is a console-based network traffic monitor for Linux and BSD that keeps a log of network traffic for the selected interface(s). It uses the network interface statistics provided by the kernel as information source. This means that vnStat won't actually be sniffing any traffic and also ensures light use of system resources.

 

[08:17:59] ~ $ vnstat -d

eth1 / daily
     day         rx      |     tx      |    total    |   avg. rate
------------------------+-------------+-------------+---------------
08/24/11 134.81 MiB | 7.24 MiB | 142.05 MiB | 13.47 kbit/s
08/25/11 84.21 MiB | 5.63 MiB | 89.85 MiB | 24.82 kbit/s
------------------------+-------------+-------------+---------------
estimated 244 MiB | 14 MiB | 258 MiB |

[08:18:04] ~ $ vnstat -s

                  rx      /      tx      /     total    /   estimated

eth1:
Aug '11 219.02 MiB / 12.88 MiB / 231.90 MiB / 293.00 MiB
yesterday 134.81 MiB / 7.24 MiB / 142.05 MiB
today 84.21 MiB / 5.63 MiB / 89.85 MiB / 258 MiB

 

Thursday, October 14, 2010

linux: which process is listening on port X?

Discovered a new tool, ss, to view "socket statistics. From the man page:

Name
ss - another utility to investigate sockets

Synopsis
ss [options] [ FILTER ]

Description
ss is used to dump socket statistics. It allows showing information similar to netstat. It can display more TCP information than state than other tools.

[root@g2aqa3br1.qai ~]# ss -t
State      Recv-Q Send-Q      Local Address:Port          Peer Address:Port
ESTAB      0      0               127.0.0.1:56227            127.0.0.1:6802
ESTAB      0      0               127.0.0.1:56228            127.0.0.1:6802
ESTAB      0      0            172.29.8.131:38140          10.230.6.27:ldaps
ESTAB      0      0            172.29.8.131:38142          10.230.6.27:ldaps

reference: http://linux.die.net/man/8/ss


 


[root@g2aqa3br1.qai ~]# netstat -plunt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 ::ffff:172.29.8.131:1098    :::*                        LISTEN      18572/java
tcp        0      0 :::1099                     :::*                        LISTEN      18572/java
tcp        0      0 :::80                       :::*                        LISTEN      26695/httpd
tcp        0      0 :::22                       :::*                        LISTEN      7327/sshd
tcp        0      0 :::443                      :::*                        LISTEN      26695/httpd
udp     2616      0 0.0.0.0:514                 0.0.0.0:*                               6898/syslogd
[root@g2aqa3br1.qai ~]# ps 26695
PID TTY      STAT   TIME COMMAND
26695 ?        SNs    0:00 /opt/ec/apache2/bin/httpd -d /opt/ec/apache2 
-f /opt/ec/broker/conf/httpd.conf -k start -DSSL


reference:
http://www.cyberciti.biz/faq/find-out-which-service-listening-specific-port

Thursday, September 23, 2010

windows: powertools that replace the plain old netstat command

  • currports: powerful, easy-to-use and free! Can filter processes. A perfect replacement for port explorer.
  • tcpview (sysinternals)
  • procmon (sysinternals)
  • port explorer (Trialware, old favorite. Development has long stopped since the parent company seems to be dead. Also redundant now, thanks to the above free options)

Friday, April 30, 2010

linux: how to see which packages are taking the most disk space

Here's a little scriptfoo that's very useful when you're running out of disk space. When you need to reclaim hard drive real estate urgently by removing those useless "Engineering and Scientific" packages, run diskhoggers. Of course, it only works on RPM-based systems, so it's useless on Ubuntu/Debian etc, but there should be equivalents (e.g. using dpkg and/or synaptic apt-get) on those systems too.

alias diskhoggers='rpm -qa --qf "%10{SIZE}\t%{NAME}\n" | sort -n' 


Here's an example run on my system:

[root@noumPC ~]# diskhoggers | tail -n 30
15370931 bcel
15585349 gutenprint
15615584 gnome-applets
16021416 gcc
16574947 webkitgtk
16742780 nautilus
17773959 vim-common
18113087 firefox
18147692 libgweather
19693980 libicu
20174285 python
20250203 ghostscript
22082141 fedora-release-notes
22312309 kernel-devel
22371021 python-lxml
24697430 xulrunner
25032963 foomatic-db-ppds
25455524 libpurple
26376798 eclipse-jdt
29624088 perl
32984533 eclipse-platform
46820396 qt-x11
49233851 google-chrome-beta
49484310 valgrind
50371329 libgcj
80240654 kernel
84381565 kernel
85572888 java-1.6.0-openjdk
111799012 glibc-common
246952321 java-1.5.0-gcj-javadoc

Thursday, November 26, 2009

linux basics: the mysterious three load average numbers

The traffic analogy

A single-core CPU is like a single lane of traffic. Imagine you are a bridge operator ... sometimes your bridge is so busy there are cars lined up to cross. You want to let folks know how traffic is moving on your bridge. A decent metric would be how many cars are waiting at a particular time. If no cars are waiting, incoming drivers know they can drive across right away. If cars are backed up, drivers know they're in for delays.

So, Bridge Operator, what numbering system are you going to use? How about:

  • 0.00 means there's no traffic on the bridge at all. In fact, between 0.00 and 1.00 means there's no backup, and an arriving car will just go right on.
  • 1.00 means the bridge is exactly at capacity. All is still good, but if traffic gets a little heavier, things are going to slow down.
  • over 1.00 means there's backup. How much? Well, 2.00 means that there are two lanes worth of cars total -- one lane's worth on the bridge, and one lane's worth waiting. 3.00 means there are three lane's worth total -- one lane's worth on the bridge, and two lanes' worth waiting. Etc.

 = load of 1.00

 = load of 0.50

 = load of 1.70




source:
http://blog.scoutapp.com/articles/2009/07/31/understanding-load-averages

Thursday, October 29, 2009

windows: installing the recovery console on xp

To install the Recovery Console in Windows XP, follow these steps:


1.    Insert the Windows XP CD into the CD-ROM drive.
2.    Click Start, and then click Run.
3.    In the Open box, type d:\i386\winnt32.exe /cmdcons where d is the drive letter for the CD-ROM drive. In the case of 'Microsoft Windows XP Professional x64 Edition, type d:\amd64\winnt32.exe /cmdcons where d is the drive letter for the CD-ROM drive.
4.    A Windows Setup Dialog Box appears. The Windows Setup Dialog Box describes the Recovery Console option. To confirm the installation, click Yes.
5.    Restart the computer. The next time that you start your computer, "Microsoft Windows Recovery Console" appears on the startup menu.

Tuesday, October 20, 2009

windows: how to schedule a high-frequency task

Task Scheduler doesn't let you schedule tasks with fine-grained frequencies. For example, you can't schedule a task to execute every minute, or every few hours. The maximum frequency that can be given to a task is "daily" which sucks because you need to run some programs more often than that (linux's cron is still the king!)

Here's the solution. It involves using the rather powerful "schtasks" windows command:

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/schtasks.mspx?mfr=true

Here's what I used:
schtasks /create /sc hourly /mo 2 /tn "autoupdatesourcecode" /tr c:\tools\autoupdatesourcecode.bat


And this is my super-simple autoupdatesourcecode.bat:
cd d:\Codebase\trunk\pi\
d:
svn up

Tuesday, October 6, 2009

batch file to fix WMI errors

There's a lot to learn about batch file scripting from this example!
source

net stop winmgmt

pause

c:

cd c:\windows\system32\wbem

rd /S /Q repository

regsvr32 /s %systemroot%\system32\scecli.dll

regsvr32 /s %systemroot%\system32\userenv.dll

mofcomp cimwin32.mof

mofcomp cimwin32.mfl

mofcomp rsop.mof

mofcomp rsop.mfl

for /f %%s in ('dir /b /s *.dll') do regsvr32 /s %%s

for /f %%s in ('dir /b *.mof') do mofcomp %%s

for /f %%s in ('dir /b *.mfl') do mofcomp %%s

mofcomp exwmi.mof

mofcomp -n:root\cimv2\applications\exchange wbemcons.mof

mofcomp -n:root\cimv2\applications\exchange smtpcons.mof

mofcomp exmgmt.mof

Monday, October 5, 2009

linux: adding swap space on-the-fly to your system

You might find that the swap partition you specified at install-time just isn't enough anymore. Maybe you've added more RAM to your machine and need to increase the swap partition accordingly. Or maybe you're upgrading your system to a version that uses more swap in relation to physical RAM. Perhaps you're running Oracle. In case your machine is swapping like mad and you just can't take it down right now to add more RAM, you can add more swap space on the fly using the following procedure. As an example, to keep the machine from running out of memory entirely and freezing up, we'll add 128 MB more swap space by creating a swap file. First we check out the memory usage:

[root@domain /root]# free -m
total used free shared buffers cached
Mem: 251 242 8 22 11 32
-/+ buffers/cache: 198 52
Swap: 133 133 0

Make sure we have 128 MB laying around somewhere:

[root@domain /root]# df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hda9 132207 33429 91952 27% /
/dev/hda1 15522 2537 12184 17% /boot
/dev/hda6 6143236 739000 5092176 13% /opt
/dev/hda7 1035660 836204 146848 85% /usr
/dev/hda5 2071384 344048 1622112 17% /usr/local
/dev/hda8 303344 14439 273244 5% /var

OK, we're going to make a swap file in /opt by using dd to create a file 128 MB in size.

[root@domain /opt]# dd if=/dev/zero of=swapfile bs=1024 count=132207
132207+0 records in
132207+0 records out
[root@domain /opt]# ls -l
total 132364
drwxr-xr-x 20 usr-3 users 4096 May 22 10:46 usr-3
drwxr-xr-x 2 root root 16384 Feb 21 07:04 lost+found
-rw-r--r-- 1 root root 135379968 May 29 11:52 swapfile

Let's not make it world-readable...

[root@domain /opt]# chmod 600 swapfile
[root@domain /opt]# ls -l
total 132364
drwxr-xr-x 20 usr-3 users 4096 May 22 10:46 usr-3
drwxr-xr-x 2 root root 16384 Feb 21 07:04 lost+found
-rw------- 1 root root 135379968 May 29 11:52 swapfile

Now we set up the swap area and enable it.

[root@domain /opt]# mkswap swapfile
Setting up swapspace version 1, size = 135372800 bytes
[root@domain /opt]# swapon swapfile

And voila! Twice as much swap as before.

[root@domain /opt]# free
total used free shared buffers cached
Mem: 257632 254632 3000 2512 36172 15096
-/+ buffers/cache: 203364 54268
Swap: 268708 136512 132196

You can append a line like this to /etc/fstab to enable your swap file automatically at boot time:

/opt/swapfile swap swap defaults 0 0


source

Monday, September 14, 2009

vbscript: create system restore points with no fuss

Here's how to create a simple VBscript that will create a restore point when you double-click it:

1. Save the code below to, say, c:\system_restore.vbs:

Set SRP = GetObject( "winmgmts:\\.\root\default:Systemrestore" )
CSRP = SRP.CreateRestorePoint( "Before Changes", 0, 100 )

2. Double-click the script file you just created, any time you want to create a fresh System Restore Point.

It only takes a few seconds to do this. And no dialogues are shown to confirm that a Restore Point was created. If you want to double-check you can click "Start | All Programs | Accessories | System Tools | System Restore" and click "Restore My Computer To An Earlier Time."

You'll see the restore point you just created (called "Before Changes") right there. Now be sure to cancel out of System Restore.

source

Monday, June 8, 2009

linux: setting your machine's hostname properly

To setup the hostname manually on a Fedora or RedHat box, you need to edit two files:
  • /etc/sysconfig/network
  • /etc/hosts
1.  In the /etc/sysconfig/network file, modify the hostname:
NETWORKING=yes
HOSTNAME=fedora.hacking.com
GATEWAY=10.7.0.1
  2.  In the /etc/hosts file, modify the hostname:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 fedora.hacking.com fedora localhost.localdomain localhost

After making these changes to these files, the changes to the hostname should be permanent ( i.e. it will persist even across reboots). Otherwise, simply setting the hostname with the "hostname" command only affects the current session, and you lose the hostname change after the next machine reboot.

Monday, April 23, 2007

linux: loading modules causes problems in iptables


You may run into a few problems with loading modules. For example, you could get errors claiming that there is no module by such a name and so on. This may, for example look like the following.
insmod: iptable_filter: no module by that name found
This is no reason for concern yet. This or these modules may possibly have been statically compiled into your kernel. This is the first thing you should look at when trying to solve this problem. The simplest way to see if these modules have been loaded already or if they are statically compiled into the kernel, is to simply try and run a command that uses the specific functionality. In the above case, we could not load the filter table. If this functionality is not there, we should be unable to use the filter table at all. To check if the filter table is there, we do the following.
iptables -t filter -L
   
This should either output all of the chains in the filter table properly, or it should fail. If everything is o.k., then it should look something like this depending on if you have rules inserted or not.
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
    
If you do not have the filter table loaded, you would get an error that looks something like this instead.
iptables v1.2.5: can't initialize iptables table `filter': Table \
     does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
    
This is a bit more serious since it points out that first of all, we do not have the functionality compiled into the kernel, and second, that the module is not possible to find in our normal module paths. This may either mean that:

  • you have forgotten to install your modules,
  • you have forgotten to run depmod -a to update your module databases or
  • you have not compiled the functionality as either module or statically into kernel.
There may of course be other reasons for the module not to be loaded, but these are the main reasons. Most of these problems are easily solved.

  • The first problem would simply be solved by running make modules_install in the kernel source directory (if the source has already been compiled and the modules have already been built).
  • The second problem is solved by simply running depmod -a once and see if it works afterward.
  • The third problem is a bit out of the league for this explanation, and you are more or less left to your own wits here. You will most probably find more information about this on the Linux Documentation Project homepage.

Source

Thursday, March 29, 2007

linux: how to stop the firewall


To stop your linux firewall, first login as root, else use sudo for the following commands.

Option A - If you are on a RedHat or Fedora based system:
/etc/init.d/iptables stop
OR
service iptables stop

Option B - If you are on a Debian-based system,:
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT[/code]


Source

Wednesday, February 21, 2007

linux basics: /etc/sysconfig/network

The etc/sysconfig/network file is used to specify information about the desired network configuration. The following values may be used:
  • NETWORKING=, where is one of the following boolean values:
    • yes — Networking should be configured.
    • no — Networking should not be configured.
  • HOSTNAME=, where should be the Fully Qualified Domain Name (FQDN), such as hostname.domain.com, but can be whatever hostname you want.
    Note Note
    For compatibility with older software that people might install (such as trn), the /etc/HOSTNAME file should contain the same value as here.
  • GATEWAY=, where is the IP address of the network's gateway.
  • GATEWAYDEV=, where is the gateway device, such as eth0.
  • NISDOMAIN=, where is the NIS domain name.
  • FORWARD_IPV4=answer, where the answer is yes or no. This decides whether to perform IP forwarding or not to perform IP forwarding.