Droolix - Dare to Continue

Useful Commands

SUSE Linux

Mounting an iso image

This command can mount an iso image as a cd or dvd drive.
mount -o loop /tmp/cdrom.iso /mnt

Creating an iso image

The source needs to point to the cd or dvd drive. The destination can point to anywhere with write access.
dd if=/dev/cdrom of=tmp/cdrom.iso

NTP Server

NTP server open to the public to use is:
ntp.adelaide.edu.au

To start or stop ntp service: rcxntpd start/stop
To change config: /etc/ntp.conf

SSH

The scp Command to copy from a remote server to a local host:
scp username@sourcehost:sourcefile /localfolder/destinationfile
or
scp username@sourcehost:sourcefile username@destinationhost:/localfolder/destinationfile

Port Forwarding
Allows encrypted data streams between 2 hosts. All traffic coming to port 1234 on the client will be forwarded to port 23(can be changed as required) on the server (host). Note that localhost will be resolved by the sshdserver after the connection is established. In this case localhost therefore refers to the server (host) itself.
ssh -2 -N -f username@host -L 1234:localhost:23
For a socks proxy dynamic port forwarding is useful. (Thanks Michael)
ssh -D 1234 username@server

Check disk space

This will display disk space in megabytes and gigabytes.  Remove the -h option if you want to display in kilobytes.
df -h

Mobile Phones

To change ringtime before diverting to Telstra message bank enter the following string.
**61*101**30#

Where the 30 represents the number of seconds before diverting to message bank… The number should be less than 60.

Windows

How to find Windows uptime?

1. Go to “Start” -> “Run”.
2. Write “CMD” and press on “Enter” key.
3. Write the command “net statistics server” and press on “Enter” key.
4. The line that start with “Statistics since …” provides the time that the server was up from.
• The command “net stats srv” can be use instead.
• Type “date” to get the format.
- Type “ctrl-c” to exit

Cisco IOS

To enable the IOS to bring what you are typing to a new line so it is not split by log lines coming to the console screen


line con 0
logging synchronous
line vty 0 4
logging synchronous
line vty 5 15
logging synchronous

Mac Address to IP Address

If you are using Cisco Switches & Routers, this is very easy.

On your Switch do a Show cam 00-00-00-00-00-00, replacing the 00′s with the MAC address you are looking for. This will tell you which switch port/Interface the PC is plugged into.

To retrieve a mac address of a device connected to a specific port.  sh mac-address-table interface fa0/1

Next goto the first router that the switch connects to and do a sh ip arp 0000.0000.0000 this will give you the IP address, interface and other details.

Sync speed for an Cisco 877

As well as some other information

sh dsl int atm 0

    • All the above commands should be used at your own risk.
  1. [...] through all of the issues, I had my fair share.  Some of the commands I used are on the page Useful Commands.  I am cleaning up the config and soon hope to have a config that is suitable to post here as a [...]

    Pingback by Cisco Router 877 « Droolix — January 25, 2010 @ 8:42 am
  2. [...] Useful Commands [...]

    Pingback by Useful Commands update « Droolix — August 18, 2010 @ 10:00 am

Leave a comment

RSS feed for comments on this post. TrackBack URL