20 Twitter applications everyone must use

Twitter is growing all over the world and thousands of people are joining on a daily basis. I thought we would put together a quick list of our top 20 Twitter applications.



twitter Toolbar Downloading this free toolbar gives you instant access to Twitter. You can use the toolbar to access online Twitter tools, check your Twitter stats, post your updates and more. Versions are available for both Firefox and Internet Explorer.


Twitoria – This simple application lets you quickly find out which of your followers has not been actively tweeting. Easily sort through your network of followers and purge the inactive users.


Monitter Get a live streaming view at what Twitter users in your location are saying about you or your small business. Simply insert keywords you would like to search for and the surrounding area you would liked monitored.


Bubble Tweet – This unique application lets you post a short video message that pops up on your Twitter profile in a bubble shaped player. You can personally introduce yourself and/or your business to anyone who visits your profile.


Twitter GalleryA collection of free backround themes for your Twitter account. You can use the one click installation or manually install them yourself. Lots of nice designs and colors to choose from.


Tweepler – Simplify the way you manage your Twitter followers. Tweepler enables you to easily sort through new followers and accept them or ignore them on one simple screen. They have made accepting followers easier by giving the Tweepler user the followers stats and last 3 tweets in one screen view. This will save you time by eliminating the need to visit each individual follower’s profiles.


Twit ThisAllow visitors to your blog or website to easily post Twitter messages about you or your business. Post the TwitThis button to your website or blog pages with the instructions and coding provided on their site.


StockTwits – Follow and join into conversations with traders and investors. An active community of investors are sharing their views on current market conditions and recent news happenings. You can quickly see what others are saying about investments in your portfolio.


HelloTxtUpdate your status to several social networking sites in one simple step. You can choose from over 35 social sites to post to including Twitter.


TwitterFox – This Firefox extension is one of my personal favorites. You can post Twitter updates without visiting the Twitter site each time. A small icon is added to the bottom of your Firefox status bar. The icon opens to reveal your friend’s most current updates. You can add your updates from that dialog box, even for multiple Twitter accounts.


Future TweetsDo you have something to promote on Twitter tomorrow but are afraid of forgetting to do it? With FutureTweets, you can schedule your tweet ahead of time for a specific date and time. Even schedule reoccuring tweets to post daily, monthly, even yearly.


TwitPic – Share your favorite pictures on Twitter. This would be a good way to introduce your new product to your network of followers.


twtQponCreate exclusive coupons for your business services or products and share them with your Twitter followers.


Tweetburner – This site is designed to help you track your tweets. With Tweetburner you can shorten URLs and track the clicks your tweets accumulate.


Tweetbeep Just like Google Alerts, Tweetbeep tracks Twitter conversations that mention you, your business or your products and services. Alerts are sent to you via email.


Twitter Counter – Proudly display the number of Twitter followers on your business blog or website. Add the badge to your site and invite customers to follow you on Twitter.


Group TweetThis app enables all employees within your company to post updates which can be privately viewed only by your group of approved members.


Twitter Safe – This free service protects your years of hard work building your community of followers. This one click backup will restore your network of followers in the event that your list is compromised.


TwitxrPost product pictures and updates from your mobile phone directly to Twitter.


Track This – This app enables tracking of any UPS, USPS, FedEx or DHL shipment. Updates are sent to your Twitter account direct messages whenever your package changes location.

Read more...

Cloning SIM[TUT]


The following guide enables us to make clones of sims used in india
........... unlike the complicated guides you find on the net ....... i
have compiled them all together and made one simple guide which can be
followed even by beginners..covering only the relevant things needed to
know rather than going technically deep



Before i start off with this guide ..... i would like to make one thing
clear .......... SIM CLONING is illegal ..... there have been many
cases in india where people have been caught...... for cloning others
sims .......... and making calls worth thousands through it
............ recently many gsm operators in india have set up
surveillance techniques to trap people who use cloned sims............
So i once again request to everyone that please use this guide for
personal purpose only,do not use this guide for cheating ......



First off a little introduction about SIM CARDS.......



Our sim cards contain ......... two secret codes or keys called (imsi
value and ki value) which enables the operator in identifying the sim
card number and authenticate the customer ...... these codes are
related to our mobile numbers which...... the operators store in their
vast data base......... it is based on these secret keys that enables
the billing to be made to that customer. now what we do in sim cloning
is extract these two secret codes from the sim and programme it into a
new blank smart card often known as wafer........ since the operator
authentication on sims is based on these values..... it enables us to
fool the operators in thinking that its the original sim......... this
authentication is a big flaw concerning GSM technology.........



Now which sim cards can be cloned



Sim cards are manufactured on the basis of 3 algorithms....... COMP128v1,COMP128v2 and COMP128v3

now an important note currently only COMP128v1 version sim cards can be
cloned .... since this is the only algorithm which has been cracked by


users......... bear in mind that 70% of all the sim cards we use are
COMP128v1...... now which gsm operators use what algorithms..... they
are as follows:





Airtel-90% can be cloned



Hutch-75% can be cloned



bpl mobile-90% can be cloned



idea-numbers before Aug 2005 can be cloned newer cards very rare



BSNL- 0% say no - reason not comp128v1 version







OK thats it about the background..... now lets get to the Main Part





1.ITEMS NEEDED





a)Sim card Reader (phoenix or smartmouse reader)

b)Plain or Blank silver wafer card or smart card

c)Software to Extract Ki and imsi (Woron scan 1.09 is the best) DL here: http://www.easy-share.com/1905592029/woron_scan_1.09_eng.exe

d)Wafer Card Programmer (is a hardware chipset needed to programme smart card Millenium 2000VX MAX)

e)Software to make the PIC and EEPROM files (Sim Emu 1.06 configurator by pic-ador) DL here:http://www.easy-share.com/1905592623/SIM_EMU_6.02_CFG_v2.2.exe

f)Software to write the PIC and EEPROM files to blank card (card master 2.1) DL here:http://www.easy-share.com/1905592645/CM21b3.exe







2.GETTING STARTED





a)Extracting the Ki and IMSI



first connect the sim card reader to the pc's com port insert your
original sim card..... run woron scan 1.06........ click on the menu
"card reader" and click settings and select the com port which the card
reader is connected to....dont change any thing else in
settings.....click ok



if you have a phoenix card reader checkmark pheonix in the card reader menu.....


now click on "IMSI select" on the task menu...... the program will now
communicate with the sim card and retrieve the imsi value........ once
u got the imsi value..... write that on a piece of paper

now in the same way retrieve the "icc value" and write that down too

now click on "Ki search" now the program hacks the sim and retrieves
the the ki value which consists of 32 numbers......... Note that it may
take up to 8 hrs to completely get the ki value....... no matter how
much faster the comp is...... this is because the sim is only capable
of recieving and sending data@9600 bits/sec...

so goto sleep.... for now.....

After u wake up ....make sure u write down the Ki value safely in a
piece of paper like u did for the imsi value........ exit woron scan....



yaaahhoooo now u can stand up and proudly say that u hacked the sim









b)Making the PIC and EEPROM files with SIM EMU configurator



first uncheck the A3A8 checkbox under security........... Please dont
enable this even from the sim services menu. If enabled, it countsback
to zero and when it reaches zero,........ it will corrupt your simcard.
In the configurator you can set the number of ADN, FDN and SMS.
...........You can use the formulae ?16448 = (ADN - 51 ) x 32 +SMS x
176 + FDN x 32 must be less than 6480? for silver wafer cards.

Then generate the Hex files forPIC and EEPROM by clicking the Generate
Hex file. With this configurator, in addition to the 16 number

slots, you can make the simcard a Motorola Test card too. In 16 in 1 configurator the positions are from

0-9 and from A-F. Each position can be customised by induvidual PIN an
PUK codes. finished making the files now next step copy these files to
the blank card using the programmer......



c)Write the files to the SILVER WAFER card



Now we have the files to be written to the Silver Wafer card. For this we need the Wafer

card programmer and the software for programming. Here i am using the Millenium 2000VX Max programmer

and the Cardmaster 2.1 software. Connect the programmer and run the software. Select the type

of card you are using. Select the port by clicking setup > port. If the port set by you is correct the red

colour with message on ststus bar changes to yellow and shows no simcard. Insert the simcard and load

the files for PIC and EEPROM in the file to PIC and file to EEPROM fields respectively. Dont change any

other settings. Now you are at the last stage.



Press F3 or click edit > Auto Program. You can watch the

status bar about what is happening. Programming the pic.. programming the eeprom... programming the

pic.... verifying.... and atlast you will get the message that the card is programmed succesfully. Here

you may ask the question why the PIC is programmed again after programming the EEPROM?. The PIC is

first programmed with the eeprom loader to program the EEPROM. then the EEPROM is programmed

through the pic. After that the contents in the pic is erased and the actual file is programmed in the PIC







d) Cutting the smart card into a Sim card...... and settings on the phone



The card which we have made is a 16 in 1 sim card....... means we can store 16 different sim card numbers in one

This is the last step guys...... cut the smart card in the shape of ur sim card...... insert the sim card in the phone.....



switch on the handset...... the phone asks for the PIN..... type ne 4
digit number this is for the first slot 0...... now the phone asks for
the PUK code again type ne 4 digit number again for the first
slot....... now the phone switches on with no network coverage...... a
network error message will appear....... this is usual because........
the main values (ki and imsi) have not entered....... so the network
operator cannot authenticate the sim.........



now the Finallee....... u would have noticed by now that a new menu
called the "sim emu 6.01" has appeared....... select it......you can
see the menus Configure, Select Phone and Information. Select Configure
and go to config postion. It asks for the position. You can select any
position from 0-9 and A-F. After selecting the position it asks for a
PIN and PUK. Always provide different PIN and PUK for each positions.
It helps us to switch to a number directly when the handset is switched
on. After PIN and PUK it asks for KI,IMSI and ICCID. You can now recall
the extracted values from STEP1 and enter it to appropriate fileds.







