Linux filesystem

/ : This(/) is the root folder, all other folders come under root.. it is like C: drive in a Windows OS
/boot : Linux kernel and boot loader configuration files
/usr  : This folder and its sub-folders contains user installed programs and utilities and libraries.It is like
Program files in windows.
/etc  : Configuration files of all installed softwares or applications
/var  : This folder contains files that change alot (“Variable files”). Mail, print web spool files
/tmp  : Temp directory
/home : This folder contains the home folders of all the normal (non – root ) users on the system
/dev  : Device files corresponding to various peripherals of your comp. (hard disk, printer, mouse, modem)
/mnt  : Devices mounted onto OS to increase storage space
/lost+found : Orphan files are moved here
/root : Root's home directory
/proc : Process information pseudo filesystem.
/bin  : various console utilities and apps
/sbin : system administration utilities
/lib  : Shared Library files for your operating system.

netstat : check open ports and connections to system

Using netstat command we can see all the used and listening ports on your computer. NETSTAT command will work in Windows and as well as in Linux Operating System.
Linux
Will Show all connected Ports
netstat -an | grep -i "connected"

Will Show all listening Ports
netstat -an | grep -i "listening"

Will Show all established connections
netstat -an | grep -i "established"

Windows 
Will Show all connected Connected Ports
netstat -an |find /i "connected"

Will Show all listening Ports
netstat -an |find /i "listening"

Will Show all established connections
netstat -an |find /i "established"

Note: -i & /i is used to ignore case-sensitive.

restore grub in vyatta router


grub> linux /boot/vmlinuz root=/dev/sda1
grub> initrd /boot/initrd.img
grub> boot
Agter reboot run below command to re-install grub
grub-install /dev/sda
reboot  ##Reboot again to so that the Server will boot normally

How to manually extend the evaluation period for Windows Server 2008

When the initial 60 or 180 days evaluation period nears its end, you can run the Slmgr.vbs script to reset the evaluation period. To do this, follow these steps:

   1. Login As a Administrator. Click Start, and then click Command Prompt.
   2. Type slmgr.vbs -dli, and then press ENTER to check the current status of your evaluation period.
   3. To reset the evaluation period, type slmgr.vbs –rearm, and then press ENTER.
   4. Restart the computer.
   5. Open Computer Properties.  Right Click on Computer ==> Click Properties ==>At Windows Activation 
       Screen ==>  Click on Activate ==> Click on Activate online ==> Click Next to finish actiavation.

This resets the evaluation period to 60 or 180 as per your last evaluation period.

how to get entire system information in ubuntu

