2007/08/27

rename files


    for i in 2mD* ; do
    mv $i test-"$i";
    done;


    for i in P* ; do
    new=`echo $i | sed s/"Picture "/course-Picture_/g`;
    mv "$i" $new;
    done;


File re-namer (http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-12.html#ss12.3)

File re-namer (http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-12.html#ss12.4)

ICAO Phonetic Alphabet (alpha bravo charlie)

ICAO Phonetic Alphabet

A - Alpha

J - Juliett

S - Sierra

B - Bravo

K - Kilo

T - Tango

C - Charlie

L - Lima

U - Uniform

D - Delta

M - Mike

V - Victor

E - Echo

N - November

W - Whiskey

F - Foxtrot

O - Oscar

X - X-ray

G - Golf

P - Papa

Y - Yankee

H - Hotel

Q - Quebec

Z - Zulu

I - India

R - Romeo

0 - Zero

4 - Four

8 - Eight

1 - One

5 - Five

9 - Nine

2 - Two

6 - Six

3 - Three

7 - Seven



Section 2. Radio Communications Phraseology and Techniques
Chapter 14. Phraseology

2007/08/13

nedit / keyboard shortcuts (accelerator keys) are not working ...

copied from: http://www.nedit.org/faq/sect_bugs.php#N900

You have probably NumLock or CapsLock ON ...



1. The keyboard shortcuts (accelerator keys) are not working when 'Caps' or 'Num Lock' are switched on. Have I overlooked something obvious?

You haven't overlooked anything, it's a Motif design flaw. Netscape painfully works around this and the Alt/Meta key reversal on Sun workstations by internally re-implementing the Motif menu accelerator mechanism. NEdit will likely follow suit with the release of version 5.2.

Another possibility (writes Peter Daifuku of SGI):

There's another answer which unfortunately isn't widespread as yet. For an X11R6.3 X server supporting the XKB extension, there is a mechanism to ignore the NumLock and CapsLock key as modifiers. The file /usr/lib/X11/xkb/X0-config.keyboard should contain the string IgnoreLockMods=NumLock+Lock . For systems with multiple displays, display 1 would be controlled by the file X1-config.keyboard, etc.

On SGI systems, this mechanism is support on IRIX 6.2 with X server patch 1574 or later, on IRIX 6.3 and IRIX 6.4 and all later releases.


2. Sometimes NEdit inserts instead of saving the file when I type ^S. Other keyboard shortcuts (accelerator keys) don't work either.

You have probably NumLock or CapsLock ON. See the answer to this question. 3. I use the numeric keypad really often, so I keep NumLock on. But NEdit shortcuts don't work when NumLock is on.

The bug is not in NEdit, but in Motif. This is fixed as of NEdit 5.2, but that might not help you much. Older versions have the same problem.

Here's how you tell X to interpret the keypad keys as numbers without turning NumLock on. Create a file .Xmodmap in your home directory, and put the following lines in it:

    keycode 79 = KP_7
    keycode 80 = KP_8
    keycode 81 = KP_9
    keycode 83 = KP_4
    keycode 84 = KP_5
    keycode 85 = KP_6
    keycode 87 = KP_1
    keycode 88 = KP_2
    keycode 89 = KP_3
    keycode 90 = KP_0
    keycode 91 = KP_Decimal


Then make sure the script that starts your X session parses this file with the command:

    xmodmap -merge ~/.Xmodmap


This script can be ~/.xinitrc (called by startx) or something like Xsession if you use xdm/kdm/gdm. Then again, it might be an entirely different script on some systems.

Then turn off numlock, and just continue using the keypad. The only thing is, you loose the alternate set of functions (cursor/home/pgdown/etc).

101 useful Run Commands in Windows XP

copied from pcworld ...


Guys do you use the Run feature in Windows XP? For most, this feature
remains unused (or rarely used). Why is that? Well, First off nearly
all of the Run Commands Correspond to a particular Control Panel Item
or a Utility, Tool or Task that can be accessed through Windows. There
are, however, tools and utilities that I bet you never knew you had
that can be accessed through the Run feature. The main reason most
people don't use the Run feature is because they don't know the
Commands. So, to solve that problem, I decided to put together the
following listing, which lists 101 Run Commands and what they
correspond too...


    Go to Start Button ===>> Run & try this below commands

    Accessibility Controls: access.cpl

    Add Hardware Wizard: hdwwiz.cpl

    Add/Remove Programs: appwiz.cpl

    Administrative Tools: control.exe admintools

    Automatic Updates: wuaucpl.cpl

    Bluetooth Transfer Wizard: fsquirt

    Calculator: calc

    Certificate Manager: certmgr.msc

    Character Map: charmap

    Check Disk Utility: chkdsk

    Clipboard Viewer: clipbrd

    Command Prompt: cmd

    Component Services: dcomcnfg

    Computer Management: compmgmt.msc

    Date and Time Properties: timedate.cpl

    DDE Shares: ddeshare

    Device Manager: devmgmt.msc

    Direct X Control Panel (if installed)*: directx.cpl

    Direct X Troubleshooter: dxdiag

    Disk Cleanup Utility: cleanmgr

    Disk Defragment: dfrg.msc

    Disk Management: diskmgmt.msc

    Disk Partition Manager: diskpart

    Display Properties: control.exe desktop

    Display Properties: desk.cpl

    Display Properties (w/Appearance Tab Preselected): control.exe color

    Dr. Watson System Troubleshooting Utility: drwtsn32

    Driver Verifier Utility: verifier

    Event Viewer: eventvwr.msc

    File Signature Verification Tool: sigverif

    Findfast: findfast.cpl

    Folders Properties: control.exe folders

    Fonts: control.exe fonts

    Fonts Folder: fonts

    Free Cell Card Game: freecell

    Game Controllers: joy.cpl

    Group Policy Editor (XP Prof): gpedit.msc

    Hearts Card Game: mshearts

    Iexpress Wizard: iexpress

    Indexing Service: ciadv.msc

    Internet Properties: inetcpl.cpl

    Java Control Panel (if installed): jpicpl32.cpl

    Java Control Panel (if installed): javaws

    Keyboard Properties: control.exe keyboard

    Local Security Settings: secpol.msc

    Local Users and Groups: lusrmgr.msc

    Logs You Out Of Windows: logoff

    Mcft Chat: winchat

    Minesweeper Game: winmine

    Mouse Properties: control.exe mouse

    Mouse Properties: main.cpl

    Network Connections: control.exe netconnections

    Network Connections: ncpa.cpl

    Network Setup Wizard: netsetup.cpl

    Nview Desktop Manager (if installed): nvtuicpl.cpl

    Object Packager: packager

    ODBC Data Source Administrator: odbccp32.cpl

    On Screen Keyboard: osk

    Opens AC3 Filter (if installed): ac3filter.cpl

    Password Properties: password.cpl

    Performance Monitor: perfmon.msc

    Performance Monitor: perfmon

    Phone and Modem Options: telephon.cpl

    Power Configuration: powercfg.cpl

    Printers and Faxes: control.exe printers

    Printers Folder: printers

    Private Character Editor: eudcedit

    Quicktime (If Installed): QuickTime.cpl

    Regional Settings: intl.cpl

    Registry Editor: regedit

    Registry Editor: regedit32

    Removable Storage: ntmsmgr.msc

    Removable Storage Operator Requests: ntmsoprq.msc

    Resultant Set of Policy: rsop.msc

    Resultant Set of Policy (XP Prof): rsop.msc

    Scanners and Cameras: sticpl.cpl

    Scheduled Tasks: control.exe schedtasks

    Security Center: wscui.cpl

    Services: services.msc

    Shared Folders: fsmgmt.msc

    Shuts Down Windows: shutdown

    Sounds and Audio: mmsys.cpl

    Spider Solitare Card Game: spider

    SQL Client Configuration: cliconfg

    System Configuration Editor: sysedit

    System Configuration Utility: msconfig

    System File Checker Utility: sfc

    System Properties: sysdm.cpl

    Task Manager: taskmgr

    Telnet Client: telnet

    User Account Management: nusrmgr.cpl

    Utility Manager: utilman

    Windows Firewall: firewall.cpl

    Windows Magnifier: magnify

    Windows Management Infrastructure: wmimgmt.msc

    Windows System Security Tool: syskey

    Windows Update Launches: wupdmgr

    Windows XP Tour Wizard: tourstart

    Wordpad: write

2007/06/25

BLOG / HTML / special characters

http://bloggerfordummies.blogspot.com/2006/03/how-to-post-special-characters_17.html

http://www.webmonkey.com//reference/special_characters/

http://www.w3schools.com/tags/ref_entities.asp

http://www.w3schools.com/html/html_entities.asp

For display of special characters, refer to
http://bloggerfordummies.blogspot.com/2006/03/how-to-post-special-cha...

If you have to, say, change a lot of < into <, type the code as it
is in Notepad, then use (in the menu bar) EDIT > REPLACE to replace
all the <

Peter (Blog*Star 2006 and 2007)

2007/06/22

MAKE - automatic variables




10.5.3 Automatic Variables

Suppose you are writing a pattern rule to compile a `.c' file into a `.o' file: how do you write the `cc' command so that it operates on the right source file name? You cannot write the name in the command, because the name is different each time the implicit rule is applied.

What you do is use a special feature of make, the automatic variables. These variables have values computed afresh for each rule that is executed, based on the target and prerequisites of the rule. In this example, you would use `$@' for the object file name and `$<' for the source file name.

It's very important that you recognize the limited scope in which automatic variable values are available: they only have values within the command script. In particular, you cannot use them anywhere within the target list of a rule; they have no value there and will expand to the empty string. Also, they cannot be accessed directly within the prerequisite list of a rule. A common mistake is attempting to use $@ within the prerequisites list; this will not work. However, there is a special feature of GNU make, secondary expansion (see Secondary Expansion), which will allow automatic variable values to be used in prerequisite lists.

Here is a table of automatic variables:

$@


The file name of the target of the rule. If the target is an archive member, then `$@' is the name of the archive file. In a pattern rule that has multiple targets (see Introduction to Pattern Rules), `$@' is the name of whichever target caused the rule's commands to be run.


$%


The target member name, when the target is an archive member. See Archives. For example, if the target is foo.a(bar.o) then `$%' is bar.o and `$@' is foo.a. `$%' is empty when the target is not an archive member.


$<


The name of the first prerequisite. If the target got its commands from an implicit rule, this will be the first prerequisite added by the implicit rule (see Implicit Rules).


$?


The names of all the prerequisites that are newer than the target, with spaces between them. For prerequisites which are archive members, only the member named is used (see Archives).


$^


The names of all the prerequisites, with spaces between them. For prerequisites which are archive members, only the member named is used (see Archives). A target has only one prerequisite on each other file it depends on, no matter how many times each file is listed as a prerequisite. So if you list a prerequisite more than once for a target, the value of $^ contains just one copy of the name. This list does not contain any of the order-only prerequisites; for those see the `$|' variable, below.


$+


This is like `$^', but prerequisites listed more than once are duplicated in the order they were listed in the makefile. This is primarily useful for use in linking commands where it is meaningful to repeat library file names in a particular order.


$|


The names of all the order-only prerequisites, with spaces between them.


$*


The stem with which an implicit rule matches (see How Patterns Match). If the target is dir/a.foo.b and the target pattern is a.%.b then the stem is dir/foo. The stem is useful for constructing names of related files. In a static pattern rule, the stem is part of the file name that matched the `%' in the target pattern.

In an explicit rule, there is no stem; so `$*' cannot be determined in that way. Instead, if the target name ends with a recognized suffix (see Old-Fashioned Suffix Rules), `$*' is set to the target name minus the suffix. For example, if the target name is `foo.c', then `$*' is set to `foo', since `.c' is a suffix. GNU make does this bizarre thing only for compatibility with other implementations of make. You should generally avoid using `$*' except in implicit rules or static pattern rules.

If the target name in an explicit rule does not end with a recognized suffix, `$*' is set to the empty string for that rule.

`$?' is useful even in explicit rules when you wish to operate on only the prerequisites that have changed. For example, suppose that an archive named lib is supposed to contain copies of several object files. This rule copies just the changed object files into the archive:

lib: foo.o bar.o lose.o win.o
ar r lib $?

Of the variables listed above, four have values that are single file names, and three have values that are lists of file names. These seven have variants that get just the file's directory name or just the file name within the directory. The variant variables' names are formed by appending `D' or `F', respectively. These variants are semi-obsolete in GNU make since the functions dir and notdir can be used to get a similar effect (see Functions for File Names). Note, however, that the `D' variants all omit the trailing slash which always appears in the output of the dir function. Here is a table of the variants:

`$(@D)'


The directory part of the file name of the target, with the trailing slash removed. If the value of `$@' is dir/foo.o then `$(@D)' is dir. This value is . if `$@' does not contain a slash.


`$(@F)'


The file-within-directory part of the file name of the target. If the value of `$@' is dir/foo.o then `$(@F)' is foo.o. `$(@F)' is equivalent to `$(notdir $@)'.


`$(*D)'


`$(*F)'


The directory part and the file-within-directory part of the stem; dir and foo in this example.


`$(%D)'


`$(%F)'


The directory part and the file-within-directory part of the target archive member name. This makes sense only for archive member targets of the form archive(member) and is useful only when member may contain a directory name. (See Archive Members as Targets.)


`$(<D)'


`$(<F)'


The directory part and the file-within-directory part of the first prerequisite.


`$(^D)'


`$(^F)'


Lists of the directory parts and the file-within-directory parts of all prerequisites.


`$(+D)'


`$(+F)'


Lists of the directory parts and the file-within-directory parts of all prerequisites, including multiple instances of duplicated prerequisites.


`$(?D)'


`$(?F)'


Lists of the directory parts and the file-within-directory parts of all prerequisites that are newer than the target.

Note that we use a special stylistic convention when we talk about these automatic variables; we write “the value of `$<'”, rather than “the variable <” as we would write for ordinary variables such as objects and CFLAGS. We think this convention looks more natural in this special case. Please do not assume it has a deep significance; `$<' refers to the variable named < just as `$(CFLAGS)' refers to the variable named CFLAGS. You could just as well use `$(<)' in place of `$<'.

2007/06/21

RCS ident fields

man ident



    "$Author: $"
    The login name of the user who checked in the revi­sion.

    "$Date: $"
    The date and time the revision was checked in.

    "$Header: $"
    A standard header containing the full pathname of the
    RCS file, the revision number, the date and time, the author,
    the state, and the locker (if locked).

    "$Id: $"
    Same as $Header$, except that the RCS filename is without
    a path.

    "$Locker: $"
    The login name of the user who locked the revision
    (empty if not locked).

    "$Log: $"
    The log message supplied during checkin. For
    ident's purposes, this is equivalent to $RCSfile$.

    "$Name: $"
    The symbolic name used to check out the revision, if any.

    "$RCSfile: $"
    The name of the RCS file without a path.

    "$Revision: $"
    The revision number assigned to the revision.

    "$Source: $"
    The full pathname of the RCS file.

    "$State: $"
    The state assigned to the revision with the -s
    option of rcs(1) or ci(1).

2007/06/17

VBA getConfig: retreive key:value from a config sheet


    Function getConfig(key As String) As String
    Dim i As Integer
    Dim xKey As String, strFila As String
    Dim sh

    Set sh = Sheets("config")

    For i = 1 To 500
    strFila = Trim(Str$(i))
    xKey = sh.Range("A" + strFila).Value

    If (key = xKey) Then
    getConfig = sh.Range("B" & strFila).Value
    Exit Function
    End If

    If (xKey = "[end]") Then Exit For

    Next i

    MsgBox "ERROR key not found in config page: [" & key & "]", _
    vbOKOnly + vbCritical, "ERROR"

    End
    End Function

Outlook security error: A program is trying to send mail using Item.Send

Outlook Email Security Update :

Also see Reinforcing Dialog-Based Security, a paper by two U.S. Air Force Academy professors that demonstrates how to get around the object model guard prompts using VBScript code and the SendKeys method to, in effect, click the buttons on the prompts.

Reinforcing Dialog-Based Security
Reinforcing Dialog-Based Security
Martin C. Carlisle, Scott D. Studer
Proceedings of the 2001 IEEE
Workshop on Information Assurance and Security
United States Military Academy, West Point, NY, 5-6 June, 2001
Reinforcing Dialog-Based Security



    Sub bypass()
    Dim fName As String, fDesc As Integer

    fName = getConfig("bypassFile")
    fDesc = FreeFile

    Open fName For Output As fDesc
    Print #fDesc, "Set fso = CreateObject(""WScript.Shell"")"
    Print #fDesc, "While fso.AppActivate(""Microsoft Outlook"") = FALSE"
    Print #fDesc, "wscript.sleep 1000"
    Print #fDesc, "Wend"
    Print #fDesc, "wscript.sleep 7000"
    Print #fDesc, "fso.SendKeys ""{LEFT}"", True"
    Print #fDesc, "fso.SendKeys ""{ENTER}"", True"
    Close #fDesc

    Shell ("WScript.exe " & fName)

    End Sub




    Sub sendMail(strSubject As String, strBody As String)

    Dim OutApp As Object
    Dim OutMail As Object

    Dim strTo As String

    strTo = getConfig("mailTo")

    Set OutApp = CreateObject("Outlook.Application")
    OutApp.Session.Logon
    Set OutMail = OutApp.CreateItem(0)

    Call bypass

    On Error Resume Next
    With OutMail
    .to = strTo
    .CC = ""
    .BCC = ""
    .Subject = strSubject
    .body = strBody
    .Send 'or use .Display
    End With
    On Error GoTo 0

    Set OutMail = Nothing
    Set OutApp = Nothing

    End Sub


Wait Method

Wait Method (VBA help)



Pauses a running macro until a specified time. Returns True if the specified time has arrived.

Important The Wait method suspends all Microsoft Excel activity and may prevent you from performing other operations on your computer while Wait is in effect. However, background processes such as printing and recalculation continue.

expression.Wait(Time)

expression Required. An expression that returns an Application object.

Time Required Variant. The time at which you want the macro to resume, in Microsoft Excel date format.

Example
This example pauses a running macro until 6:23 P.M. today.


    Application.Wait "18:23:00"


This example pauses a running macro for approximately 10 seconds.


    newHour = Hour(Now())
    newMinute = Minute(Now())
    newSecond = Second(Now()) + 10
    waitTime = TimeSerial(newHour, newMinute, newSecond)
    Application.Wait waitTime


This example displays a message indicating whether 10 seconds have passed.


    If Application.Wait(Now + TimeValue("0:00:10")) Then
    MsgBox "Time expired"
    End If