After doing all this..... u should now posses ur newly cloned sim
card...... u earned it congratulations..... ............. If not
then...... u must beat urself 10 times ........ and reapeat the entire
process.....

--3nj0y

Read more...

Disable Unwanted XP Services

Security and performance are the two main concerns, that Windows XP users (similar to Windows Vista and Windows 2000) need to seriously understanding these 72 Windows services.

Windows service is essentially a Windows program which is running in background. As such, Windows service taking up system resources throughout its execution. While Windows security is not hardened, some of these Windows services might easily expose security vulnerability (such as Alerter, Remote Registry, etc).
This guide covers 72 Windows services, to assist Windows XP users (as well as Windows 2000 or Windows Vista users) to determine which Windows XP services that can be safely disabled.

Note, not all Windows services could be disabled. Some of these Windows services are critical to Windows XP, and should not be disabled. Although, you may re-enable them by booting Windows XP into Recovery Console mode.

  1. Alerter

    Function
    Notify system users or programs about any administrative alerts that raised in Windows XP.
    Status
    Can be safely disabled at all time.

  2. Application Layer Gateway

    Function
    Provides support for application-level protocol plug-ins for Internet Connection Sharing and Windows Firewall.
    Status
    Windows Messenger, MSN Messenger, etc, rely on this service to operate. If there is a firewall enabled to safeguard Windows XP, it is safe to enable.

  3. Application Management

    Function
    Provides program installation related services.
    Status
    Disable this service will disallow non-administrator users to perform program installation related activities.

  4. Automatic Updates

    Function
    Enables the download and installation of critical Windows updates.
    Status
    You can safely disable it, and manually trigger the process by using Windows Update online service.

  5. Background Intelligent Transfer

    Function
    Transfers files between clients and servers in the background using idle network bandwidth.
    Status
    If Automatic Updates service has been disabled, you may want to disable this service as well. However, you may not able to download some of the programs from Windows Live, if this service is disabled.

  6. ClipBook

    Function
    Enables ClipBook Viewer to store information and share it with remote computers.
    Status
    This service can be safely disabled, as most users don't utilize this feature.

  7. COM+ Event System
    COM+ System Application

    Function
    Supports System Event Notification Service by providing automatic distribution of events to subscribing COM components.
    Status
    These two services can not be disabled!

  8. Computer Browser

    Function
    Maintain an up-to-date list of networked resources, such as network shared drive and printer, and supply the list to programs that request it.
    Status
    You may safely disable this service if you're not going to share any resources to the network.

  9. Cryptographic services

    Function
    Provides three management services
    1. Catalog Database Service, which confirms the signatures of Windows files
    2. Protected Root Service, which adds and removes Trusted Root Certification Authority certificates from this computer
    3. Key Service, which helps enroll this computer for certificates.
    Status
    This service should be enabled at all time. Automatic Updates and Task Manager rely on this service to function properly.

  10. DHCP Client

    Function
    Allow Windows XP to automatically obtain IP address, WINS server information, routing information, etc.
    Status
    There is no reason to enable it, if you're using fix IP, or no DHCP server available in the network.

  11. Distributed Link Tracking Client

    Function
    Ensures shortcuts and OLE links to work properly when the target file is renamed or moved, by automatically maintain links in NTFS file system.
    Status
    Depending on your wish, this service is safe to disable at all time.

  12. Distributed Transaction Coordinator

    Function
    Coordinates transactions that span over multiple resource managers, such as databases, message queues, and file systems.
    Status
    For most home users, this service is safe to disable at all time.

  13. DNS Client

    Function
    Allows Windows XP to communicate with canonical names rather than numeric-based IP address, by resolving and caching DNS names.
    Status
    This service should be enabled at all time, to facilitate Windows XP communicate over the network, especially on a network environment with domain controller.

  14. Error Reporting

    Function
    Allow error reporting (to Microsoft) for services and programs running in non-standard environments.
    Status
    You may enable this service only when you are frequently encounter system or program crash.

  15. Event Log

    Function
    Enable event log messages raised by Windows-based programs to be viewed in Event Viewer.
    Status
    Unlike Error Reporting service, this service should be enabled at all time to assist you resolving system failures, audit system security logs, etc.

  16. Fast User Switching Compatibility

    Function
    Enable fast user switching feature that introduced in Windows XP.
    Status
    Although fast user switching is good, but it consumes huge system resources, both memory and CPU. So, it is better to disable this service for performance reason.

  17. Help and Support

    Function
    Enables Windows XP Help and Support Center to run on this computer.
    Status
    Depending on your wish, if you feel comfortable without consulting Windows XP help, then you may safely disable it.

  18. Human Interface Device Access

    Function
    Enables generic input access to Human Interface Devices, which activates and maintains the use of predefined hot buttons on keyboards, remote controls, and other multimedia devices.
    Status
    This service can be safely disabled to free up more system resources to critical services.

  19. IMAPI CD-Burning COM

    Function
    Manages CD recording using Image Mastering Applications Programming Interface (IMAPI).
    Status
    This service can be safely disabled, as most Windows XP users are using Nero burning software for CD/DVD burning.

  20. Indexing Service

    Function
    Indexes contents and properties of files on local and remote computers and provides rapid access to files through flexible querying language.
    Status
    If you don't frequently searching files using Windows search function, or you can tolerate with slow searching function, then you can disable this service to free up some system resources.

  21. IPSEC services

    Function
    Provides end-to-end security between clients and servers on TCP/IP networks.
    Status
    Don't disable this service, if you're connecting over an IPSec secured connection.

  22. Logical Disk Manager
    Logical Disk Manager Administrative

    Function
    Detects and monitors new hard disk drives added to Windows XP, and sends disk volume information to Logical Disk Manager Administrative service for configuration.
    Status
    You may enable these two service only when you are going to add new hard disk drives to Windows XP, rather than turning it on at all time.

  23. Machine Debug Manager

    Function
    Supports local and remote debugging for Visual Studio and script debuggers.
    Status
    Disable this service if you don't perform program debugging processes.

  24. Messenger

    Function
    Transmits net send and Alerter service messages between clients and servers. Note, this service is not related to Windows Messenger or MSN Messenger.
    Status
    This service is safe to disable, if you disable Alerter service.

  25. Microsoft Software Shadow Copy Provider

    Function
    Manages software-based volume shadow copies taken by the Volume Shadow Copy service.
    Status
    Disable this service if you don't perform Windows Backup.

  26. NetMeeting Remote Desktop Sharing

    Function
    Enables an authorized user to access you computer remotely by using NetMeeting over a corporate intranet.
    Status
    You should able to justify the reason of enabling this service, that allow remote users access to your Windows XP.

  27. Network Connections

    Function
    Manages the network and dial-up connections, such as network status notification and configuration.
    Status
    This service should be turned on at all time, if your Windows XP is connected to network or Internet.

  28. Network DDE

    Function
    Provides network transport and security for Dynamic Data Exchange (DDE) for programs running on the same computer or on different computers.
    Status
    This service is safe to disable, if there is no such need for your Windows XP.

  29. Network DDE DSDM

    Function
    Manages Dynamic Data Exchange (DDE) network shares.
    Status
    Disable this service, if you don't use DDE network shares.

  30. Network Location Awareness (NLA)

    Function
    Collects and stores network configuration and location information and notifies applications when this information changes.
    Status
    Enable if this service, if your Windows XP has Internet Connection Sharing or Internet Connection Firewall enabled.

  31. NT LM Security Support Provider

    Function
    Provides security to remote procedure call (RPC) programs that use transports other than named pipes.
    Status
    You may enable this service, if your Windows XP needs to log on to pre-Windows 2000 computers or domains

  32. Performance Logs and Alerts

    Function
    Collects performance data from local or remote computers, based on pre-configured schedule parameters, then writes the data to a log or triggers an alert.
    Status
    Unless you are in the midst of fine tuning Windows XP, you may safely disable this service to free up system resources. This service has potential to impact Windows XP performance after running for some times.

  33. Plug and Play

    Function
    Enables a computer to recognize and adapt to hardware changes with little or no user input.
    Status
    This service should be enabled at all time. Disable it will cause Windows XP becomes unstable.

  34. Portable Media Serial Number

    Function
    Retrieves serial number of any portable media player connected to Windows XP.
    Status
    Disable this service will cause protected content unable to download to the device.

  35. Print Spooler

    Function
    Manages print queues and load files to memory for later printing.
    Status
    You may safely disable it, if you don't have a printer attached to Windows XP.

  36. Protected Storage

    Function
    Provides protected storage for sensitive data, such as private keys, to prevent access by unauthorized services, processes, or users.
    Status
    This service should be enabled at all time.

  37. QoS RSVP

    Function
    Provides network signaling and local traffic-control setup functionality for QoS-aware programs (Quality of Service) and control applets.
    Status
    You may enable this service, if you're using QoS aware applications.

  38. Remote Access Auto Connection Manager

    Function
    Creates a connection to a remote network whenever a program references a remote DNS or NetBIOS name or address.
    Status
    This service should be enabled at all time, in order Windows XP to communicate successfully over the network.

  39. Remote Access Connection Manager

    Function
    Manages dial-up and virtual private network (VPN) connections from your Windows XP to the Internet or other remote networks.
    Status
    This service should be enabled at all time.

  40. Remote Desktop Help Session Manager

    Function
    Manages and controls Remote Assistance.
    Status
    You may safely disable this service, if you don't want remote users to access to your Windows XP via Remote Desktop.

  41. Remote Procedure Call (RPC)

    Function
    Allows processes to communicate internally and across the network with each other.
    Status
    Don't ever disable this service! Disable this service will cause Windows XP fail to boot up.

  42. Remote Procedure Call (RPC) Locator

    Function
    Manages the RPC name service database, which is similar to DNS service for TCP/IP.
    Status
    This is also a critical service, which should be turned on at all time.

  43. Remote Registry

    Function
    Enables remote users to modify your Windows XP registry settings.
    Status
    Editing Windows Registry is dangerous! Unless you could justify the reason of enabling this service, Remote Registry service should be disabled whenever possible.

  44. Removable Storage

    Function
    Manages and catalogs removable storage media (such as USB mass storage drive) and operates automated removable media devices.
    Status
    This service should be enabled if you frequently attaching removable storage media to Windows XP.

  45. Routing and Remote Access

    Function
    Enables multiprotocol LAN-to-LAN, LAN-to-WAN, virtual private network (VPN), and network address translation (NAT) routing services for clients and servers on the network.
    Status
    Unless you're running Windows XP as server, this service is safe to disabled at most of time, for most Windows XP users.

  46. Secondary Logon

    Function
    Enables starting processes under alternate credentials.
    Status
    Disable this service will disable Run As features.

  47. Security Accounts Manager

    Function
    Stores security information for local user accounts.
    Status
    Disable this service will cause Group Policy objects, DHCP, etc, to fail functioning.

  48. Server

    Function
    Allows the sharing of Windows XP resources, such as files and printers, as well as named pipe communication.
    Status
    If you don't want remote users access to Windows XP resources, or attack via Windows XP hidden share (such as C$, D$, IPC$, etc), you may want to disable this service at all time.

  49. Shell Hardware Detection

    Function
    Provides notifications for AutoPlay hardware events.
    Status
    If you don't want Windows XP automatically pop up auto-play dialog box, you could safely disable this service.

  50. Smart Card

    Function
    Manages access to smart cards read by Windows XP.
    Status
    There is no reason to enable this service, if you don't have smart card reader attached to Windows XP.

  51. SSDP Discovery

    Function
    Used to detect UPnP devices found on the network.
    Status
    Disable this service, if you don't have UPNP devices attached to the network.

  52. System Event Notification

    Function
    Tracks system events such as Windows logon, network, and power events. Notifies COM+ Event System subscribers of these events.
    Status
    This service should be enabled at all time, especially Windows XP powered laptop (to receive battery related events).

  53. System Restore

    Function
    Performs system restore functions, such as saving periodic checkpoints.
    Status
    This is one of the system resouce sucker. Although, it is useful in the case of system failure. If you can tolerate with system failure or you could restore Windows XP to functioning state via Norton Ghost image, then you may safe to disable this service.

  54. Task Scheduler

    Function
    Configure and schedule automated tasks on Windows XP.
    Status
    Disable this service will disable scheduled tasks from running automatically.

  55. TCP/IP NetBIOS Helper

    Function
    Provides support for NetBIOS over TCP/IP and NetBIOS name lookups.
    Status
    This service could be safely disabled, if you don't share Windows XP resources.

  56. Telephony

    Function
    Provides Telephony API (TAPI) support for programs that control telephony devices and IP-based voice connections.
    Status
    If you don't have a modem attached, or connect to Internet via modem, you may safely disable this service.

  57. Telnet

    Function
    Enables remote users to log on to Windows XP and run programs, via various TCP/IP Telnet clients
    Status
    There is no obvious reason to enable this service, especially if you don't want remote users access to Windows XP.

  58. Terminal Services

    Function
    Allows multiple users to connect interactively to a Windows XP.
    Status
    You may safely disable this service, if you don't allow remote users access to Windows XP.

  59. Themes

    Function
    Provides user experience theme management.
    Status
    If you are using Windows Classic theme, you can safely disable this service to boost Windows XP performance.

  60. Uninterruptible Power Supply

    Function
    Manages uninterruptible power supply (UPS) connected to the Windows XP.
    Status
    No reason to turn on this services, if there is no UPS attached to Windows XP.

  61. Universal Plug and Play Device Host

    Function
    Provides support to host Universal Plug and Play devices.
    Status
    If you disable SSDP Discovery service, you may safely disable this service as well.

  62. Volume Shadow Copy

    Function
    Manages and implements volume shadow copies used for backup and other purposes.
    Status
    You may safely disable this service, if you don't rely on Windows Backup.

  63. WebClient

    Function
    Enables Windows-based programs to create, access, and modify Internet-based files.
    Status
    This service can be safely disabled, if there is no such need.

  64. Windows Audio

    Function
    Manages audio devices for Windows-based programs.
    Status
    Disable this service, if you don't want your Windows XP to speak at all!

  65. Windows Image Acquisition

    Function
    Provides image acquisition services for scanners and cameras.
    Status
    No harm to disable this service, if there is no such need.

  66. Windows Installer

    Function
    Adds, modifies, and removes applications provided as a Windows Installer (*.msi) package.
    Status
    This service should be enabled at all time, in order to perform Windows update.

  67. Windows Management Instrumentation

    Function
    Provides a common interface and object model to access management information about operating system, devices, applications and services.
    Status
    This service is critical to Windows XP, and should be enabled at all time.

  68. Windows Management Instrumentation Driver Extensions

    Function
    Monitors all drivers and event trace providers that are configured to publish Windows Management Instrumentation or event trace information.
    Status
    This service is not as critical as the Windows Management Instrumentation service, but is worth to enable at all time.

  69. Windows Time

    Function
    Uses NTP protocol to synchronize Windows XP local time with NTP server.
    Status
    Enable this service, if you want to synchronize Windows XP time with a NTP server.

  70. Wireless Zero Configuration

    Function
    Automatically configured WIFI (802.11) network adapters.
    Status
    This service should be enabled on laptop that supports WIFI connection.

  71. WMI Performance Adapter

    Function
    Provides performance library information from Windows Management Instrumentation (WMI) providers to clients on the network.
    Status
    This service should be enabled at all time.

  72. Workstation

    Function
    Creates and maintains client network connections to remote servers.
    Status
    This service should be enabled, when running Windows XP on a network environment.