facter : It is a tool to collect and display facts about the current system. The library behind Facter is easy to expand, making Facter an easy way to collect information about a system from within the shell or within Ruby.
#apt-get install facter
#facter and press enter to get the system details
Below is the output of facter
# facter
architecture => i386
facterversion => 1.5.4
hardwareisa => unknown
hardwaremodel => i686
hostname => my-desktop
id => root
interfaces => eth0
ipaddress => 192.168.xxx.xxx
ipaddress_eth0 => 192.168.xxx.xxx
kernel => Linux
kernelrelease => 2.6.31-22-generic-pae
kernelversion => 2.6.31
lsbdistcodename => karmic
lsbdistdescription => Ubuntu 9.10
lsbdistid => Ubuntu
lsbdistrelease => 9.10
lsbmajdistrelease => 9
macaddress => 00:16:ec:da:bc:21
macaddress_eth0 => 00:16:ec:da:bc:21
manufacturer => HP Pavilion 061
memoryfree => 1.28 GB
memorysize => 1.90 GB
netmask => 255.255.255.0
netmask_eth0 => 255.255.255.0
network_eth0 => 192.xxx.xxx.0
operatingsystem => Ubuntu
operatingsystemrelease => 9.10
physicalprocessorcount => 1
processor0 => Intel(R) Pentium(R) D CPU 2.80GHz
processor1 => Intel(R) Pentium(R) D CPU 2.80GHz
processorcount => 2
productname => RC562AA-ACJ a1514in
ps => ps -ef
rubysitedir => /usr/local/lib/site_ruby/1.8
rubyversion => 1.8.7
serialnumber => INI6370L08 AP640
sshdsakey => AAAAB3NzaC1kc3MAAACBAOBuTdUYuMv2b3xqIhWVpuRQunyIm6T5xOYqlZbwuBTi66oZwWTfE5rywsUHQL8CExMaofWFxlo3c+mTcxWIL+68ZjY5NZy5irwAl3g/CL4THtHmDCMbCmvdQLZeePElvYNFcmvC+7o3CbZWC2KU2FnzTCuI9vpG1k51OSiZJtdHAAAAFQDUId/oRXYQ281bZ9J42Wrt3VsbgQAAAIEAn74omuvo4qKjr1PE12HZSA2oeqpFajcGctEyxurQXzpLgjWcgs1ip2phjz6kypDIbELG/nvOComWIABADwnBnErwM0uDpchOkghzCFgR7Hk10Ph1/SQ4Si0y8jKZ9VzPxYzhZp0ekpL15QIutJSTbCG7WzlGRl3eHrY0cVgZVs4AAACABl/PgIPo0u8L2jI0R5wpUql1Tb0Ln+LTMt1HZoqR2gb7dmvI3FvNRbJfEMOy8f5YXeELQz1ppwRS8PpAas3Dh+Deg9dVSzKUTZURqOe4X8TWjrhf3I6jn00zvIjmGk0XhB5ueH3uoQsjogL/uRws1Tqk1wxF/xvt25t8jV1WATQ=
sshrsakey => AAAAB3NzaC1yc2EAAAABIwAAAQEAy6l8d9gOYGQ9CHQoQBmoJ74NDnSZBreIXD/nsAwj93i7pCv9LJ1ifybP7am7kJq3qaHhoU3sB8oaTUUfeXMXGfoHrwRvcIdYFdDKQ7KvjpZU7jWSsKECk0aibaVzqni5sixquLXcjte18T7DU1ki/K/sQPvSQII2Y9EWOAzdzoov4ezj30uer6sR6BkXSR5LK3LW+qoRPKT+xIQMBseJ9TZ8Tz7hpiz1AmcmPNhLj61aK0/1bbRBKzfr8bd8kkI3vkHvfE5Sqzu4VplSCNxa9QNG9jNFCdN/cGCYlL7GdWPNdBP3jzFXeLNgH+bTA82FrBqFaQo5bUOBSSCKFZyuaQ==
swapfree => 5.58 GB
swapsize => 5.58 GB
timezone => IST
type => Desktop
uniqueid => 007f0101
uptime => 4 days
uptime_days => 4
uptime_hours => 109
uptime_seconds => 395539
virtual => physical

sc (service control) command to start/stop any service in windows

SC (service control) command, allows u a lot more options than just start & stop a service
DESCRIPTION:SC is a command line program used for communicating with the NT Service Controller and services.
USAGE: sc  [command] [service name]  ...
Ex: sc query dhcpserver
      sc start dhcpserver
Note:We should know the Service name of any windows service.
Further help on commands can be obtained by typing: "sc [command]"
Commands:
        query-----------Queries the status for a service, or enumerates the status for types of  services.
        queryex---------Queries the extended status for a service, or enumerates the status for types of service.
        start-----------Starts a service.
        pause-----------Sends a PAUSE control request to a service.
        interrogate-----Sends an INTERROGATE control request to a service.
        continue--------Sends a CONTINUE control request to a service.
        stop------------Sends a STOP request to a service.
        config----------Changes the configuration of a service (persistant).
        description-----Changes the description of a service.
        failure---------Changes the actions taken by a service upon failure.
        qc--------------Queries the configuration information for a service.
        qdescription----Queries the description for a service.
        qfailure--------Queries the actions taken by a service upon failure.
        delete----------Deletes a service (from the registry).
        create----------Creates a service. (adds it to the registry).
        control---------Sends a control to a service.
        sdshow----------Displays a service's security descriptor.
        sdset-----------Sets a service's security descriptor.
        GetDisplayName--Gets the DisplayName for a service.
        GetKeyName------Gets the ServiceKeyName for a service.
        EnumDepend------Enumerates Service Dependencies.


useradd in ubuntu

The useradd command will let you add a new user easily from the command line:
#useradd username
Ex : useradd user1
This command adds the user, but without any extra options your user won’t have a password or a home directory. You can use the -d option to set the home directory for the user. The -m option will force useradd to create the home directory.
We will try creating a user account with those options, and then use the passwd command to set the password for the account. You can alternatively set a password using -p on the useradd command, but I prefer to set the password using passwd.
#useradd -d /home/user1 -m user1
#passwd user1
Important locations for users
    * /etc/passwd - User account information.
    * /etc/shadow - Secure user account information such as password.
    * /etc/group - Group account information.
    * /etc/default/useradd - Default values for account creation.
    * /etc/skel/ - Directory containing default files.
    * /etc/login.defs - Shadow password suite configuration.