May 242008
 

To list all open network ports on your machine, run netstat -lnptu. Here is a breakdown of the parameters:

l – List all listening ports
n – Display the numeric IP addresses (i.e., don’t do reverse DNS lookups)
p – List the process name that is attached to that port
t – List all TCP connections
u – List all UDP connections

 

 

In this example, there are a number of open ports. For example, you can see:

print server (lpd on port 515)
rsync server (rsyncd on port 873)
database server (mysqld on localhost port 3306)
web server (httpd on port 80)
dns server  (named on port 53)
openssh (sshd on port 22)
syslog (syslog-ng on port 514)
snmp (snmpd on port 161)
dhcp server (dhcpd on port 67)
tftp server (in.tftpd on port 69)
time server (ntpd on port 123)
several services related to importing an NFS filesystem

You can also change the "l" to an "a" to list both listening and active ports.

 

You can also use netstat to show the current routing table by running  netstat -rn:


 

May 242008
 

Here’s a very cool command that will let you know that a website is up and tell you the throughput.  Being a network guy I always wondered how those Linux geeks, uh I meant guys and gals could spit that information out so quickly when we’d be on the phone troubleshooting.

Well the secret is out my Networking buddies. And that secret is "wget". Now I can kick that information out in split seconds too! Check this out.

 

[root@mylinuxbox ~]# wget www.yahoo.com
–22:50:27–  http://www.yahoo.com/
Resolving www.yahoo.com… 69.147.76.15
Connecting to www.yahoo.com|69.147.76.15|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 9562 (9.3K) [text/html]
Saving to: `index.html.3′

100%[=======================================>] 9,562       –.-K/s   in 0.03s

22:50:27 (352 KB/s) – `index.html.3′ saved [9562/9562]

Now is that cool or what? And you better not call me a geek.  

 

 

Synergy How To

 Uncategorized  No Responses »
Feb 102008
 

You really got to love synergy, since it is the only App I know of that can share a mouse and keyboard across multiple boxes/Operating systems

FYI, this tutorial assumes that you know basic linux/windows and how to download the software/install

    • In this quick but really easy tutorial, we will show you how to setup synergy for 2 boxes side by side. One box is Windows, The other box is linux. The Windows box will be the one that is controlling the mouse.

    • You need at minimum 2 section statements, one for the screens section and the other for the links section
    • In the screens section you will put the hostname of the boxes that will be involved in synergy.(if you do not have the hostname in DNS, then input the hostname in (/etc/hosts for linux and C:WINDOWSsystem32driversetchost in windows)
    • Now that you have the hostnames in now it is time to configure the links section. In this section all you have to do is put in the hostnames of the box and what direction to the next box they are in… example.. chewy is left of chewbaca and chewbaca is right of chewy.
    • Create this file if it does not exist..
      /etc/synergy.conf


      section: screens
      chewy:
      chewbaca:

      end

      section: links

      chewy:
      left = chewbaca

      chewbaca:
      right = chewy

      end
    • Now, I personally boot into multiuser mode, so I will describe the steps associated with that. 1st edit your $HOME/.xinitrc.. Mine looks like this

      exec gnome-session &
      synergyc -f chewy

       

    • Now you can substitute gnome-session with startkde or what ever window manager you prefer.
    • The line "synergyc -f chewy", this is where the connection to the box that is in charge of the mouse and keyboard.
    • Now you can run startx and it will try to connect to the synergy server in charge of the mouse and keyboard. Now we are off to the windows section.
    • Now there are 3 simple steps in Windows.

    • Run synergy, click the "Share this computer and mouse(server) button
    • Click configure, then add the screens to there appropriate positions like you did in linux.
    • now after you applied the settings click on start of the main synergy window

    Example… WINDOWS STYLE


Feb 102008
 

This tutorial is for those Admins who need to setup serial console on there LINUX servers

Section-1

    • In this first part of of the how to I will show you how to setup serial console on a
      RedHat(Fedora,CentOS) based systems(Does work on other systems as well).

    • First step is to make sure you have a serial port.
    • Second step is to make sure you have a console cable. You can do this by running this..
      linuxdynasty.org]# dmesg |grep ttyS0
      ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
    • Once you verified you have the necessary hardware configuration,
      we are on to configuring the server.

    • Add this co:2345:respawn:/sbin/agetty ttyS0 9600 vt100-nav to /etc/inittab
      using your favorite editor. (mine is vi :) ) This is how mine looks like..
      # Run gettys in standard runlevels
      co:2345:respawn:/sbin/agetty ttyS0 57600 vt100-nav
      1:2345:respawn:/sbin/mingetty tty1
      2:2345:respawn:/sbin/mingetty tty2
      3:2345:respawn:/sbin/mingetty tty3
      4:2345:respawn:/sbin/mingetty tty4
      5:2345:respawn:/sbin/mingetty tty5
      6:2345:respawn:/sbin/mingetty tty6
    • Now it is time to edit /boot/grub.conf. These two entries need to be added into grub.conf
      serial –unit=0 –speed=57600
      terminal –timeout=5 serial console

      And append this to console=ttyS0,57600n8 to your kernel entry.

    • Here is the all in one solution..


      serial --unit=0 --speed=57600
      terminal --timeout=5 serial console
      title CentOS (2.6.9-55.0.2.EL)
      root (hd1,0)
      kernel /vmlinuz-2.6.9-55.0.2.EL ro root=/dev/VolGroup00/LogVol00 console=tty0 console=ttyS0,57600n8
      initrd /initrd-2.6.9-55.0.2.EL.img

    • Now reboot your server and from another box console in.

Section-2

    • Now we will show you how to setup a serial console for Ubuntu Feisty 7.0.4,
      (Reason I chose Feisty is that Feisty no longer uses the /etc/inittab .
      Instead uses upstart for its init functions)

    • First step, follow the First step in Section-1 of this tutorial.
    • Once you verified you have the necessary hardware configuration,
      we are on to configuring the server.

    • Add this exec /sbin/getty -L 57600 ttyS0 vt102 to /etc/event.d/ttyS0 (
      If this file does not exist please create it
      ) using your favorite editor. (mine is vi :) )
      This is how mine looks like..
      # tty0 - getty
      #
      # This service maintains a getty on tty1 from the point the system is
      # started until it is shut down again.

      start on runlevel 2
      start on runlevel 3
      start on runlevel 4
      start on runlevel 5

      stop on runlevel 0
      stop on runlevel 1
      stop on runlevel 6

      respawn
      exec /sbin/getty -L 57600 ttyS0 vt102
    • Now proceed to third step of Section-1 of this tutorial.

Warning: fopen(/home/dynasty/linuxdynasty.org/wp-content/plugins/wp-google-plus-one/lib/standard.txt) [function.fopen]: failed to open stream: No such file or directory in /home/dynasty/linuxdynasty.org/wp-content/plugins/wp-google-plus-one/plusone.php on line 104

Warning: fread(): supplied argument is not a valid stream resource in /home/dynasty/linuxdynasty.org/wp-content/plugins/wp-google-plus-one/plusone.php on line 105

Warning: fclose(): supplied argument is not a valid stream resource in /home/dynasty/linuxdynasty.org/wp-content/plugins/wp-google-plus-one/plusone.php on line 106
.