Read more...

Telnet Applications

source-www.telnet.org

Telnet Applications
If you're looking for a telnet app, try one of these:
Linux, Unix, Mac OS X, etc.
Most Unix-like operating system distributions come with telnet client and a telnet daemon/server. Check with your distribution's documentation for more details.

Cross Platform / Web / Flash / Java
flashterm_ -- http://www.flashterm.com/
SwitchTermJ -- http://www.cyberacc.com/switchtermj.aspx
SyncTERM -- http://syncterm.bbsdev.net/
Mac OS 9 and lower
Better Telnet -- http://www.cstone.net/~rbraun/mac/telnet/
dataComet -- http://www.databeast.com/
NCSA Telnet -- ftp://ftp.ncsa.uiuc.edu/Mac/Telnet/
Nifty Telnet -- http://andrew2.andrew.cmu.edu/dist/niftytelnet.html
Pro TERM -- http://www.intrec.com

Windows 95/98/NT/2000
AbsoluteTelnet -- http://www.celestialsoftware.net/
Alpha Communicator -- http://www.omnicomtech.com/products/alphacom.php3
Anzio Lite -- http://www.anzio.com
CommNet and Secure CommNet -- http://www.radient.com
CRT -- http://www.vandyke.com
EasyTerm -- http://www.arachnoid.com/easyterm/
GTW420 -- http://www.gtw420.com/
HyperTerminal Private Edition -- http://www.hilgraeve.com/htpe.html
Intelliterm (TN3270 and TN5250) -- http://www.terminal-emulator-telnet-3270-5250-tn5250-tn3270.com/
Intelliterm (VT220, VT320, VT420) -- http://www.terminal-emulation-vt100-vt220-vt420.com/
J-Term -- http://www.jonesautomation.com/jterm.html
J-Term Pro -- http://www.jonesautomation.com/jtermpro.html
KevTerm -- http://www.geocities.com/SiliconValley/Network/1027
Koalaterm -- http://www.foxitsoftware.com/mkt/kt_intro.php
Mocha W32 Telnet -- http://www.mochasoft.dk
NetTerm -- http://www.securenetterm.com
Passport -- http://www.zephyrcorp.com
PowerTerm InterConnect/32 -- http://ericom.com
PowerVT -- http://www.dart.com/
Putty -- http://www.chiark.greenend.org.uk/~sgtatham/putty/
QVT/Term -- http://cws.internet.com/file/11668.htm
SecureCRT -- http://www.vandyke.com
TelStar -- http://www.innersystem.com/
Tera Term -- http://hp.vector.co.jp/authors/VA002416/teraterm.html
TN3270 Plus -- http://www.sdisw.com.
ZOC -- http://www.emtec.com

Read more...

How Linux boots

How Linux boots

As it turns out, there isn't much to the boot process:

1. A boot loader finds the kernel image on the disk, loads it into memory, and starts it.
2. The kernel initializes the devices and its drivers.
3. The kernel mounts the root filesystem.
4. The kernel starts a program called init.
5. init sets the rest of the processes in motion.
6. The last processes that init starts as part of the boot sequence allow you to log in.

Identifying each stage of the boot process is invaluable in fixing boot problems and understanding the system as a whole. To start, zero in on the boot loader, which is the initial screen or prompt you get after the computer does its power-on self-test, asking which operating system to run. After you make a choice, the boot loader runs the Linux kernel, handing control of the system to the kernel.

There is a detailed discussion of the kernel elsewhere in this book from which this article is excerpted. This article covers the kernel initialization stage, the stage when the kernel prints a bunch of messages about the hardware present on the system. The kernel starts init just after it displays a message proclaiming that the kernel has mounted the root filesystem:

VFS: Mounted root (ext2 filesystem) readonly.

Soon after, you will see a message about init starting, followed by system service startup messages, and finally you get a login prompt of some sort.

NOTE On Red Hat Linux, the init note is especially obvious, because it "welcomes" you to "Red Hat Linux." All messages thereafter show success or failure in brackets at the right-hand side of the screen.

