Wednesday, March 29, 2006

Code for lower case to upper case

Perl Funda’s

Code for lower case to upper case: $line =~ tr/a-z/A-Z/;

SQL friendly –> $Mail_Message=~ s/['"]/`/g;

use Date::Calc qw(Delta_Days);
$days = Delta_Days($year1, $month1, $day1, $year2, $month2, $day2);

mail code

$to_id=”dileepreddy@ti.com”;
my $from_id =’pushreport@india.ti.com’;
my $cc=”";
my $bcc=”";
$mailSub=”Push Report : Data Upload Complete”;
$mailContent=”Reddy,
Push Report: Data Upload from file to table $tablename is completed.
— Push Report generator.”;
open(SENDMAIL,”|/usr/lib/sendmail -t”);
print SENDMAIL <<”EOF_MAIL”;
From: $from_id
To: $to_id
Cc: $cc
Bcc: $bcc
Subject: $mailSub
Content-Type: text/html;
$mailContent
EOF_MAIL
close(SENDMAIL);

commify_series

sub commify_series {
(@_ == 0) ? ” :
(@_ == 1) ? $_[0] :
(@_ == 2) ? join(” and “, @_) :
join(“, “, @_[0 .. ($#_-1)], “and $_[-1]“);
}

Posted by Babai at 08:31:38 | Permalink | No Comments »

Mouse Tricks for Word Users

Mouse Tricks for Word Users

 

Keyboard shortcuts are a mainstay for most Word users who are trying to streamline their work. Even brand-new users start slinging around [Ctrl]C and [Ctrl]V soon after mastering the intricacies of scrolling. But keyboard shortcuts are often nonintuitive and hard to remember. (What mnemonic would you use to recall that [Ctrl]E centers document text or that [Ctrl]T produces a hanging indent?)

That’s where mouse shortcuts-the unsung hero of built-in functionality-can take up the slack. Users probably know the basic moves: Right-click on an item to display a shortcut menu, double-click to select a word, triple-click to select a paragraph. But Word has quite a few additional mouse tricks up its sleeve. This overview will help you (and your users) learn some easily remembered techniques to gain quick access to a host of Word options.

Formatting

Action

Result

Double-click an indent marker on the horizontal ruler

Opens the Paragraph dialog box

Double-click the vertical ruler (in Print Preview) or the gray area of the horizontal ruler

Opens the Page Setup dialog box

Double-click a tab marker on the horizontal ruler

Opens the Tabs dialog box

Double-click the style area

Opens the Style dialog box. (To display the style area, make sure you’re in Normal view, choose Tools | Options | View, and enter a value in the Style Area Width text box.) This is a particularly neat trick for those who prefer setting style options in a dialog box instead of in the task pane.

Double-click a section break mark (visible in Normal view)

Opens the Page Setup dialog box with This Section selected in the Apply To drop-down list. “This” refers to the section above the section break mark you clicked on.

Double-click a paragraph properties mark

Opens the Line And Page Breaks tab in the Paragraph dialog box. The mark is a small black square that appears to the left of a paragraph that has the Keep Lines Together, Page Break Before, or Keep With Next option enabled. (The display of Formatting Marks must be turned on to see these marks; you may need to click Show/Hide ¶ on the Standard toolbar to turn on the display.)

Double-click a number in a numbered list

Opens the Numbered tab in the Bullets And Numbering dialog box

Double-click a bullet in a bulleted list

Opens the Bulleted tab in the Bullets And Numbering dialog box

 

 

 

 

Objects and pictures

Action

Result

Double-click the frame of a text box

Opens the Format Text Box dialog box

Double-click an AutoShape

Opens the Format AutoShape dialog box

Double-click a WordArt object

Opens the Edit WordArt dialog box

Double-click an embedded object, such as an Excel worksheet or PowerPoint slide

Opens the object for editing

Double-click a picture

Opens the Format Picture dialog box

Double-click a control (check box, command button, etc.)

Launches the VB Editor and open the properties and code window for that item

Miscellaneous tasks

Hold down [Ctrl] and click within a sentence

Selects sentence

Hold down [Ctrl] and drag selected text or an object

Creates a copy of the text or object

Double-click the split bar at the top of the horizontal scroll bar

Splits the window into two panes; double-click the top border of the lower pane to remove the split

Double-click in the header or footer area (in Print Layout view)

Activates the header or footer; double-click in the main text area to return to it

In Print Layout view, click between pages

Shows or hides the white space between them

Double-click an unused area beside any toolbar

Displays the Customize dialog box

Right-click on any toolbar

Displays the toolbars list

Double-click a footnote/endnote marker

Jumps to the corresponding footnote/endnote (and vice versa)

Double-click the top border of the Reviewing Pane

Closes the pane and returns you to the main text area

Double-click the right border of the Document Map or Thumbnails pane

Closes the pane

Double-click the document title bar

Toggles between maximized and restored window size. (Little-known related trick: The same thing happens if you double-click the gray square at the intersection of the horizontal and vertical scroll bars.)

Double-click a Move Table Column marker (those little dotted squares you see on the horizontal ruler when you’re in a table) or the Table Move Handle (the four-headed arrow that appears at the top-left corner of a table in Print Layout view)

Opens the Table Properties dialog box

Click the Table Move Handle

Selects the table

Double-click the plus symbol next to a heading in Outline view

Expands or collapses the heading’s subordinate text

Status bar tools

Double-click the status bar anywhere to the left of the REC item

Opens the Go To dialog box

Double-click REC on the status bar

Opens the Record Macro dialog box

Double-click TRK on the status bar

Turns track changes on and off. (Right-clicking on TRK will bring up a shortcut menu of additional options.)

Double-click EXT on the status bar

Turns extend selection mode on and off

Double-click OVR on the status bar

Turns overtype mode on and off

Double-click the Spelling And Grammar Status icon on the status bar

Checks document spelling and grammar. (Right-clicking will bring up a shortcut menu of additional options.)

 

Posted by Babai at 08:26:39 | Permalink | No Comments »

Common Unix & Linux commands



Directory Mappings  Linux (Red Hat) SOLARIS
Root filesystem /                  {/dev/sda1} /  {/dev/vx/dsk/rootvol}
Home Directory / /export/home
       /dev/vx/dsk/home}
    /tmp 
    /dev/vx/dsk/swapvol}
    /usr 
    /var
User Accounts LINUX(RedHat) Solaris
Password files /etc/passwd /etc/passwd 
/etc/shadow /etc/shadow
Groups file /etc/group /etc/group
Maximum # of user ID 65535 2147483647
Allow/Deny remote login /etc/securetty /etc/default/login
{ttyp1} {CONSOLE=/dev/console}
User nobody’s id # 99 60001 & 65534(nobody4)
Group nobody’s id # 99 60002 & 65534(nogroup)
Recover root password linux S boot cdrom -s
vi /etc/shadow mkdir /tmp/a
  mount /dev/c0t0d0s0 /tmp/a
  vi /tmp/a/etc/shadow
Create new user useradd useradd
Delete user userdel userdel
List users   logins
Modify user account usermod usermod
General Commands LINUX(RedHat) Solaris
Unique host ID hostid hostid
Administrator linuxconf admintool
Performance monitor top top
System activity reporter   sar
Virtual Memory statistics vmstat vmstat
I/O statistics   iostat
Error logs dmesg  dmesg
Physical RAM 64 GB {>2.3.24} 16TB
Shared Memory sysctl kernel.shmmax  
Process Data Space 900 MB   
Swap device /dev/sda2 /dev/vx/dsk/swapvol
Swap file type partition type 82  swap
Display swap size free swap -l
Activate Swap swapon -a swap -a
Printers LINUX Solaris
Printer Queues /var/spool/lpd/lp/* /etc/lp/interfaces/*
Stop LP  /etc/init.d/lpd stop /usr/lib/lp/lpshut
Start LP /etc/init.d/lpd start /usr/lib/lp/lpsched
Submit print jobs lpr lp
lpr
LP statistics lpq lpstat
Remove print jobs lprm cancel
lprm
Add printer queue printtool lpadmin -p pq
Remove Printer queue   lpadmin -x pq
Make default printer   lpadmin -d pq
TCP/IP LINUX(RedHat) Solaris
Network IP configuration /etc/sysconfig/network-scripts/  /etc/hostname.*
/etc/inet/*
/etc/defaultrouter
Hosts IP addresses /etc/hosts /etc/inet/hosts
Name service switch /etc/nsswitch.conf /etc/nsswitch.conf
Network parameters sysctl -a | grep net ndd /dev/[tcp|ip] ?
Routing daemon routed in.routed
NIC Configurations ifconfig -a ifconfig -a
Secondary IP Address modprobe ip_alias ifconfig hme0:1 IP up
ifconfig eth0:1 IP
Login prompt /etc/issue BANNER @
/etc/default/telnetd
Increase the # of pseudo-terminals cd /dev {/etc/system}
./MAKEDEV -v pty set pt_cnt = #   {SYSV}
  set npty = #      {BSD}
   
  {/etc/iu.ap}
  ptsl 0 # ldterm ttcompat
   
  halt
  boot -r
Maximum # of ptys 256 176                {BSD}
3000              {SYSV}
Remote Shell rsh rsh
YP/NIS service binder /sbin/ypbind /usr/lib/netsvc/yp/ypbind
System Files LINUX(RedHat) Solaris
NFS exported /etc/exports /etc/dfs/dfstab
/etc/dfs/sharetab
NFS Client mounted directories /var/lib/nfs/xtab /etc/rmtab
Max File System 2 TB  1 TB
8000 TB {vxfs}
Max File Size 2 GB     {512B block size}  1 TB
8192 GB  {8KB block size}  2 GB {=<2.5.1}
Max # File Descriptors sysctl fs.file-max 64 K
DISK/LVM Commands LINUX(RedHat) SOLARIS
Filesystem table /etc/fstab /etc/vfstab
Free disk blocks df -k df -k
Device listing cat /proc/devices sysdef
Disk information cat /proc/scsi/scsi0/sda/model format -d c#t#d#
format>current
format>inquiry
Disk Label fdisk -l prtvtoc
LVM Concepts logical extents sub disk
  logical volume Volume
    Plex
  volume group disk group
Journal Filesystem type ext2 vxfs
Default volume group   /dev/vx/dsk/rootdg
Display volume group vgdisplay -v vxprint -l -g rootdg
Modify physical volume pvchange  
Prepare physical disk pvcreate vxdiskadd
List physical volume pvdisplay vxprint -dl
Remove disk from volume group vgreduce vxdg rmdisk
Move logical volumes to another physical volumes pvmove vxassist move
Create volume group vgcreate vxdg init
Remove volume group vgremove  
Volume group availability vgchange  
Restore volume group vgcfgrestore  
Exports volume group vgexport vxdg deport
Imports volume group vgimport vxdg import
Volume group listing vgscan  
Change logical volume characteristics  lvchange  vxedit set
List logical volume lvdisplay vxprint -vl
Make logical volume lvcreate vxassist make
Extend logical volume lvextend vxassist growto
Reduce logical volume lvreduce vxassist shrinkto
Remove logical volume lvremove vxedit rm
Prepare boot volumes lilo vxbootsetup
Extend File system resize2fs vxva
mkfs -M
Reduce/Split mirrors lvsplit  
Merge mirrors lvmerge  
Create mirrors   vxassist mirror
Add mirrors    
Create striped volumes lvcreate -i 3 -I 64 vxassist make vol 100mb layout=raid5
Backup tar cvf /dev/rst0 / ufsdump
Restore tar xvf /dev/rst0  ufsrestore
MISC LINUX(RedHat) SOLARIS
Startup script /etc/rc.d/rc /sbin/init.d
Kernel /boot/vmlinuz /kernel/genunix
Kernel Parameters sysctl -a sysdef -i
Reconfigure the kernel cd /usr/src/linux  vi /etc/system
make mrproper  reboot
make menuconfig   
make dep   
make clean   
make bzimage  
make install  
make modules  
make modules_install  
   
cp arch/i386/boot/bzImage /boot/vmlinuz-2.2.16  
mkinitrd /boot/initrd-2.2.16.img 2.2.16  
vi /etc/lilo.conf  
lilo  
List modules lsmod modinfo
Load module insmod modload
Unload module rmmod modunload
Initialize system netconf sys-unconfig
Physical RAM free prtconf
Kernel Bits getconf WORD_BIT isainfo -kv
Crash utility lcrash crash
Trace System Calls strace truss
Machine model uname -m uname -imp
OS Level uname -r uname -r
Run Level runlevel who -r
Core dump files   /var/crash/`uname -n`
Boot single user linux S ok boot -s
Maintenance mode   ok boot -as
Interrupt Key   Stop-A
Return to console   ok go
Timezone Management /etc/sysconfig/clock /etc/TIMEZONE
/etc/default/init
NTP Daemon /etc/ntp.conf /etc/inet/ntp.conf
/etc/rc.d/init.d/xntpd /etc/init.d/xntpd
Software LINUX(RedHat) SOLARIS
Install Software rpm -i package pkgadd
Uninstall software rpm -e package pkgrm
List installed software rpm -qa pkginfo
Verify installed software rpm -V package pkginfo -i
pkginfo -p
List all files rpm -ql package pkgchk -l package
List installed patches   patchadd -p
Package owner rpm -qf file pkgchk -l -p path
SW Directory /var/lib/rpm /var/sadm
Devices LINUX(RedHat) SOLARIS
Devices /dev /devices
Install devices for attached peripherals /dev/MAKEDEV drvconfig
devlinks
disks
tapes
ports
Remove device   rem_drv
Device drivers   prtconf -D
CPU cat /proc/cpuinfo psrinfo -v
List Terminal   pmadm -l
Diagnostics   /usr/platform/`uname -m`/
sbin/prtdiag
ok test-all
/opt/SUNWvts/bin/sunvts
Whole Disk /dev/sda /dev/c#t#d0s2
CDROM /dev/cdrom /dev/dsk/c#t6d0s2
CDROM file type iso9660 hsfs
Rewinding tape drive /dev/rst0               { c 9 0} /dev/rmt/0
Non-rewinding tape drive /dev/nrst0           { c 9 128 } /dev/rmt/0n
Floppy drive /dev/fd0 /dev/diskette
Posted by Babai at 08:24:54 | Permalink | No Comments »

MS WORD TIPS AND TRICKS

MS WORD TIPS AND TRICKS

 

No matter how long you’ve been using Microsoft Word, you can always learn new techniques to help you work faster and smarter. Here are some of My favorite tips and tricks for Word 97/2000/2002(Office XP)/2003, organized into three sections:

  1. The Basics,
  2. Advanced tips,
  3. Things you don’t have to do.

The Basics

1.       Learn to use Undo - Make a mistake? Press [Ctrl]Z or choose Undo from the Edit menu right away. Keep pressing [Ctrl]Z to backtrack through and undo the most recent editing changes you’ve made.

2.       Save often - Press [Ctrl]S or click the Save button on the Standard toolbar. Save your work frequently. You can also instruct Word to automatically save your work periodically. Open the Tools menu, select Options, click the Save tab, and activate the Save AutoRecovery Info Every option. You can specify an interval from 1 to 120 minutes.

  1. Quickly move around in a document - To move to the top of a document, press [Ctrl][Home]. To move to the bottom of a document, press [Ctrl][End]. To go to the top of the next page, press [Ctrl][Page Down]. For the top of the preceding page, press [Ctrl][Page Up].
  1. Open menus and select commands from the keyboard - Press [Alt] plus the letter that’s underlined to open a menu, such as File, Edit, View, and so on. Once a menu is open, you don’t need to press [Alt] to select a command; just press the underlined letter of the command you want to select. Here are some common examples: Quick Print Preview: [Alt]F,V. Quick Save As: [Alt]F,A. Quickly reopen the first document in the most recently used file list: [Alt]F,1.
  1. Fours ways to select a block of text - Use the mouse. Just click and drag the mouse to select text. Use [Shift] plus the arrow keys. Hold down [Shift] and press an arrow key to select text in the desired direction. To select a word at a time, press [Ctrl][Shift] and the left or right arrow key. Use the mouse with the [Shift] key. Move the mouse pointer away from the insertion point position, hold down [Shift] and click to select all the text between the insertion point and the place where you clicked. Frustrated when you try to select text with the mouse past the bottom of the currently visible page and Word leaps past what you want to select? Those are the times to use [Shift] plus the down arrow key instead of the mouse.
  1. Select a word - Double-click on it. If a space immediately follows the word you select, the space gets selected, too. Punctuation is ignored.
  1. Select a sentence - Select a sentence. Hold down [Ctrl] and click anywhere in the sentence.
  1. Select a paragraph - Triple-click within the paragraph or move the mouse just past the left margin of the paragraph. When the pointer changes to a right-pointing arrow, double-click to select the whole paragraph.
  1. Select a table - Select a table by holding down [Alt] and double-clicking anywhere in the table.

 

Advanced tips

1.       Instant AutoCorrect - Right-click on a word that’s flagged as misspelled to display the Edit shortcut menu. If Word has a suggested alternative, AutoCorrect will appear on the menu. Choose AutoCorrect and then select the correct version of the word from the submenu to create an AutoCorrect entry.

2.       Effortless AutoText - Save time by inserting AutoText automatically. Type an entry name and press [F3]. Or take advantage of Word’s AutoComplete feature. Just open the Tools menu, select AutoCorrect, click the AutoText tab, and turn on the Show AutoComplete Tip For AutoText And Dates option. With this feature active, Word will show a ScreenTip after you begin typing an AutoText item. Just press [Enter] and Word will insert the item for you. (This feature works the same way with dates and days of the week.)

3.       Marker display - Work with paragraph markers and tab marks displayed. Simply click the Show/Hide ¶ button on the Standard toolbar. Displaying those normally hidden characters helps you avoid inadvertently deleting objects or changing formatting; it also helps you figure out funky alignment and extra white space problems.

4.       Use AutoCorrect as a text expander - You don’t have to keep typing those long words or phrases you have trouble with. Come up with a three- or four-letter abbreviation for it and add it to AutoCorrect. For example, say you often need to type Indianapolis. Press [Alt]T (to open the Tools menu) and press A to select AutoCorrect. Type indy, press [Tab], type Indianapolis, and press [Enter] twice. Now, any time you type indy followed by a space or any punctuation, Word will automatically “correct” that spelling and replace it with Indianapolis. You can save up to 255 characters in an AutoCorrect entry. (If you need more characters or you want to include pictures along with text, use AutoText instead.)

5.       Clear a table - If you need to delete the contents of all the cells in a table, just select the table and press [Delete] (not [Backspace]).

6.       Display built-in styles - When you create a document, Word starts you out with a handful of basic styles. If you need to apply a more specialized style, hold down [Shift] and click on the arrow beside the Style box on the Formatting toolbar. Word will expand the Style list to include all its built-in styles. Just select the one you need and Word will apply that style and add it to your document.

7.       Quick table column total - Performing addition in a Word table is simple. Click in an empty cell at the bottom of a column of numbers. Open the Table menu, select Formula, and press [Enter] to accept the default Sum function.

8.       Styles as you go - Define styles on the fly: Format a paragraph the way you want, type a name in the Style box on the Formatting toolbar, and press [Enter].

9.       Quick field toggle - Press [Alt][F9] to quickly toggle field code display on and off.

10.   Add a border to a page - To add a border to page, open the Format menu, select the Borders And Shading command, and click the Page Border tab.

11.   Faster Go To - Double-click the left end of the status bar to bring up the Go To tab so you can jump to an item in your document such as bookmark, a specific page, a table, a section, and so on.

12.   Splitsville - See two parts of a document at the same time by choosing Split from the Window menu and clicking to place the split bar where you want to divide the document window. Separate vertical scroll bars allow you to bring different portions of text into view-and you can set different view preferences for each pane (such as normal view in the top pane and outline view in the bottom). To restore the panes to a single window, just double-click the split bar or drag it beyond the top or bottom of the window.

13.   Selective word count - Need to know how many words, characters, paragraphs, or lines appear in a portion of a document? Just select the text you want to run the count on prior to choosing Word Count from the Tools menu.

14.   Trim ragged text by turning on hyphenation - When text contains many long words and your left and right margins are close to one another, your right margin can look ragged. To help smooth out that edge, choose Language from the Tools menu, select Hyphenation, click in the Automatically Hyphenate Document check box, and click OK.

15.   Copy formatting to more than one block of text - To copy the formatting from the current word or paragraph, click the Format Painter button on the Standard toolbar and then select the word or block of text to which you want to apply that formatting. To copy the same formatting to more than one block of text, double-click on the Format Painter button. Then you can apply the formatting to several blocks of text. To turn off the Format Painter, just click the button again or press [Esc].

16.   Jump quickly between documents - If you work with a lot of open, overlapping documents, here’s a quick way to cycle between them: Press [Ctrl][F6] to jump from one to the next; [Ctrl][Shift][F6] will jump you backward.

17.   Insert and format symbols - For instant access to thousands of special symbols, like foreign characters and wild and crazy icons, open the Insert menu, choose Symbol, and look through the selections available with different fonts and subsets of fonts. After you insert a special character or symbol, you can then select it and use [Grow Font] and [Shrink Font] on it.

18.   Create a desktop shortcut to a document - To create a document shortcut, first highlight some text to serve as a target in the document and click the Copy button. Next, minimize the Word window or drag it out of the way so you can see the Windows desktop. Then, hold down [Ctrl], right-click on the desktop, and choose Paste Shortcut. You’ll probably want to change the shortcut name to something more meaningful. To do this, click on the shortcut to select it and then press [F2] to activate the label for editing. Type the desired name and press [Enter]. Close your document, clicking Yes to save your changes. You can even exit Word, if you want. Then, simply double-click on the desktop shortcut. Word will open the associated document, navigate to your target text, and select it.

19.   Insert frequently used text with a macro - Macros are extremely handy for performing multi-step operations, including simple text entry. If you routinely use a word, phrase, or entire paragraph, you can create a macro that will automatically insert the text. To start recording your macro click Tools | Macro | Record New Macro. You will be prompted to enter a name for your new macro, specify the document template in which the macro will be stored, and enter a short description. Click OK when you’re ready to begin recording your new macro. Word will record every mouse click and keystroke you make until you click the Stop Recording button. Type in your text and click Stop recording. To use your new macro, click Tools | Macros, select you macro from the list of available macros, and click Run. To make the process even easier, you can tie the macro to a keyboard shortcut. Click Tools | Customize and click the Keyboard button. Under the Categories list, scroll down and select Macros. A list of available macros will appear. Select the desired macro and click into the Press new shortcut key field. Press the key to which you want your macro assigned and then click the Assign button. Return to the document by clicking Close button twice and your new keyboard shortcut is ready to use.

 

Things you don’t have to do

1.       Worry - You don’t have to worry about doing something wrong. Just get familiar with the program and experiment with Word features. If something looks wrong or funny, that’s when you use the Undo feature. Press or type the wrong thing, try [Ctrl]Z to undo whatever you did. Always remember you can press [Ctrl]Z or choose Undo from the Edit menu to undo changes one at a time. Aside from deleting or failing to save a file, there’s almost nothing you can do that isn’t reversible.

2.       Move your hands from the keyboard - You don’t have to use the mouse to do things like open menus, select or format text, or move the insertion point marker. You may find you work more efficiently if you’re not always moving your hand from the keyboard to the mouse. Press [Home] to move to the beginning of the current line and press [End] to move to the end of the current line. Press [Ctrl] and the left or right arrow to move one word in either direction. Hold down [Shift] while pressing those keys to select the text between the insertion point marker and the beginning or the end of the line, respectively.

3.       Select an entire paragraph to change formatting or style - You don’t have to select the entire paragraph to change the paragraph’s formatting or style. Just click anywhere in the paragraph and choose the desired format or style. A good example is justification. Just click anywhere in the paragraph and then click the Align Left, Align Right, or Justify button on the Standard toolbar.

4.       Work with only one document at a time - You don’t have to close one Word document before you open another. Open as many at a time as you want to. Use the [Ctrl][F6] keyboard shortcut or the Windows menu to move quickly between open documents.

5.       Risk missing something you’re looking for - You don’t have to visually scan and manually scroll through a document looking for a word or phrase. Use [Ctrl]F to open the Find tab and let Word locate the text for you.

6.       Waste time during spelling check - You don’t have to repeatedly click Ignore or Ignore All every time the spell-checker stops on a proper noun or a term that’s commonly used in your documents. Click Add (Add To Dictionary in Word XP) so you don’t waste time checking the same words over and over.

7.       Delete old text you’re replacing - You don’t have to delete text you want to replace with new text. Select the old text and start typing the new. The first keystroke replaces the old selected text. Don’t waste time pressing [Delete] first.

8.       Press [Backspace] over and over - You don’t have to press [Backspace] a dozen times to delete a word or phrase. If you type something and then change your mind, pressing [Ctrl][Backspace] to delete a word at a time is much faster. Only one thing is more wasteful: using the mouse to click on the beginning of a word or phrase and then pressing [Delete] repeatedly. (You can use [Ctrl][Delete] to quickly remove words in that situation.) If you get overzealous with [Ctrl][Backspace] or [Ctrl][Delete] and remove one word too many, press [Ctrl]Z to bring it right back.

9.       Use the default toolbar configuration - You don’t have to settle for the default toolbar configuration that shows the Standard and Formatting toolbars. Click View | Toolbars to reveal a list of available toolbars. If you routinely edit documents, the Reviewing toolbar comes in very handy. Use the Tables and Borders toolbar to quickly create tables or the Drawing toolbar to easily manipulate graphics. You can also edit Word’s toolbars by clicking View | Toolbars | Customize, which opens the Customize window. With this window open you can rearrange a toolbar’s buttons, add or remove button, even edit a button’s image or create your own special toolbars.

10.   Count words by hand (Word 2000/2002/2003) - Don’t waste time manually counting words. Word’s count function will tell you how many words and characters are in a document, paragraph, or selection. Word 2002 and 2003 offer a Count toolbar that even simplifies the process. Click View | Toolbars | Word Count.

 

Posted by Babai at 08:22:44 | Permalink | No Comments »

To lock your workstations

Windows 2000 and XP users, below is the tip to lock your workstations without using the combo key - “CTRL- ALT- DEL”.

 

1. Right click an empty spot on the desktop, point to New and click Shortcut.

2. In the Create Shortcut dialog box, type the following into the Type the location of the item text box:

“rundll32 user32.dll,LockWorkStation” // remove quotes while typing

3. Click Next.

4. In the Select a Title for the Program dialog box, type “Lock the Desktop” and Click Finish.

Now the desktop will lock when you click your new “Lock the Desktop” icon.

Even you can type “rundll32 user32.dll,LockWorkStation” in your Start->Run and execute it.

Posted by Babai at 08:21:31 | Permalink | No Comments »

Setting up WAMP

Setting up WAMP

This article will step through what you need to do get WAMP (Windows, Apache, mySQL, PHP) running on windows 2000, 98 or XP. (It might work with ME or 95, but I don’t promise anything)

By the end, you’ll have a versatile tool that will allow you to:

-host your own website (permanent internet connection preferable)
-learn a basic programming language (PHP)
-learn about relational databases (mySQL)
-learn about server config on the industry standard webserver (apache)

all without having to install a new operating system.

Required tools:
a fairly clean basic box, e.g.:
ram: approx 256Mb+
mhz: approx 700+
HDD: approx 200Mb free
Admin access to your box (not required on win98-).

Estimated time: MAX 2 hours.

By ‘fairly clean’, I mean close to it’s original condition; the fewer things installed on it the better. Of significant concern are things like firewalls, almost anything by norton, AOL, third party secuity suites, etc. Ideally, you’ll want to re-install the whole computer from scratch, but this is by no means required.

easy guide to installing WAMP - Windows Apache PHP Mysql Getting Started

Firstly, you may like to print this page, not only will you undoubtably need it at some future point, but also, we’ll be disconnecting from the net while we do the install.

Click here for a printer friendly PDF of this page (thanks to Siv for the PDF), or click here change to the ‘text’ scheme.
Note that the PDF is not updated as often as this page is (like, never), so try the text scheme first and if that won’t work, then use the PDF (or just forget the whole thing)…

Secondly, you’ll need to download all the installers for the programs we’ll be installing;

download Apache 1.3.33 (from www.apache.org)
download PHP 5.02 (from www.php.net)
download mySQL 4.0.21 (from www.mysql.org)

or go to the respective websites and grab the latest versions, but I can’t guarantee that this guide will work with other versions.

Note: this guide is designed for mySQL 4.0.21, however mysql.org no longer distribute that version, hence, the link to mySQL is for 4.0.23. This should not affect the guide. I do plan to host all install files locally at some point.

If you don’t have something capable of reading zip files (e.g. winzip) then I suggest zipcentral (zipcentral.iscool.net), it’s fast and quite a lot free-er than winzip :-).

I also recommend downloading textpad (www.textpad.com); it’s just a text editor, but it has some nifty features that make coding PHP (or any other language) a lot easier.

Now, reboot your computer. This is important as it will ensure that your system is fresh and ready to kick some ass.

If you’re running win2k, log in as the administrator.
Disconnect from the internet
If you have one, disable your firewall. In fact, disable everything that’s running; no taskbar icons, no extra status bar icons. This will help ensure the install goes smoothly.

easy guide to installing WAMP - Windows Apache PHP Mysql Installing Apache

Apache is the web server, which processes file requests and sends them back. Apache is generally recognised as the most stable and secure server money can buy. Not that money is an issue, as it’s also totally free, like all the tools we’re using.

I have to say, installing Apache on windows is incredibly simple, a few clicks and it’s done.

First, open the Apache install file you downloaded, click yes and ok and next and so forth until you reach the “Server Information” screen, then, here’s the info you want:

Network Domain: localhost
Server Name: 127.0.0.1
Admin Email: you@yourdomain.com

Choose whether you want Apache running for all users or not.
If you just going to use the server for development, you can just have it run for you, otherwise I’d recommend having it running for all users.

Choose the complete installation (it only takes under 8 meg, so why not?), stick with the default folder for install, and hit the magic button.

This should be it - verify by opening http://localhost/ or http://127.0.0.1/ in your internet browser.

Wasn’t that easy?

easy guide to installing WAMP - Windows Apache PHP Mysql Installing mySQL

mySQL is the database server, which will allow interactivity on your websites. Like Apache, mySQL is free, stable and secure. It lacks a few of the features of it’s commercial competitors, but is widely used and trusted. With each new version, more features are added to keep mySQL a viable alternative to other closed source products (Oracle and MSSQL being the two main rivals)

Extract everything from “mysql-4.0.21-win-noinstall.zip” straight into drive C, a new folder should appear named “mysql-4.0.21-win”, you can rename this something else if you want to, it really doesn’t matter (but bear in mind that that’s what I use, so my config examples are tailored to this directory).

mySQL is now installed, but there’s a little configuring you’ll need to do.

Firstly, let’s set a password:
Start a command prompt by going to Start, then Run, and typing “command”, or on win2k, “cmd”

To start the mySQL daemon, type the following:

c:
cd mysql-4.0.21-win
cd bin
mysqld

exit that command prompt, and start a new one, again navigating to c:mysql-4.0.21-winbin

now type

mysql -u root

to log in to mySQL, it should say

Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 2 to server version: 4.0.21-nt

Type 'help;' or 'h' for help. Type 'c' to clear the buffer.

mysql>

Note: If you get a message saying that you cannot connect, try rebooting and running ‘mysqld’ again.

Now type the following, replacing “flibble” with your desired password for the mySQL server.

USE mysql;
UPDATE user SET Password=PASSWORD("flibble");
FLUSH PRIVILEGES;
exit;

Ok, so now you’ve set the password for all default accounts, all we need to do is get the server to run automatically, on startup (if you don’t want mySQL to run every time you turn on the computer, then skip this step)

To run mySQL for all users:
Create a shortcut to c:mysql-4.0.21-winbinmysqld.exe in C:Documents and SettingsAll Users.WINNTStart MenuProgramsStartup

To run mySQL for just you
Create a shortcut to c:mysql-4.0.21-winbinmysqld.exe in C:Documents and Settingsyour_username_hereStart MenuProgramsStartup

easy guide to installing WAMP - Windows Apache PHP Mysql Installing PHP

This is easy;

Extract php-5.0.2-Win32.zip to c:php

Create a folder named “sessiondata” inside c:php

Take “C:phpphp.ini-recommended”, and copy it to “C:WINNTphp.ini” (or C:windowsphp.ini), making the following changes:




Line

Old Value

New Value

353

display_errors = Off

display_errors = On

636

;extension=php_mysql.dll

extension=php_mysql.dll

PHP is now installed.

easy guide to installing WAMP - Windows Apache PHP Mysql Getting the left hand to know what the right is doing

Firstly, we need to let Apache know that it should process .php files as PHP code:

open C:Program FilesApache GroupApacheconfhttpd.conf in a text editor (eg notepad or textpad)

Scroll to the bottom, and add the following lines:

# add PHP5 as an apache module
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
LoadModule php5_module "c:/php/php5apache.dll"
SetEnv PHPRC C:/php

Note: in this section, you can specify any type of file to be run through PHP, for instance, some servers use:

AddType application/x-httpd-php .htm
AddType application/x-httpd-php .html

as well as .php; this may result in some performance issues, as every html file will be run through PHP to be processed. The benefit is that search engines sometimes place slightly higher value on html files. Also, it makes it ever so slightly harder for hackers to determine which files are PHP.

Generally, though, there is no reason to do this. It gets confusing when you’re developing code if you don’t know whether blah.html is a PHP file or not, or if you need to change servers at a later date.

Now, to allow Apache to serve index.php as the default page, search for “DirectoryIndex index.html” (line 385), and edit it to read

DirectoryIndex index.html index.php

Now, to allow PHP to find the mySQL functions, copy the following files:

c:phplibmysql.dll
c:phpextphp_mysql.dll

to c:WINNT (or C:windows, depending on your setup)

Ok, all done, now we need to restart Apache;
Open a command prompt and type:

net stop apache
net start apache

Now to test whether it worked:

Apache stores the website files in “C:Program FilesApache GroupApachehtdocs”

If you open that directory, you’ll see there’s a bunch of files there, you can delete everything, though you may need the ‘manual’ directory later.

Make sure that windows is set up to show all file exensions (Tools|Folder Options|View, untick “Hide file extensions for known file types”. On windows98, it’s under ‘view’, not ‘tools’.)

Now, to test PHP, create a new text document with the following content, and name it “info.php”:

phpinfo();
?>

open http://localhost/info.php in your browser, and marvel at the wonders of PHP.

you should see the standard phpinfo page, which tells you almost everything you need to know about your install of PHP.

Let’s see if mySQL is working.

Create mysql.php in htdocs, and place this content in it:

// connect to the server:
$cn = mysql_connect("127.0.0.1","root","flibble");

// run a simple query
$sql = "SELECT 'done' as my_field LIMIT 1";
$result = mysql_query($sql,$cn);

if($result)
{
// if it worked, print the result to screen
echo mysql_result($result,"my_field");
} else {
// otherwise, either the server isn't running
// or the username/password are wrong
echo mysql_error()."
You should see an error message above you?”;

}
?>

Now open http://localhost/mysql.php, and you should see a message saying ‘done’.

You may now delete info.php and mysql.php

Take some time to look through the manual (http://localhost/manual/) there’s some useful stuff in there.

Also, learn to love php.net; their function reference is second to none.

If you get any error messages or problems along the way, email
with details of your operating system, version of apache, mysql and php and details of the error, include error messages if you get them.

Posted by Babai at 07:44:29 | Permalink | No Comments »