Most of this chapter deals with init, because it is the part of the boot sequence where you have the most control.
init

There is nothing special about init. It is a program just like any other on the Linux system, and you'll find it in /sbin along with other system binaries. The main purpose of init is to start and stop other programs in a particular sequence. All you have to know is how this sequence works.

There are a few different variations, but most Linux distributions use the System V style discussed here. Some distributions use a simpler version that resembles the BSD init, but you are unlikely to encounter this.

Runlevels

At any given time on a Linux system, a certain base set of processes is running. This state of the machine is called its runlevel, and it is denoted with a number from 0 through 6. The system spends most of its time in a single runlevel. However, when you shut the machine down, init switches to a different runlevel in order to terminate the system services in an orderly fashion and to tell the kernel to stop. Yet another runlevel is for single-user mode, discussed later.

The easiest way to get a handle on runlevels is to examine the init configuration file, /etc/inittab. Look for a line like the following:

id:5:initdefault:

This line means that the default runlevel on the system is 5. All lines in the inittab file take this form, with four fields separated by colons occurring in the following order:
# A unique identifier (a short string, such as id in the preceding example)
# The applicable runlevel number(s)
# The action that init should take (in the preceding example, the action is to set the default runlevel to 5)
# A command to execute (optional)

There is no command to execute in the preceding initdefault example because a command doesn't make sense in the context of setting the default runlevel. Look a little further down in inittab, until you see a line like this:

l5:5:wait:/etc/rc.d/rc 5

This line triggers most of the system configuration and services through the rc*.d and init.d directories. You can see that init is set to execute a command called /etc/rc.d/rc 5 when in runlevel 5. The wait action tells when and how init runs the command: run rc 5 once when entering runlevel 5, and then wait for this command to finish before doing anything else.

There are several different actions in addition to initdefault and wait, especially pertaining to power management, and the inittab(5) manual page tells you all about them. The ones that you're most likely to encounter are explained in the following sections.

respawn

The respawn action causes init to run the command that follows, and if the command finishes executing, to run it again. You're likely to see something similar to this line in your inittab file:

1:2345:respawn:/sbin/mingetty tty1

The getty programs provide login prompts. The preceding line is for the first virtual console (/dev/tty1), the one you see when you press ALT-F1 or CONTROL-ALT-F1. The respawn action brings the login prompt back after you log out.

ctrlaltdel

The ctrlaltdel action controls what the system does when you press CONTROL-ALT-DELETE on a virtual console. On most systems, this is some sort of reboot command using the shutdown command.

sysinit

The sysinit action is the very first thing that init should run when it starts up, before entering any runlevels.

How processes in runlevels start

You are now ready to learn how init starts the system services, just before it lets you log in. Recall this inittab line from earlier:

l5:5:wait:/etc/rc.d/rc 5

This small line triggers many other programs. rc stands for run commands, and you will hear people refer to the commands as scripts, programs, or services. So, where are these commands, anyway?

For runlevel 5, in this example, the commands are probably either in /etc/rc.d/rc5.d or /etc/rc5.d. Runlevel 1 uses rc1.d, runlevel 2 uses rc2.d, and so on. You might find the following items in the rc5.d directory:

S10sysklogd S20ppp S99gpm
S12kerneld S25netstd_nfs S99httpd
S15netstd_init S30netstd_misc S99rmnologin
S18netbase S45pcmcia S99sshd
S20acct S89atd
S20logoutd S89cron

The rc 5 command starts programs in this runlevel directory by running the following commands:

S10sysklogd start
S12kerneld start
S15netstd_init start
S18netbase start
...
S99sshd start

Notice the start argument in each command. The S in a command name means that the command should run in start mode, and the number (00 through 99) determines where in the sequence rc starts the command.

The rc*.d commands are usually shell scripts that start programs in /sbin or /usr/sbin. Normally, you can figure out what one of the commands actually does by looking at the script with less or another pager program.

You can start one of these services by hand. For example, if you want to start the httpd Web server program manually, run S99httpd start. Similarly, if you ever need to kill one of the services when the machine is on, you can run the command in the rc*.d directory with the stop argument (S99httpd stop, for instance).

Some rc*.d directories contain commands that start with K (for "kill," or stop mode). In this case, rc runs the command with the stop argument instead of start. You are most likely to encounter K commands in runlevels that shut the system down.

Adding and removing services

If you want to add, delete, or modify services in the rc*.d directories, you need to take a closer look at the files inside. A long listing reveals a structure like this:

lrwxrwxrwx . . . S10sysklogd -> ../init.d/sysklogd
lrwxrwxrwx . . . S12kerneld -> ../init.d/kerneld
lrwxrwxrwx . . . S15netstd_init -> ../init.d/netstd_init
lrwxrwxrwx . . . S18netbase -> ../init.d/netbase
...

The commands in an rc*.d directory are actually symbolic links to files in an init.d directory, usually in /etc or /etc/rc.d. Linux distributions contain these links so that they can use the same startup scripts for all runlevels. This convention is by no means a requirement, but it often makes organization a little easier.

To prevent one of the commands in the init.d directory from running in a particular runlevel, you might think of removing the symbolic link in the appropriate rc*.d directory. This does work, but if you make a mistake and ever need to put the link back in place, you might have trouble remembering the exact name of the link. Therefore, you shouldn't remove links in the rc*.d directories, but rather, add an underscore (_) to the beginning of the link name like this:

mv S99httpd _S99httpd

At boot time, rc ignores _S99httpd because it doesn't start with S or K. Furthermore, the original name is still obvious, and you have quick access to the command if you're in a pinch and need to start it by hand.

To add a service, you must create a script like the others in the init.d directory and then make a symbolic link in the correct rc*.d directory. The easiest way to write a script is to examine the scripts already in init.d, make a copy of one that you understand, and modify the copy.

When adding a service, make sure that you choose an appropriate place in the boot sequence to start the service. If the service starts too soon, it may not work, due to a dependency on some other service. For non-essential services, most systems administrators prefer numbers in the 90s, after most of the services that came with the system.

Linux distributions usually come with a command to enable and disable services in the rc*.d directories. For example, in Debian, the command is update-rc.d, and in Red Hat Linux, the command is chkconfig. Graphical user interfaces are also available. Using these programs helps keep the startup directories consistent and helps with upgrades.

HINT: One of the most common Linux installation problems is an improperly configured XFree86 server that flicks on and off, making the system unusable on console. To stop this behavior, boot into single-user mode and alter your runlevel or runlevel services. Look for something containing xdm, gdm, or kdm in your rc*.d directories, or your /etc/inittab.

Controlling init

Occasionally, you need to give init a little kick to tell it to switch runlevels, to re-read the inittab file, or just to shut down the system. Because init is always the first process on a system, its process ID is always 1.

You can control init with telinit. For example, if you want to switch to runlevel 3, use this command:

telinit 3

When switching runlevels, init tries to kill off any processes that aren't in the inittab file for the new runlevel. Therefore, you should be careful about changing runlevels.

When you need to add or remove respawning jobs or make any other change to the inittab file, you must tell init about the change and cause it to re-read the file. Some people use kill -HUP 1 to tell init to do this. This traditional method works on most versions of Unix, as long as you type it correctly. However, you can also run this telinit command:

telinit q

You can also use telinit s to switch to single-user mode.

Shutting down

init also controls how the system shuts down and reboots. The proper way to shut down a Linux machine is to use the shutdown command.

There are two basic ways to use shutdown. If you halt the system, it shuts the machine down and keeps it down. To make the machine halt immediately, use this command:

shutdown -h now

On most modern machines with reasonably recent versions of Linux, a halt cuts the power to the machine. You can also reboot the machine. For a reboot, use -r instead of -h.

The shutdown process takes several seconds. You should never reset or power off a machine during this stage.

In the preceding example, now is the time to shut down. This argument is mandatory, but there are many ways of specifying it. If you want the machine to go down sometime in the future, one way is to use +n, where n is the number of minutes shutdown should wait before doing its work. For other options, look at the shutdown(8) manual page.

To make the system reboot in 10 minutes, run this command:

shutdown -r +10

On Linux, shutdown notifies anyone logged on that the machine is going down, but it does little real work. If you specify a time other than now, shutdown creates a file called /etc/nologin. When this file is present, the system prohibits logins by anyone except the superuser.

When system shutdown time finally arrives, shutdown tells init to switch to runlevel 0 for a halt and runlevel 6 for a reboot. When init enters runlevel 0 or 6, all of the following takes place, which you can verify by looking at the scripts inside rc0.d and rc6.d:

1. init kills every process that it can (as it would when switching to any other runlevel).

# The initial rc0.d/rc6.d commands run, locking system files into place and making other preparations for shutdown.
# The next rc0.d/rc6.d commands unmount all filesystems other than the root.
# Further rc0.d/rc6.d commands remount the root filesystem read-only.
# Still more rc0.d/rc6.d commands write all buffered data out to the filesystem with the sync program.
# The final rc0.d/rc6.d commands tell the kernel to reboot or stop with the reboot, halt, or poweroff program.

The reboot and halt programs behave differently for each runlevel, potentially causing confusion. By default, these programs call shutdown with the -r or -h options, but if the system is already at the halt or reboot runlevel, the programs tell the kernel to shut itself off immediately. If you really want to shut your machine down in a hurry (disregarding any possible damage from a disorderly shutdown), use the -f option.

Read more...

Have Notepad in send to

Have Notepad In Send To



Many apply a registry tweak to have notepad as an option for unknown file types. We frequently see such files which are actually just text, but named with some odd file-extension. And then, some suspicious files which we want to make sure what the contents are. Well, in such cases where the registry tweak is applied, the downside happens to be that even some known files get associated with notepad - but no, all we want is to be able to open a file with notepad - the association part in such cases is unwanted interference. Also, notepad becomes a permanent fixture on the right-click menu - which is again an annoyance.

So what we do, is to have notepad as an option in the Send-To options, of the right-click menu in explorer. It fulfils the purpose to perfection (atleast, in my case). Here's what we do:

1. right-click desktop, choose "New >> Shortcut"
2. Type the location of the item - "notepad" - (that's all, no need to give path)
3. Next >> type name for shortcut - "Edit with Notepad"
4. Click finish
5. Now right-click this shortcut on the desktop, and choose properties.
6. Confirm that the "target" and "start in" fields are using variables - "%windir%\system32\notepad.exe" - (absolute paths will be problematic if you use this .LNK on machines other than your own)
7. Now, browse to "%UserProfile%\SendTo" in explorer (which means "C:\Documents and Settings\User_Name\SendTo\" folder)
8. And copy the "Edit with Notepad.lnk" file which you already created, to that folder.
9. So now, you can right-click on ANY file-type, and be offered an option to open with notepad, from the SendTo sub-menu.

So now, you just right-click on an .nfo or .eml or .diz file (which are associated with other programs, and are sometimes just plain-text files), and choose "Send To >> Edit with Notepad" and it will open in notepad!
No more botheration of applying registry tweaks for something as simple as this.

Read more...

Getting started with Linux(for noobs)

I. What is Linux?
II. Trying it out
III. Installing
IV. What to do now
V. The Console

Intro:
This tutorial is written with the total Linux n00b in mind.
I've seen too many n00bs get totally left in the dark by asking what
the best distro is. They seem to only get flooded with too many
answers in so short a time. I'm a little bit of a n00b too, so I know
how it feels. I will cover a grand total of two basic distros. You may
learn to strongly prefer other ones (I do!) but this is just to get
you started. I touch on a number of topics that would be impossible to
go into in depth in one tutorial, so I encourage you to actively seek
out more about the concepts I make reference to.


I. What is Linux?

Linux is basically an operating system (OS for short). The Windows
machine you're (probably) using now uses the Mcft Windows
operating system.

Ok, so what's so different about Linux?

Linux is part of a revolutionary movement called the open-source
movement. The history and intricacies of that movement are well beyond
the scope of this tutorial, but I'll try and explain it simply. Open
source means that the developers release the source code for all their
customers to view and alter to fit what they need the software to do,
what they want the software to do, and what they feel software should
do. Linux is a programmer?s dream come true, it has the best compilers,
libraries, and tools in addition to its being open-source. A
programmer's only limit then, is his knowledge, skill, time, and
resolve.

What is a distro?

A distro is short for a distribution. It's someone's personal
modification or recreation of Linux.

What do you mean by distros? I just want Linux!

Since Linux is open source, every developer can write his own version.
Most of those developers release their modifications, or entire
creations as free and open source. A few don't and try to profit from
their product, which is a topic of moral debate in the Linux world.
The actual Linux is just a kernel that serves as a node of
communication between various points of the system (such as the CPU,
the mouse, the hard drive etc.). In order to use this kernel, we must
find a way to communicate with it. The way we communicate is with a
shell. Shells will let us enter commands in ways that make sense to
us, and send those commands to the kernel in ways that makes sense to
it. The shell most Linux's use it the BASH shell (Bourne Again SHell).
The kernel by itself will not do, and just a shell on top of the kernel
won?t either for most users; we are then forced to use a distribution.

What distro is best?

This is not the question you want to ask a large number of people at
one time. This is very much like asking what kind of shoe is best,
you'll get answers anywhere from running shoes, hiking boots, cleats,
to wingtips. You need to be specific about what you plan on using
Linux for, what system you want to use it on, and many other things. I
will cover two that are quick and easy to get running. They may not be
the best, or the quickest, or the easiest, or the most powerful, but
this is a guide for getting started, and everyone has to start
somewhere.

How much does it cost?

computer + electricity + internet + CD burner and CDs = Linux
I'll let you do your own math.
Note however that a few do charge for their distros, but they aren't
all that common, and can be worked around. Also, if you lack internet
access or a CD burner or CDs or you just want to, you can normally
order CDs of the distro for a few dollars apiece.



II. Trying it out.

Wouldn't it stink if you decide to wipe out your hard drive and install
Linux as the sole operating system only to learn that you don't know
how to do anything and hate it? Wouldn?t it be better to take a test
drive? 95 out of a 100 of you know where I'm heading with this section
and can therefore skip it. For those of you who don't know, read on.

There are many distros, and most distros try to have something that
makes them stand out. Knoppix was the first live-CD distro. Although
most of the other main distros have formed their own live-CDs, Knoppix
is still the most famous and I will be covering how to acquire it.

A live-CD distro is a distribution of Linux in which the entire OS can
be run off of the CD-ROM and your RAM. This means that no installation
is required and the distro will not touch your hard disk or current OS
(unless you tell it to). On bootup, the CD will automatically detect
your hardware and launch you into Linux. To get back to Windows, just
reboot and take the CD out.

Go to the Knoppix website (www.knoppix.com). Look around some to get
more of an idea on what Knoppix is. When you're ready, click Download.
You'll be presented with a large amount of mirrors, some of which have
ftp and some of which have http also.

note: the speed of the mirrors vary greatly, and you may want to
change mirrors should your download be significantly slow.

Choose a mirror. Read the agreement and choose accept. You'll probably
want to download the newest version and in your native language (I'll
assume English in this tutorial). So choose the newest file ending in
-EN.iso

note: you might want to also verify the md5 checksums after the
download, if you don't understand this, don't worry too much. You just
might have to download it again should the file get corrupted (you'll
have to anyway with the md5). Also, a lot of times a burn can be
botched for who-knows what reason. If the disk doesn?t work at all,
try a reburn.

Once the .iso file is done downloading, fire up your favorite
CD-burning software. Find the option to burn a CD image (for Nero, this
is under copy and backup) and burn it to a disk. Make sure you don't
just copy the .iso, you have to burn the image, which will unpack all
the files onto the CD.

Once the disk is done, put it in the CD-ROM drive and reboot the
computer. While your computer is booting, enter CMOS (how to get to
CMOS varies for each computer, some get to it by F1 or F2 or F3, etc.)
Go to the bootup configuration and place CD-ROM above hard disk. Save
changes and exit. Now, Knoppix will automatically start. You will be
presented with a boot prompt. Here you can input specific boot
parameters (called cheatcodes), or just wait and let it boot up using
the default.

note: Sometimes USB keyboards do not work until the OS has somewhat
booted up. Once you?re actually in Knoppix, your USB keyboard should
work, but you may not be able to use cheatcodes. If you need to,
attach a PS/2 keyboard temporarily. Also, if a particular aspect of
hardware detection does not work, look for a cheatcode to disable it.
Cheatcodes can be found on the Knoppix website in text format (or in
HTML at www.knoppix.net/docs/index.php/CheatCodes).

Upon entering the KDE desktop environment, spend some time exploring
around. Surf the web, get on IM, play some games, explore the
filesystem, and whatever else seems interesting. When your done, open
up the console (also called terminal, xterm, konsole, or even shell)
and get ready for the real Linux. See section V for what to do from
here.

note: to function as root (or the superuser) type su.


It's not entirely necessary that you are a console wizard at this point
(although you will need to be sooner or later), but a little messing
around wont hurt.

Just as there are many Linux distros, so there are also many types of
Knoppix. I won?t go into using any of them, but they should all be
somewhat similar. Some of them include: Gnoppix, Knoppix STD, Morphix,
and PHLAK. Other distros also have live-CDs.

III. Installing

I will guide you through the installation of Fedora Core 2. The reason
I chose Fedora is because it contains the Anaconda installer, which is
a very easy installer.

Download the discs from here:
http://download.fedora.redhat.com/pub/fedo...ore/2/i386/iso/
If the link doesn?t work, then go to www.redhat.com and navigate your
way to downloading Fedora (odds are your architecture is i386).
You will want to download the FC2-i386-disc1.iso and burn it using the
method for Knoppix. Do the same for all the discs.

Note: do NOT download the FC2-i386-SRPMS-disc1.iso files.

Now, once you?re ready, insert disc 1 into the drive and reboot.

The installer should come up automatically (if not, then see the
Knoppix section on CMOS).

Note: installer may vary depending on version. Follow directions best
you can using your best judgement.

1. Language: choose English and hit enter
2. Keyboard: choose us (probably) and hit enter
3. Installation media: choose local CDROM (probably) and hit enter
4. CD test: you can choose to test or skip
5. Intro: click next
6. Monitor: choose your monitor to the best of your ability, if you?re unsure, choose on of the generic ones
7. Installation type: choose which ever you want (default should be fine)
8. Partition: choose to automatically partition (unless you know what you?re doing)
9. Partition: the default partitions should suffice
10. Boot loader: choose your boot loader (grub for default)
11. Network settings: choose the correct settings for your network (generally, don?t mess with anything unless you know what you?re doing)
12. Firewall: you can choose a firewall if you want to
13. Language support: choose any additional language support you want
14. Time zone: pick your time zone
15. Root password: set your root password (root is the admin, or superuser; you want it to be very secure)
16. Packages: choose which packages you want to install. For hard drives over 10 gigs, you can go ahead and choose all
packages (depending on how much disk space you plan on taking up later, note that most everything you?ll need is a package: the exception
being large media files). You will generally want to install all the packages you think you?ll ever need. Two desktop environments aren?t necessary.
Make sure you have at least one and the X window system! (if you want a GUI that is). I suggest you get all the servers too.

Note: Knoppix uses the KDE Desktop environment

17. Make sure everything is all right, and install
18. You can create a boot disk if you want

Note: Desktop environments might have a set-up once you enter them

IV What to do now

Now that you have a Linux set-up and running, there are many paths you
can head down. First, you should explore your GUI and menus. Browse
the web with Mozilla, get on IM with GAIM, play games, add/delete
users, check out OpenOffice, and anything else that might be part of
your daily use. Also, set up a few servers on your computer to play
around with, specifically SMTP (*wink*wink*), FTP (vsftp is a good
one), and either telnet or SSH (OpenSSH is a good one). The setup and
use of these are beyond the scope of this tutorial, but researching
them could prove to be very educational.

The filesystem
The Linux (and Unix) filesystem is different from the normal Windows
that you?re used to. In Windows, your hard drive is denoted ?C:\? (or
whatever). In Linux, it is called the root directory and is denoted
?/?. In the / directory, there are several default folders, including
dev (device drivers) mnt (mount) bin (binaries) usr (Unix System
Resources) home, etc, and others. I encourage you to explore around
the whole file system (see section V) and research more.

Once you are well situated, it?s time to get into the heart and power
of Linux: the console. The next session will guide you through it and
set you on the path to finding out how to do stuff for yourself. You
will (probably) want to start learning to rely less and less on the
GUI and figure out how to do everything through the console (try
launching all your programs from the console, for example).

V. The Console

The Console might look familiar to DOS if you?ve ever used it. The
prompt should look something like the following:

AvatharTri@localhost avathartri$

With the blinking _ following it. This can vary greatly as it is fully
customizable. Let?s get started with the commands.

First, let?s explore the file system. The command ls will "list" the
files in the current directory. Here?s an example:

AvatharTri@localhost avathartri$ ls

It should then display the contents of the current directory if there
are any. Almost all commands have options attached to them. For
example, using the -l option, which is short for "long" will display
more information about the files listed.

AvatharTri@localhost avathartri$ ls -l

We will get into how to find out the options for commands and what
they do later.

The second command to learn will be the cd command, or "change
directory". To use it, you type cd followed by a space and the
directory name you wish to go into. In Linux, the top directory is /
(as opposed to C:\ in Windows). Let?s get there by using this command:

AvatharTri@localhost avathartri$ cd /
AvatharTri@localhost /$

Now, we are in the top directory. Use the ls command you learned
earlier to see everything that?s here. You should see several items,
which are directories. Now, let?s go into the home directory:

AvatharTri@localhost /$ cd home
AvatharTri@localhost home$

And you can now ls and see what?s around. In Linux there are some
special symbol shortcuts for specific folders. You can use these
symbols with cd, ls, or several other commands. The symbol ~ stands
for your home folder. One period . represents the directory your
currently in. Two periods .. represent the directory immediately above
your own. Here?s an example of the commands:

AvatharTri@localhost home$ cd ~
AvatharTri@localhost avathartri$

This moved us to our user?s personal directory.

AvatharTri@localhost avathartri$ cd .
AvatharTri@localhost avathartri$ cd ..
AvatharTri@localhost home$

The cd .. moved us up to the home directory.
As you?ve probably noticed by now, the section behind the prompt
changes as you change folders, although it might not always be the
case as it?s up to the personal configuration.

You can use these symbols with the ls command also to view what is in
different folders:

AvatharTri@localhost home$ ls ~
AvatharTri@localhost home$ ls ..

And you can view what is in a folder by specifying its path:

AvatharTri@localhost home$ ls /
AvatharTri@localhost home$ ls /home

The last command we will cover as far as finding your way around the
filesystem is the cat command. The cat command will show the contents
of a file. Find a file by using the cd and ls commands and then view
its contents with the cat command.

AvatharTri@localhost home$ cd [directory]
AvatharTri@localhost [directory]$ ls
AvatharTri@localhost [directory]$ cat [filename]

Where [directory] is the directory you want to view and [filename] is
the name of the file you want to view. Omit the brackets. Now, if the
file you viewed was a text file, you should see text, but if it wasn?t,
you might just see jumbled garbage, but this is ok. If the file goes
by too fast and goes off the screen, don?t worry, we will get to how
to scroll through it later.

One of the most useful commands is the man command, which displays the
"manual" for the command you want to know more about. To learn more
about the ls command:

AvatharTri@localhost home$ man ls

And you will see the manual page for ls. It displays the syntax, a
description, options, and other useful tidbits of information. Use the
up and down arrows to scroll and press q to exit. You can view the
manual pages for any command that has one (most commands do). Try this
out with all the commands that you know so far:

AvatharTri@localhost home$ man cd
AvatharTri@localhost home$ man cat
AvatharTri@localhost home$ man man

One very crucial option to the man command is the -k option. This will
search the descriptions of manual pages for the word you specify. You
can use this to find out what command to do what you need to do. For
example, let?s say we want to use a text editor:

AvatharTri@localhost home$ man -k editor

And you should see a list of apps with a short description and the
word "editor" in the description.

With a blank prompt, you can hit tab twice for Linux to display all
the possible commands. For Linux to display all the commands beginning
with a certain letter or series of letters, type those letters and hit
tab twice.

Note: This is actually a function of BASH and not Linux, but BASH is
the default Linux shell.

Now that you know a little about moving around the filesystem and
viewing manual pages, there is one more trick that we will cover to
help you out. Remember how the man pages were scrollable as in you
could use the arrow keys to scroll up and down? That is because the
man pages use something called the less pager. We?re not going to go
into what this does exactly and how it works, but that?s definitely
something that you will want to look up. Here?s how to use the less
pager with a file:

AvatharTri@localhost home$ cat [filename] | less

That uses something called a pipe. The line is the vertical line above
enter on your keyboard. Briefly, what this does is take the output
from the cat command, and stick it in the less pager. By doing this,
you can view files that would normally run off the screen and scroll
up and down.

Some final commands to check out:

mkdir - make directories
cp - copy file
mv - move file
rm - remove file
rmdir - remove directory
grep - search a file for a keyword
pwd - display current working directory
top - display system resources usage (kill the program with control + c)

Read more...

Firefox speed tweaks

Yes, firefox is already pretty damn fast but did you know that you can tweak it and improve the speed even more?

That's the beauty of this program being open source.
Here's what you do:
In the URL bar, type “about:config” and press enter. This will bring up the configuration “menu” where you can change the parameters of Firefox.

Note that these are what I’ve found to REALLY speed up my Firefox significantly - and these settings seem to be common among everybody else as well. But these settings are optimized for broadband connections - I mean with as much concurrent requests we’re going to open up with pipelining… lol… you’d better have a big connection.

Double Click on the following settins and put in the numbers below - for the true / false booleans - they’ll change when you double click.

Code:
browser.tabs.showSingleWindowModePrefs – true
network.http.max-connections – 48
network.http.max-connections-per-server – 16
network.http.max-persistent-connections-per-proxy – 8
network.http.max-persistent-connections-per-server – 4
network.http.pipelining – true
network.http.pipelining.maxrequests – 100
network.http.proxy.pipelining – true
network.http.request.timeout – 300


One more thing… Right-click somewhere on that screen and add a NEW -> Integer. Name it “nglayout.initialpaint.delay” and set its value to “0”. This value is the amount of time the browser waits before it acts on information it receives. Since you’re broadband - it shouldn’t have to wait.

Now you should notice you’re loading pages MUCH faster now!

Read more...

Getting A 1gb Yahoo China Account

1. Sign for a yahoo ID... you can do this in my.yahoo.com. DO NOT check the automatically create an Email address
2. Clear ALL cookies
3. Activate mail account at cn.mail.yahoo.com
(you get 100Mb storage first *don't worry*), then sign-out
NOTE: FYI, the two boxes in the activation page is lastname and firstname

Upgrading to 1Gb Yahoo China Account
1. Sign-in to Yahoo Messenger, add a contact, sign-out
2. Go back to cn.mail.yahoo.com (all pages would be in Chinese)
3. Click the 1G orange label (graphic) *look at the lower right of the page*
4. Type-in your Yahoo ID and Password *look at the bottom of the page*
5. You'll go to two more Chinese pages (Just click the bottom centered label in the page)
6. Tadah!! Your upgraded to 1Gig and your default is English with Free POP3

There's no pesky graphic or flash ads at the moment... but your email add would be username[at]yahoo.com.cn

I think that's good enough for people without Gmail

Read more...

Change XP start button

Step 1 - Modify Explorer.exe File

In order to make the changes, the file explorer.exe located at C:\Windows needs to be edited. Since explorer.exe is a binary file it requires a special editor. For purposes of this article I have used Resource Hacker. Resource HackerTM is a freeware utility to view, modify, rename, add, delete and extract resources in 32bit Windows executables and resource files (*.res). It incorporates an internal resource script compiler and decompiler and works on Microsoft Windows 95/98/ME, Windows NT, Windows 2000 and Windows XP operating systems.

get this from h**p://delphi.icm.edu.pl/ftp/tools/ResHack.zip

The first step is to make a backup copy of the file explorer.exe located at C:\Windows\explorer. Place it in a folder somewhere on your hard drive where it will be safe. Start Resource Hacker and open explorer.exe located at C:\Windows\explorer.exe.

The category we are going to be using is "String Table". Expand it by clicking the plus sign then navigate down to and expand string 37 followed by highlighting 1033. If you are using the Classic Layout rather than the XP Layout, use number 38. The right hand pane will display the stringtable. We’re going to modify item 578, currently showing the word “start” just as it displays on the current Start button.

There is no magic here. Just double click on the word “start” so that it’s highlighted, making sure the quotation marks are not part of the highlight. They need to remain in place, surrounding the new text that you’ll type. Go ahead and type your new entry. In my case I used Click Me!

You’ll notice that after the new text string has been entered the Compile Script button that was grayed out is now active. I won’t get into what’s involved in compiling a script, but suffice it to say it’s going to make this exercise worthwhile. Click Compile Script and then save the altered file using the Save As command on the File Menu. Do not use the Save command – Make sure to use the Save As command and choose a name for the file. Save the newly named file to C:\Windows.


Step 2 – Modify the Registry

!!!make a backup of your registry before making changes!!!

Now that the modified explorer.exe has been created it’s necessary to modify the registry so the file will be recognized when the user logs on to the system. If you don’t know how to access the registry I’m not sure this article is for you, but just in case it’s a temporary memory lapse, go to Start (soon to be something else) Run and type regedit in the Open field. Navigate to:

HKEY_LOCAL_MACHINE\ SOFTWARE\ Microsoft\ Windows NT\ CurrentVersion\ Winlogon

In the right pane, double click the "Shell" entry to open the Edit String dialog box. In Value data: line, enter the name that was used to save the modified explorer.exe file. Click OK.

Close Registry Editor and either log off the system and log back in, or reboot the entire system if that’s your preference. If all went as planned you should see your new Start button with the revised text.

Read more...

Recover windows login password

Because of the security features built into Windows XP, it is virtually impossible to get back into the system without the password.
You have several options to try and get around this problem.


If you have access to another user account with administrator rights, you can use that account to change the password
of the account that is locked out. You can also use the default Administrator account that is built into Windows XP.


First you need to boot the system into Safe Mode.
1.Restart your system.
2. press the ( F8 ) key about 3 times a second.
3.You should get the Windows startup menu. Use the (Up or Down) arrow keys to highlight (SafeMode)
4.Press (Enter) on (Safe Mode), then press (Enter) on (Windows XP).
5.The system should boot to Safe Mode.


Once you are at the Account Log on Screen, click on the icon
for the user account with administrator rights, or click on the icon
for the administrators account.
Note: For Home the Administrator account isn't normally shown & in Safe Mode you have to press Ctrl+Alt+Delete keys twice to show.
For PRO you can do this in normal mode

When the system has booted to the desktop, use the following steps to change the accounts password.
1.Click Start, Control Panel, Administrative Tools.
2.Click Computer Management.
3.Double click Local Users and Groups, double click the folder Users.
4.Right click on the account name that is locked out, and click on Set Password.
5.You may get a warning message about changing the password, simply click proceed.
6.Leave the New Password box blank, also leave the Confirm Password box blank.
7.Click OK, and OK again.
8.Then close all Windows, reboot the system and try to log in.


There are also applications that can recover the password for you.
The following companies provide these applications at a cost.
iOpus® Password Recovery XP
LostPassword.com, .
Asterisk Password Recovery XP v1.89 .
Windows XP / 2000 / NT Key.


If the above information does not help in recovering the password, the only option left is to
format the hard drive then reinstall Windows and the system software.

Read more...

Basic C socket programming in UNIX for newbies

CONTENTS

=======================================



1. Introduction

2. Different types of Internet Sockets

3. Structures

4. Conversions

5. IP Addresses

6. Important Functions



6.1. socket()

6.2. bind()

6.3. connect()

6.4. listen()

6.5. accept()

6.6. send()

6.7. recv()

6.8. sendto()

6.9. recvfrom()

6.10. close()

6.11. shutdown()

6.12. gethostname()



7. Some words about DNS



8. A Stream Server Example



9. A Stream Client Example



10. Last Words



11. Copyright







1. INTRODUCTION

=======================================



Are you trying to learn c socket programming? Or do you think that it's hard stuff?

Well, then you must read this basic tutorial to get basic ideas and concepts and to start

to work with sockets. Don't expect to be a "socket programming master" after reading this

tutorial. You'll only be that if you practice and read a lot.







2. DIFFERENT TYPES OF INTERNET SOCKETS

=======================================



In the first place I must explain what a socket is. In a very simple way, a socket is a way

to talk to other computer. To be more precise, it's a way to talk to other computers using

standard Unix file descriptors. In Unix, every I/O actions are done by writing or reading

to a file descriptor. A file descriptor is just an integer associated with an open file and it

can be a network connection, a terminal, or something else.



About the different types of internet sockets, there are many types but I'll just describe two

of them - Stream Sockets (SOCK_STREAM) and Datagram Sockets (SOCK_DGRAM).



"And what are the differences between this two types?" you may ask. Here's the answer:



Stream Sockets - they're error free; if you send through the stream socket three

items "A,B,C", they will arrive in the same order - "A,B,C" ;

they use TCP ("Transmission Control Protocol") - this protocol

assures the items' order.



Datagram Sockets - they use UDP ("User Datagram Protocol"); they're connectionless

because you don't need to have an open connection as in Stream

Sockets - you build a packet with the destination information and

send it out.



A lot more could be explained here about this two kind of sockets, but I think this is enough

to get the basic concept of socket. Understanding what a socket is and this two types of

internet sockets is a good start, but you need to learn how to "work" with them. You'll learn

it in the next sections.





3. STRUCTURES

=======================================



The purpose of this section is not to teach you structures but to tell you how are they

used in C socket programming. If you don't know what a structure is, my advice is to read

a C Tutorial and learn it. For the moment, let's just say that a structure is a data type

that is an aggregate, that is, it contains other data types, which are grouped together into

a single user-defined type.



Structures are used in socket programming to hold information about the address.





The first structure is struct sockaddr that holds socket information.







struct sockaddr{

unsigned short sa_family; /* address family */

char sa_data[14]; /* 14 bytes of protocol address */

};







But, there's another structure (struct sockaddr_in) that help you to reference to the socket's

elements.







struct sockaddr_in {

short int sin_family; /* Address family */

unsigned short int sin_port; /* Port */

struct in_addr sin_addr; /* Internet Address */

unsigned char sin_zero[8]; /* Same size as struct sockaddr */

};







Note: sin_zero is set to all zeros with memset() or bzero() (See examples bellow).







The next structure is not very used but it is defined as an union.



As you can see in both examples bellow (Stream Client and Server Client) , when I declare for

example "client" to be of type sockaddr_in then I do client.sin_addr = (...)



Here's the structure anyway:





struct in_addr {

unsigned long s_addr;

};







Finally, I think it's better talk about struct hostent. In the Stream Client Example, you can

see that I use this structure. This structure is used to get remote host information.



Here it is:





struct hostent

{

char *h_name; /* Official name of host. */

char **h_aliases; /* Alias list. */

int h_addrtype; /* Host address type. */

int h_length; /* Length of address. */

char **h_addr_list; /* List of addresses from name server. */

#define h_addr h_addr_list[0] /* Address, for backward compatibility. */

};



This structure is defined in header file netdb.h.





In the beginning, this structures will confuse you a lot, but after you start to write some

lines, and after seeing the examples, it will be easier for you understanding them. To see

how you can use them check the examples (section 8 and 9).







4. CONVERSIONS

=======================================



There are two types of byte ordering: most significant byte and least significant byte.

This former is called "Network Byte Order" and some machines store their numbers internally

in Network Byte Order.



There are two types you can convert: short and long.

Imagine you want to convert a long from Host Byte Order to Network Byte Order. What would you

do? There's a function called htonl() that would convert it =) The following functions are

used to convert :



htons() -> "Host to Network Short"

htonl() -> "Host to Network Long"

ntohs() -> "Network to Host Short"

ntohl() -> "Network to Host Long"



You must be thinking why do you need this. Well, when you finish reading this document, it will

all seems easier =) All you need is to read and a lot of practice =)



An important thing, is that sin_addr and sin_port (from struct sockaddr_in) must be in Network

Byte Order (you'll see in the examples the functions described here to convert and you'll start

to understand it).



5. IP ADRESSES

=======================================



In C, there are some functions that will help you manipulating IP addresses. We'll talk about

inet_addr() and inet_ntoa() functions.





inet_addr() converts an IP address into an unsigned long. An example:



(...)



dest.sin_addr.s_addr = inet_addr("195.65.36.12");



(...)



/*Remember that this is if you've a struct dest of type sockaddr_in*/







inet_ntoa() converts string IP addresses to long. An example:



(...)



char *IP;



ip=inet_ntoa(dest.sin_addr);



printf("Address is: %s\n",ip);



(...)



Remember that inet_addr() returns the address in Network Byte Order - so you don't need to

call htonl().





6. IMPORTANT FUNCTIONS

=======================================



In this section I'll put the function' syntax, the header files you must include to call it,

and little comments. Besides the functions mentioned in this document, there are more, but

I decided to put only these ones here. Maybe I'll put them in a future version of this

document =) To see examples of these functions, you can check the stream client and stream

server source code (Sections 8 and 9)





6.1. socket()

=============



#include

#include



int socket(int domain,int type,int protocol);





Let's see the arguments:



domain -> you can set "AF_INET" (set AF_INET to use ARPA internet protocols)

or "AF_UNIX" if you want to create sockets for inside comunication.

Those two are the most used, but don't think that there are just

those. There are more I just don't mention them.

type -> here you put the kind of socket you want (Stream or Datagram)

If you want Stream Socket the type must be SOCK_STREAM

If you want Datagram Socket the type must be SOCK_DGRAM

protocol -> you can just set protocol to 0





socket() gives you a socket descriptor that you can use in later system calls or

it gives you -1 on error (this is usefull for error checking routines).





6.2. bind()

===========



#include

#include



int bind(int fd, struct sockaddr *my_addr,int addrlen);





Let's see the arguments:



fd -> is the socket file descriptor returned by socket() call

my_addr -> is a pointer to struct sockaddr

addrlen -> set it to sizeof(struct sockaddr)



bind() is used when you care about your local port (usually when you use listen() )

and its function is to associate a socket with a port (on your machine). It returns

-1 on error.



You can put your IP address and your port automatically:



server.sin_port = 0; /* bind() will choose a random port*/

server.sin_addr.s_addr = INADDR_ANY; /* puts server's IP automatically */





An important aspect about ports and bind() is that all ports bellow 1024 are reserved.

You can set a port above 1024 and bellow 65535 (unless the ones being used by other

programs).





6.3. connect()

==============



#include

#include



int connect(int fd, struct sockaddr *serv_addr, int addrlen);



Let's see the arguments:



fd -> is the socket file descriptor returned by socket() call

serv_addr -> is a pointer to struct sockaddr that contains destination IP

address and port

addrlen -> set it to sizeof(struct sockaddr)



connect() is used to connect to an IP address on a defined port. It returns -1 on

error.





6.4. listen()

=============



#include

#include



int listen(int fd,int backlog);



Let's see the arguments:



fd -> is the socket file descriptor returned by socket() call

backlog -> is the number of allowed connections



listen() is used if you're waiting for incoming connections, this is, if you want

someone to connect to your machine. Before calling listen(), you must call bind()

or you'll be listening on a random port =) After calling listen() you must call

accept() in order to accept incoming connection. Resuming, the sequence of system calls

is:



1. socket()

2. bind()

3. listen()

4. accept() /* In the next section I'll explain how to use accept() */



As all functions above described, listen() returns -1 on error.





6.5. accept()

=============



#include



int accept(int fd, void *addr, int *addrlen);



Let's see the arguments:



fd -> is the socket file descriptor returned by listen() call

addr -> is a pointer to struct sockaddr_in where you can determine which host

is calling you from which port

addrlen -> set it to sizeof(struct sockaddr_in) before its address is passed

to accept()





When someone is trying to connect to your computer, you must use accept() to get the

connection. It's very simple to understand: you just get a connection if you accept =)





Next, I'll give you a little example of accept() use because it's a little different

from other functions.



(...)



sin_size=sizeof(struct sockaddr_in);

if ((fd2 = accept(fd,(struct sockaddr *)&client,&sin_size))==-1){ /* calls accept() */

printf("accept() error\n");

exit(-1);

}



(...)



From now on, fd2 will be used for add send() and recv() calls.





6.6. send()

===========





int send(int fd,const void *msg,int len,int flags);



Let's see the arguments:



fd -> is the socket descriptor where you want to send data to

msg -> is a pointer to the data you want to send

len -> is the length of the data you want to send (in bytes)

flags -> set it to 0





This function is used to send data over stream sockets or CONNECTED datagram sockets.

If you want to send data over UNCONNECTED datagram sockets you must use sendto().



send() returns the number of bytes sent out and it will return -1 on error.





6.7. recv()

===========





int recv(int fd, void *buf, int len, unsigned int flags);



Let's see the arguments:



fd -> is the socket descriptor to read from

buf -> is the buffer to read the information into

len -> is the maximum length of the buffer

flags -> set it to 0





As I said above about send(), this function is used to send data over stream sockets or

CONNECTED datagram sockets. If you want to send data over UNCONNECTED datagram sockets

you must use recvfrom().



recv() returns the number of bytes read into the buffer and it'll return -1 on error.





6.8. sendto()

=============



int sendto(int fd,const void *msg, int len, unsigned int flags,

const struct sockaddr *to, int tolen);



Let's see the arguments:



fd -> the same as send()

msg -> the same as send()

len -> the same as send()

flags -> the same as send()

to -> is a pointer to struct sockaddr

tolen -> set it to sizeof(struct sockaddr)



As you can see, sendto() is just like send(). It has only two more arguments : "to"

and "tolen" =)



sendto() is used for UNCONNECTED datagram sockets and it returns the number of bytes

sent out and it will return -1 on error.





6.9. recvfrom()

===============



int recvfrom(int fd,void *buf, int len, unsigned int flags

struct sockaddr *from, int *fromlen);



Let's see the arguments:



fd -> the same as recv()

buf -> the same as recv()

len -> the same as recv()

flags -> the same as recv()

from -> is a pointer to struct sockaddr

fromlen -> is a pointer to a local int that should be initialised

to sizeof(struct sockaddr)



recvfrom() returns the number of bytes received and it'll return -1 on error.





6.10. close()

=============



close(fd);



close() is used to close the connection on your socket descriptor. If you call close(),

it won't be no more writes or reads and if someone tries to read/write will receive an

error.





6.11. shutdown()

================



int shutdown(int fd, int how);



Let's see the arguments:



fd -> is the socket file descriptor you want to shutdown

how -> you put one of those numbers:



0 -> receives disallowed

1 -> sends disallowed

2 -> sends and receives disallowed



When how is set to 2, it's the same thing as close().



shutdown() returns 0 on success and -1 on error.





6.12. gethostname()

===================



#include



int gethostname(char *hostname, size_t size);



Let's see the arguments:



hostname -> is a pointer to an array that contains hostname

size -> length of the hostname array (in bytes)





gethostname() is used to get the name of the local machine.







7. SOME WORDS ABOUT DNS

=======================================



I created this section, because I think you should know what DNS is. DNS stands for "Domain

Name Service" and basically, it's used to get IP addresses. For example, I need to know the

IP address of queima.ptlink.net and through DNS I'll get 212.13.37.13 .



This is important, because functions we saw above (like bind() and connect()) work with IP

addresses.



To see you how you can get queima.ptlink.net IP address on c, I made a little example:





/* <---- SOURCE CODE STARTS HERE ----> */



#include

#include /* This is the header file needed for gethostbyname() */

#include

#include

#include





int main(int argc, char *argv[])

{

struct hostent *he;



if (argc!=2){

printf("Usage: %s \n",argv[0]);

exit(-1);

}



if ((he=gethostbyname(argv[1]))==NULL){

printf("gethostbyname() error\n");

exit(-1);

}



printf("Hostname : %s\n",he->h_name); /* prints the hostname */

printf("IP Address: %s\n",inet_ntoa(*((struct in_addr *)he->h_addr))); /* prints IP address */

}

/* <---- SOURCE CODE ENDS HERE ----> */







8. A STREAM SERVER EXAMPLE

=======================================



In this section, I'll show you a nice example of a stream server. The source code is all

commented so that you ain't no possible doubts =)



Let's start:



/* <---- SOURCE CODE STARTS HERE ----> */



#include /* These are the usual header files */

#include

#include

#include





#define PORT 3550 /* Port that will be opened */

#define BACKLOG 2 /* Number of allowed connections */



main()

{



int fd, fd2; /* file descriptors */



struct sockaddr_in server; /* server's address information */

struct sockaddr_in client; /* client's address information */



int sin_size;





if ((fd=socket(AF_INET, SOCK_STREAM, 0)) == -1 ){ /* calls socket() */

printf("socket() error\n");

exit(-1);

}



server.sin_family = AF_INET;

server.sin_port = htons(PORT); /* Remember htons() from "Conversions" section? =) */

server.sin_addr.s_addr = INADDR_ANY; /* INADDR_ANY puts your IP address automatically */

bzero(&(server.sin_zero),8); /* zero the rest of the structure */





if(bind(fd,(struct sockaddr*)&server,sizeof(struct sockaddr))==-1){ /* calls bind() */

printf("bind() error\n");

exit(-1);

}



if(listen(fd,BACKLOG) == -1){ /* calls listen() */

printf("listen() error\n");

exit(-1);

}



while(1){

sin_size=sizeof(struct sockaddr_in);

if ((fd2 = accept(fd,(struct sockaddr *)&client,&sin_size))==-1){ /* calls accept() */

printf("accept() error\n");

exit(-1);

}



printf("You got a connection from %s\n",inet_ntoa(client.sin_addr) ); /* prints client's IP */



send(fd2,"Welcome to my server.\n",22,0); /* send to the client welcome message */



close(fd2); /* close fd2 */

}

}



/* <---- SOURCE CODE ENDS HERE ----> */







9. A STREAM CLIENT EXAMPLE

=======================================



/* <---- SOURCE CODE STARTS HERE ----> */



#include

#include

#include

#include

#include /* netbd.h is needed for struct hostent =) */



#define PORT 3550 /* Open Port on Remote Host */

#define MAXDATASIZE 100 /* Max number of bytes of data */



int main(int argc, char *argv[])

{

int fd, numbytes; /* files descriptors */

char buf[MAXDATASIZE]; /* buf will store received text */



struct hostent *he; /* structure that will get information about remote host */

struct sockaddr_in server; /* server's address information */



if (argc !=2) { /* this is used because our program will need one argument (IP) */

printf("Usage: %s \n",argv[0]);

exit(-1);

}



if ((he=gethostbyname(argv[1]))==NULL){ /* calls gethostbyname() */

printf("gethostbyname() error\n");

exit(-1);

}



if ((fd=socket(AF_INET, SOCK_STREAM, 0))==-1){ /* calls socket() */

printf("socket() error\n");

exit(-1);

}



server.sin_family = AF_INET;

server.sin_port = htons(PORT); /* htons() is needed again */

server.sin_addr = *((struct in_addr *)he->h_addr); /*he->h_addr passes "*he"'s info to "h_addr" */

bzero(&(server.sin_zero),8);



if(connect(fd, (struct sockaddr *)&server,sizeof(struct sockaddr))==-1){ /* calls connect() */

printf("connect() error\n");

exit(-1);

}



if ((numbytes=recv(fd,buf,MAXDATASIZE,0)) == -1){ /* calls recv() */

printf("recv() error\n");

exit(-1);

}



buf[numbytes]='\0';



printf("Server Message: %s\n",buf); /* it prints server's welcome message =) */



close(fd); /* close fd =) */

}



/* <---- SOURCE CODE ENDS HERE ----> */







10. LAST WORDS

=======================================





As I'm just a simple human, it's almost certain that there are some errors on this document.

When I say errors I mean English errors (because my language is not the English) but also

technical errors. Please email me if you detect any error =)



But you must understand that this is the first version of this document, so , it's natural not

to be very complete (as matter of fact I think it is ) and it's also very natural to have

stupid errors. However, I can be sure that source code presented in this document works fine.

Read more...

Donate Us

email me

Email me

Quick Link

  © Download this template Thief template by Windows 8 Codename Midori 2009

Back to TOP  

Feedback Form