20090605

UNISON an open source synctoy clone with ssh support for linux/mac and windows!

Seems to work :D

Fink Troubles - Cannot perform symlink test http://nmanzi.com/?p=24

Fink Troubles - Cannot perform symlink test

http://nmanzi.com/?p=24


[..8<..]

My problem, however, was that Fink wasn’t installing. At the install volume selection screen, I wasn’t able to select my root volume. It’s reasoning was: “You cannot install Fink on this volume. Cannot perform symlink test on this volume because of a permissions problem. Try performing the “Repair Disk Permissions” function in Disk Utility”.

[..8<..]

Entering the Fink Installer Package (right-click, Show Package Contents - in Finder), I could see three scripts in the Resources folder, one of which was VolumeCheck, which basically tells the Installer if you have permissions to the Volume in question. Editing this script, I made sure it did nothing but return an exit-code of ‘0′ back to the installer.

[..8<..]

#1.   Stephen van Egmond

The test is whether / is writeable, and fails. Running as a regular user / is not writeable. I did this: bash-3.2# sudo chmod 777 /

[..8<..]

<b>#6. &nbsp; Joe Block 11.05.2008</b>
<b>
Your best bet is probably to do



<tt>sudo installer -target / -pkg /path/to/fink.pkg</tt>



That way you don’t need to monkey with the permissions on / or skip any other VolumeCheck checks.



</b>

20090604

http://tldp.org/LDP/abs/html/dosbatch.html

Appendix L. Converting DOS Batch Files to Shell Scripts

Quite a number of programmers learned scripting on a PC running DOS. Even the crippled DOS batch file language allowed writing some fairly powerful scripts and applications, though they often required extensive kludges and workarounds. Occasionally, the need still arises to convert an old DOS batch file to a UNIX shell script. This is generally not difficult, as DOS batch file operators are only a limited subset of the equivalent shell scripting ones.

Table L-1. Batch file keywords / variables / operators, and their shell equivalents

Batch File OperatorShell Script EquivalentMeaning
%$command-line parameter prefix
/-command option flag
\/directory path separator
===(equal-to) string comparison test
!==!!=(not equal-to) string comparison test
||pipe
@set +vdo not echo current command
**filename "wild card"
>>file redirection (overwrite)
>>>>file redirection (append)
<<redirect stdin
%VAR%$VARenvironmental variable
REM#comment
NOT!negate following test
NUL/dev/null"black hole" for burying command output
ECHOechoecho (many more option in Bash)
ECHO.echoecho blank line
ECHO OFFset +vdo not echo command(s) following
FOR %%VAR IN (LIST) DOfor var in [list]; do"for" loop
:LABELnone (unnecessary)label
GOTOnone (use a function)jump to another location in the script
PAUSEsleeppause or wait an interval
CHOICEcase or selectmenu choice
IFifif-test
IF EXIST FILENAMEif [ -e filename ]test if file exists
IF !%N==!if [ -z "$N" ]if replaceable parameter "N" not present
CALLsource or . (dot operator)"include" another script
COMMAND /Csource or . (dot operator)"include" another script (same as CALL)
SETexportset an environmental variable
SHIFTshiftleft shift command-line argument list
SGN-lt or -gtsign (of integer)
ERRORLEVEL$?exit status
CONstdin"console" (stdin)
PRN/dev/lp0(generic) printer device
LPT1/dev/lp0first printer device
COM1/dev/ttyS0first serial port

Batch files usually contain DOS commands. These must be translated into their UNIX equivalents in order to convert a batch file into a shell script.

Table L-2. DOS commands and their UNIX equivalents

DOS CommandUNIX EquivalentEffect
ASSIGNlnlink file or directory
ATTRIBchmodchange file permissions
CDcdchange directory
CHDIRcdchange directory
CLSclearclear screen
COMPdiff, comm, cmpfile compare
COPYcpfile copy
Ctl-CCtl-Cbreak (signal)
Ctl-ZCtl-DEOF (end-of-file)
DELrmdelete file(s)
DELTREErm -rfdelete directory recursively
DIRls -ldirectory listing
ERASErmdelete file(s)
EXITexitexit current process
FCcomm, cmpfile compare
FINDgrepfind strings in files
MDmkdirmake directory
MKDIRmkdirmake directory
MOREmoretext file paging filter
MOVEmvmove
PATH$PATHpath to executables
RENmvrename (move)
RENAMEmvrename (move)
RDrmdirremove directory
RMDIRrmdirremove directory
SORTsortsort file
TIMEdatedisplay system time
TYPEcatoutput file to stdout
XCOPYcp(extended) file copy
Note

Virtually all UNIX and shell operators and commands have many more options and enhancements than their DOS and batch file counterparts. Many DOS batch files rely on auxiliary utilities, such as ask.com, a crippled counterpart to read.

DOS supports only a very limited and incompatible subset of filename wild-card expansion, recognizing just the * and ? characters.

Converting a DOS batch file into a shell script is generally straightforward, and the result ofttimes reads better than the original.

Example L-1. VIEWDATA.BAT: DOS Batch File

REM VIEWDATA

REM INSPIRED BY AN EXAMPLE IN "DOS POWERTOOLS"
REM BY PAUL SOMERSON


@ECHO OFF

IF !%1==! GOTO VIEWDATA
REM IF NO COMMAND-LINE ARG...
FIND "%1" C:\BOZO\BOOKLIST.TXT
GOTO EXIT0
REM PRINT LINE WITH STRING MATCH, THEN EXIT.

:VIEWDATA
TYPE C:\BOZO\BOOKLIST.TXT | MORE
REM SHOW ENTIRE FILE, 1 PAGE AT A TIME.

:EXIT0

The script conversion is somewhat of an improvement. [1]

Example L-2. viewdata.sh: Shell Script Conversion of VIEWDATA.BAT

#!/bin/bash
# viewdata.sh
# Conversion of VIEWDATA.BAT to shell script.

DATAFILE=/home/bozo/datafiles/book-collection.data
ARGNO=1

# @ECHO OFF Command unnecessary here.

if [ $# -lt "$ARGNO" ] # IF !%1==! GOTO VIEWDATA
then
less $DATAFILE # TYPE C:\MYDIR\BOOKLIST.TXT | MORE
else
grep "$1" $DATAFILE # FIND "%1" C:\MYDIR\BOOKLIST.TXT
fi

exit 0 # :EXIT0

# GOTOs, labels, smoke-and-mirrors, and flimflam unnecessary.
# The converted script is short, sweet, and clean,
#+ which is more than can be said for the original.

Ted Davis' Shell Scripts on the PC site has a set of comprehensive tutorials on the old-fashioned art of batch file programming. Certain of his ingenious techniques could conceivably have relevance for shell scripts.

Notes

[1]

Various readers have suggested modifications of the above batch file to prettify it and make it more compact and efficient. In the opinion of the ABS Guide author, this is wasted effort. A Bash script can access a DOS filesystem, or even an NTFS partition (with the help of ntfs-3g) to do batch or scripted operations.

http://blogs.msdn.com/ie/archive/2008/06/10/introducing-ie-emulateie7.aspx

Introducing IE=EmulateIE7

Bill Gates’ recent Tech Ed keynote and Tony Chor’s follow-up blog announced that IE8 Beta 2 will be available in August in many languages. We are encouraging sites to get ready for Beta 2 prior to release as it will present a big jump in IE8 browsing traffic.

What does “getting ready for IE8” mean for web sites? IE8 displays content in IE8 Standards mode – its most standards-compliant layout mode – by default. In previous blog posts, we’ve discussed how this aligns with our commitment to Web standards interoperability. However, browsing with this default setting may cause content written for previous versions of IE to display differently than intended. This creates a “get ready” call to action for site owners to ensure their content will continue to display seamlessly in IE8.

The preferred response to this call to action is to update the site to ensure that IE8 is provided with standards content fitting the DOCTYPE. However, we know it is very important to give site owners the chance to update site content on their schedule without affecting user experience. As such, we provide a meta-tag that tells IE8 to display an entire site or a specific page like it did in IE7.

In IE8 Beta 1, that option is the “IE=7” X-UA-Compatible tag, which instructs IE8 to display content in IE7 Standards mode. However, the scenario this doesn’t address is when IE=7 is applied as an HTTP header to a site that contains Quirks mode pages. The IE=7 HTTP header will force all pages – both Quirks and Standards – to display in IE7 Standards mode. Developers using this header while updating their sites would then have to add the “IE=5” tag to each page they want to keep in Quirks mode. This logic is fine for many websites. However, if a site has lots of Quirks mode pages, or for the case where pages with frames host a mix of Strict and Quirks mode content – as brought to light by IE8 Beta 1 user feedback – the compatibility opt-out adds a bit more work than we intended.

In response to the great IE8 Beta 1 feedback we’ve received so far, we are introducing the “IE=EmulateIE7” tag to address this problem. EmulateIE7 tells IE8 to display standards DOCTYPEs in IE7 Standards mode, and Quirks DOCTYPEs in Quirks mode. We believe this will be the preferred IE7 compatibility mode for most cases. Support for IE=EmulateIE7 is available now as part of the IE June Security Update for IE8 Beta 1. Installing this update will enable you to verify you’ve applied the EmulateIE7 tag to your site correctly.

In summary, IE7 compatibility support looks as follows:

Content Value

Details

IE=7

Display in IE7 Standards mode; Already supported in the IE8 Beta 1 release

IE=EmulateIE7

Display standards DOCTYPEs in IE7 Standards mode; Display quirks DOCTYPEs in Quirks mode; Available through the IE June Security Update for IE8 Beta 1

There are two ways to implement this tag:

  • On a per-site basis, add a custom HTTP header

X-UA-Compatible: IE=EmulateIE7

  • On a per-page basis, add a special HTML tag to each document, right after the tag

Implementing the HTTP header is beneficial if a site owner wants most of their site to render as it did in IE7 or if there are no plans to update site content. Inclusion of this header honors any Quirks mode pages that belong to the site.

Using the meta-tag on a per-page basis is beneficial when the publisher wants to opt-in specific pages to render as they did in IE7.

NOTE: The X-UA-Compatible tag and header override any existing DOCTYPE. Also, the mode specified by the page takes precedent over the HTTP header. For example, you could add the EmulateIE7 HTTP header to a site, and set specific pages to display in IE8 mode (by using the meta-tag with content=”IE8”).

Using the IE=EmulateIE7 compatibility tag is a simple way for users to continue their current experience when browsing your site until you can update with more standards-compliant content. Although adding this tag will prevent most display issues, you may also need to update your site to properly detect IE8. To learn more about IE8 document compatibility and browser detection, check out the IE Compatibility Center.

Jefferson Fletcher
Product Manager
Internet Explorer

P.S.: Here are some links to reference for adding custom HTTP headers on various versions of IIS and Apache servers: IIS7.0, IIS6.0, Apache 2.2, Apache 2.0, Apache 1.3

Published Tuesday, June 10, 2008 2:15 PM by ieblog Filed under: , ,
--
map{ map{tr|10|# |;print} split//,sprintf"%.8b\n",$_}
unpack'C*',unpack'u*',"5`#8<3'X`'#8^-@`<-CPP`#8V/C8`"

http://www.robvanderwoude.com/userinput.php

User Input

Sometimes we need some user interaction in our batch files.
We may need to know to which directory a file is to be copied, for example.
Or which drive needs to be formated.

There are many ways to achieve this user interaction.

The most basic form of user interaction, of course, is the PAUSE command, which halts the batch file until the user presses "any key" (apart from Ctrl, Alt, Shift, CapsLock, NumLock or ScrollLock).
Maybe not really sophisticated, but it works and is always available, in all DOS, Windows and OS/2 versions.
MS-DOS

In the MS-DOS 3 days, a simple Yes/No question could be answered by changing to a temporary directory where two temporary batch files were located, Y.BAT and N.BAT.
Guess what happend if a user typed a completely different answer . . .

Since MS-DOS 6 we have CHOICE.COM (CHOICE.EXE in later versions), a much more versatile and reliable way to solve one character answers like Yes/No.

Unfortunately, the CHOICE command was discontinued in Windows NT 4 and later.
You may want to try my Poor Man's Choice instead, or use DEBUG to create REPLY.COM, as published in Microsoft Knowledge Base article Q77457: Accepting Keyboard Input in Batch Files.

There is another way to receive user input: COPY CON

The command:

COPY CON filename

copies the user input on the command line to the file filename.
To stop entering user input, the user has to type Ctrl+Z (or F6), followed by the Enter key.

Many PC users and batch file authors (including myself), find this approach "less intuitive", to say the least. One would expect that pressing the enter key is enough, and once you find out it isn't, the previous line of input cannot be removed anymore.

The following trick uses ANSI to perform some key translation: the Enter key is translated to the F6 key followed by the Enter key. Thus only one line of input can be entered, and pressing the Enter key sends the input to the temporary file USERINP.TMP.

ECHO Enter some input, and press Enter when ready . . .
ECHO ←[13;0;64;13p
COPY CON USRINPUT.TMP
ECHO ←[13;13p
CLS
ECHO You typed:
TYPE USRINPUT.TMP

Note: The ← character is the Esc character, or ASCII character 27 (or 1B Hexadecimal).
It is a representation of the Esc key.
This Esc character is not to be confused with escape characters!

The previous example is only a bare minimum. The following example not only asks for user input, but stores it in an environment variable USRINPUT as well:

@ECHO OFF
REM * Ask for USeR INPUT and store it in variable USRINPUT
REM * Written by Rob van der Woude

SET USRINPUT=

REM * Turn on ANSI key translation (translate Enter
REM * key to F6+Enter sequence) and ask for input:
ECHO ←[13;0;64;13pEnter one word only . . .

REM * Copy entered text to temporary file:
COPY CON %TEMP%.\~USRINP.TMP

REM * Turn off ANSI key translation and clear irrelevant screen output:
ECHO ←[13;13p←[3A←[K←[1B←[K←[1B←[K←[2A

REM * Add empty line to temporary file. The empty line
REM * will be used to stop DATE asking for new date.
ECHO.>> %TEMP%.\~USRINP.TMP
ECHO.>> %TEMP%.\~USRINP.TMP

REM * Create a temporary batch file that will store the
REM * entered text into the environment variable USRINPUT:
TYPE %TEMP%.\~USRINP.TMP | DATE | FIND "):" > %TEMP%.\~USRINP.BAT

REM * Create more temporary batch files. Add
REM * more command line parameters if necessary,
REM * as in: ECHO SET USRINPUT=%%3 %%4 %%5 %%6 %%7 %%8 %%9>CURRENT.BAT
ECHO SET USRINPUT=%%3>CURRENT.BAT

REM * VOER.BAT and TYP.BAT are replacements for CURRENT.BAT for Dutch
REM * DOS versions; add your own language versions if necessary:
ECHO SET USRINPUT=%%6>VOER.BAT
ECHO SET USRINPUT=%%4>TYP.BAT

REM * This temporary batch file now sets the variable USRINPUT:
CALL %TEMP%.\~USRINP.BAT

REM * Display the result:
ECHO You typed: ←[1m%USRINPUT%←[0m
ECHO.
PAUSE

REM * Finally, clean up the mess of temporary files:
FOR %%A IN (%TEMP%.\~USRINP.BAT %TEMP%.\~USRINP.TMP VOER.BAT TYP.BAT CURRENT.BAT) DO DEL %%A

Click to view source Click to download the ZIPped sources

The previous batch file should work in every DOS version, assuming ANSI.SYS (or one of its replacements, like ANSI.COM) is loaded.
With a few minor adjustments (replace .BAT with .CMD everywhere) it can be used in OS/2 as well. Use READLINE instead, however, in OS/2's DOS sessions.

The following batch file checks if ANSI.SYS is loaded. If so, it will tell the user to press the Enter key only. If not, it will tell the user to press F6 first, followed by the Enter key.
However, to check if ANSI.SYS is loaded, this batch file needs MS-DOS 6 or later.

@ECHO OFF
REM * Asks for USeR INPut and store it in variable USRINPUT
REM * Uses ANSI if available, but works without ANSI too
REM * Assumes MS-DOS 6 or later
REM * Written by Rob van der Woude
REM * http://www.robvanderwoude.com

SET USRINPUT=

REM * Check if ANSI sequences can be used (needs at
REM * least MS-DOS 6 to get an errorlevel from FIND):
SET ANSI=1
MEM /C | FIND "ANSI" > NUL
IF ERRORLEVEL 1 SET ANSI=0

REM * Turn on ANSI key translation (translate Enter
REM * key to F6 + Enter sequence) if possible:
IF "%ANSI%"=="1" ECHO ←[13;0;64;13p

REM * Ask for input:
IF "%ANSI%"=="0" ECHO Enter one word only, and press F6 followed by Enter . . .
IF "%ANSI%"=="1" ECHO Enter one word only, and press Enter . . .

REM * Copy entered text to temporary file:
COPY CON %TEMP%.\~USRINP.TMP

REM * Turn off ANSI key translation and clear irrelevant screen output:
IF "%ANSI%"=="0" CLS
IF "%ANSI%"=="1" ECHO ←[13;13p←[3A←[K←[1B←[K←[1B←[K←[2A

REM * Add empty line to temporary file. The empty line
REM * will be used to stop DATE asking for new date.
ECHO.>> %TEMP%.\~USRINP.TMP
ECHO.>> %TEMP%.\~USRINP.TMP

REM * Create a temporary batch file that will store the
REM * entered text into the environment variable USRINPUT:
TYPE %TEMP%.\~USRINP.TMP | DATE | FIND "):" > %TEMP%.\~USRINP.BAT

REM * Create more temporary batch files. Add
REM * more command line parameters if necessary,
REM * as in: ECHO SET USRINPUT=%%3 %%4 %%5 %%6 %%7 %%8 %%9>CURRENT.BAT
ECHO SET USRINPUT=%%3>CURRENT.BAT

REM * VOER.BAT and TYP.BAT are replacements for CURRENT.BAT for Dutch
REM * DOS versions; add your own language versions if necessary:
ECHO SET USRINPUT=%%6>VOER.BAT
ECHO SET USRINPUT=%%4>TYP.BAT

REM * This temporary batch file now sets the variable USRINPUT:
CALL %TEMP%.\~USRINP.BAT

REM * Display the result:
IF "%ANSI%"=="0" ECHO You typed: %USRINPUT%
IF "%ANSI%"=="1" ECHO You typed: ←[1m%USRINPUT%←[0m
ECHO.
PAUSE

REM * Finally, clean up the mess of temporary files:
FOR %%A IN (%TEMP%.\~USRINP.BAT %TEMP%.\~USRINP.TMP VOER.BAT TYP.BAT CURRENT.BAT) DO DEL %%A
SET ANSI=


Click to view source Click to download the ZIPped sources


In NT we don't need temporary files and we can skip a few lines by using TYPE CON and FOR /F:

@ECHO OFF
:: UserInNT.bat
:: How to use the TYPE CON command to receive user input
:: Written by Rob van der Woude
:: http://www.robvanderwoude.com

ECHO.
ECHO Demonstration of receiving user input through the TYPE CON command.
ECHO Type in any string and close by pressing Enter, F6 (or Ctrl+Z), Enter.
ECHO Only the last non-empty line will be remembered, leading spaces are ignored.
ECHO.

:: Only one single command line is needed to receive user input
FOR /F "tokens=*" %%A IN ('TYPE CON') DO SET INPUT=%%A
:: Use quotes if you want to display redirection characters as well
ECHO You typed: "%INPUT%"

It is still just as un-intuitive as the first COPY CON example, though.

Click to view source Click to download the ZIPped sources

Latest news: Replace TYPE CON by MORE in the above NT batch file and you can save yourself pressing Enter once -- you'll need to press F6, Enter only instead of Enter, F6, Enter, though the latter will still work.
[Tip posted by "Frank" on alt.msdos.batch.nt]

Tom Lavedas' New and Improved Data Input Routine! shows a way to use a graphical box to ask for user input in Windows 95

Duke Communications International, Inc.'s tip # 0323: How can I get a batch file to prompt me for parameters? shows a way to get a graphical box asking for user input in Windows NT

Walter Zackery posted two interesting solutions to obtain user input in NT, on the alt.msdos.batch.nt news group.

One solution uses the FORMAT command, which will fail since it tries to format a diskette in drive A: at 160KB.
If you have a 5¼" drive as your A: drive don't use this one.

The second solution uses the LABEL command.
It will actually change drive C:'s volume label and then restore it again to its old value.
The volume label in NT is restricted to 32 characters, and so is the input string when using this LABEL trick for user input.
Besides that the batch file limits the string to 2 words (1 space) only.

I adapted the original postings so that the batch files no longer need to use temporary files. You can view the original postings at my Solutions found at alt.msdos.batch page.

Click to view source Using FORMAT
Click to view source Using LABEL
Click to download the ZIPped sources


Clay Calvert posted another interesting solution to obtain Yes or No input in most DOS versions by using DEL's /P switch (prompt for confirmation).

Another great solution by Eric Phelps uses a temporary HTA file to obscure a password while it is being typed.
Windows 2000/XP

In Windows 2000, user input can be obtained quite easily by using SET /P

SET /P variable=[promptString]

This command will display an optional promptString where the user can type in a string and press Enter. The typed string will then be stored in the specified environment variable variable.
KiXtart

A non-batch solution for Windows 95/98/NT/2000 users is the GETS function in KiXtart:

@ECHO OFF
:: UsrInKix.bat, Version 1.00 for Win32
:: Batch file using Kix to retrieve user input
:: Written by Rob van der Woude
:: http://www.robvanderwoude.com

:: Create a temporary Kix script that will
:: in turn create a temporary batch file:
> %TEMP%.\UserIn.kix ECHO REDIRECTOUTPUT( "NUL" )
>>%TEMP%.\UserIn.kix ECHO GETS $UserIn
>>%TEMP%.\UserIn.kix ECHO IF OPEN( 1, "@SCRIPTDIR\UserIn.bat", 5 ) = 0
>>%TEMP%.\UserIn.kix ECHO WRITELINE( 1, "SET UserIn=" + $UserIn )
>>%TEMP%.\UserIn.kix ECHO ELSE
>>%TEMP%.\UserIn.kix ECHO ? "Error opening temporary file, errorcode = " + @ERROR
>>%TEMP%.\UserIn.kix ECHO ENDIF
:: Prompt for user input:
ECHO Type anything you like and press Enter when finished:
:: retrieve user input using the Kix script, and
:: then store the result in a temporary batch file:
KIX32.EXE %TEMP%.\UserIn.kix
:: Call the temporary batch file to store
:: the result in an environment variable:
CALL %TEMP%.\UserIn.bat
:: Clean up the temporary files:
IF EXIST %TEMP%.\UserIn.* DEL %TEMP%.\UserIn.*
:: Finaly, display the result:
ECHO You typed: %UserIn%


Click to view source Click to download the ZIPped sources

VBScript

More advanced dialog boxes, output and input, including (masked) password prompts, can be created using VBScript and Internet Explorer, but I would not recommend creating them on the fly.
Sample change password dialog created using VBScript and Internet Explorer

See the VBScript Scripting Techniques section for some of these advanced user message windows.
OS/2

OS/2 users may want to take a look at UserInPM, a utility written in VX-Rexx, displaying a small PM window asking for user input.
It creates a temporary batch file to set an environment variable to the typed input.
An example batch file, with the resulting PM window:

SET USRINPUT=
USRINPUT.EXE Type whatever you like:
CALL USRINPUT.CMD
ECHO User input: %USRINPUT%

USRINPUT dialogue window

You will need the VX-Rexx runtime library VROBJ.DLL to run UserInPM.

http://www.robvanderwoude.com/pmadmin.php#PMChoice

The Poor Man's Administrator Tools

This page is dedicated to administrators tools and tips based on "native" and freeware utilities only.
Knowing these tools may prove extremely valuable when you're faced with problems "in the middle of nowhere", without your own set of utilities nearby.
NT

* Do you need a tool to remotely execute commands on any PC?
You could of course use RCMD from the Microsoft Windows NT Server Resource Kit. Or, if "third party tools" are allowed, PSEXEC is an excellent RCMD replacement, available at SysInternals.com for free.
Or you can use the AT command to schedule the command 2 minutes from now:

NET TIME \\remotePC /SET
AT \\remotePC 10:02 "your command goes here"

If you prefer not to change your system time, download either PMSoon.bat or AtFuture.bat.
PMSoon.bat will only work if the time difference between the two systems is 1 minute or less. It will display a warning message if the difference is greater.
AtFuture.bat (a coproduction with Rob Fuller), intended for local use only, does not have this limitation.
* Do you need to prevent login scripts from running on servers?
Use NTRole (update: this utility is no longer available for download) to determine if the current "workstation" is actually a server or not.
Some company policies do not allow third party tools, however.
Of course, I wouldn't have mentioned NTRole here if I didn't have a "poor man's version" available: NTRole.bat.
Download the ZIPped version.
* Did you ever try to redirect or pipe CACLS' output in NT 4?
If you ever installed an NT Service Pack, what you probably saw were the permissions without the user IDs or groups that those permissions belonged to.
Instead of using XCACLS from the Microsoft Windows NT Server Resource Kit, extract CACLS from your original NT 4 CD-ROM and use that version whenever you need to redirect its output.
XCACLS' /Y switch can be emulated by piping a Y to CACLS' standard input:

ECHO Y| CACLS .....
Warning: Do not use the old CACLS version to set or change permissions if you have any NT 4 Service Pack applied.
A safe way to prevent yourself from accidentally using the old version is to rename the old CACLS.EXE to OLDCACLS.EXE.
* Disappointed because the CHOICE command wasn't implemented in NT? I know I was.
You could buy yourself a copy of the Microsoft Windows NT Server or Workstation Resource Kit.
Or you could download both PMChoice.bat and PMChoice.kix. The only missing part of this combination is that PMCHOICE does not accept redirected input, only keyboard input.
* SHORTCUT.EXE from the Microsoft Windows NT Server or Workstation Resource Kit is a great tool to set or read a shortcut's properties.
Many times, however, it is used just to read the path of a program file. In that case you may want to download Shortcut.bat, a batch file that uses internal commands only to read both the UNC and the fully qualified path from one or more shortcut files.

If you do need to create shortcuts, learn how to create shortcuts using INF files from this posting by Walter Zackery to the alt.msdos.batch.nt news group, and from this article by Daniel U. Thibault.
* If you ever need to create a fixed time delay in a batch file, but you do not have a copy of SLEEP.EXE from the NT Resource Kit available, just download PMSleep.bat (for Windows NT/2000) or PMSlpW9x.bat (for Windows 95/98).
These batch files use PING's -W switch to create a delay.
The following example will create a 1 minute delay in Windows NT and 2000:

CALL PMSLEEP.BAT 60

Due to limitations in the MS-DOS 7 batch language, we need to add 1 to the number of seconds specified in Windows 95 and 98:

CALL PMSLPW9X.BAT 61

This Windows 9x example will wait for 60 seconds, not 61.

You may also choose to download the latest KiXtart version from www.kixtart.org and use its SLEEP function within your batch file.
The following example will create a 1 minute delay:

ECHO $RC = SLEEP 60 > "%TEMP%.\SLEEP.KIX"
KIX32.EXE "%TEMP%.\SLEEP.KIX"
DEL "%TEMP%.\SLEEP.KIX"

This KiXtart script will work in all 32-bit Windows versions, as long as KiXtart is installed.

http://academic.evergreen.edu/projects/biophysics/technotes/program/ansi_esc.htm#notes





Programming













ANSI.SYS Escape Sequences
















































































































































































































































































































































Cursor Commands

Cursor Up {ESC}[<row>A
Moves the cursor up the specified number of rows without changing the column.

<row> is a number from 1 through 24 that specifies how many rows the cursor is to be moved up.
If you omit <row>, DOS moves the cursor up one row.
    examples {ESC}[13A Move the cursor up 13 rows

{ESC}[A Move the cursor up 1 row

Cursor Down {ESC}[<row>B
Moves the cursor down the specified number of rows without changing the column.

<row> is a number from 1 through 24 that specifies how many rows the cursor is to be moved down.
If you omit <row>, DOS moves the cursor down one row.
    examples {ESC}[8B Move the cursor down eight rows.

{ESC}[B Move the cursor down one row.

Cursor Right {ESC}[<col>C
Moves the cursor right the specified number of columns without changing the row.

<col> is a number from 1 through 79 that specifies how many columns that cursor is to be moved right.
If you omit <col>, DOS moves the cursor right one column.
    examples {ESC}[40C Move the cursor right 40 columns.

{ESC}[C Move the cursor right one column.

Cursor Left {ESC}[<col>D
Moves the cursor left the specified number of columns without changing the row.

<col> is a number from 1 through 79 that specifies how many columns the cursor is to be moved left.
If you omit <col>, DOS moves the cursor left one column.
    examples {ESC}10[D Move the cursor left ten columns.

{ESC}[D Move the cursor left one column.

Move Cursor {ESC}[<row>;<col>H or {ESC}<row>;<col>f
Moves the cursor to the specified row and column.

<row> is a number from 1 through 25 that specifies the row to which the cursor is to be moved. If you omit <row>, DOS moves the cursor to row 1. To omit <row> but specify <col>, enter the semicolon to show the <row> is omitted.
<col> is a number from 1 through 80 that specifies the column to which the cursor is to be moved. If you omit <col>, DOS moves the cursor to column 1.
If you omit both <row> and <col>, DOS moves the cursor to the home position (row 1, column 1--the upper left corner of the screen).
    examples {ESC}[;10H Move the cursor to column 10, row 1.

{ESC}[H Move the cursor to row 1, column 1.

Save Cursor Position {ESC}[s
Stores the current row and column position of the cursor.

You can move the cursor to this location with a Restore Cursor Position command.
    examples {ESC}[s Save the current cursor position.

Report Cursor Position {ESC}[6n
Returns the current row and column position of the cursor in the form {ESC}[<row>;<col>R.

<row> is a number from 1 through 25 that specifies the row where the cursor is located.
<col> is a number from 1 through 80 that specifies the column where the cursor is located.
    examples {ESC}[6n Report the current cursor position.

Restore Cursor Position {ESC}[u
Moves the cursor to the row and column position most recently saved with a Save Cursor Position command.
    examples {ESC}[u Move the cursor the row and column last saved with a Save Cursor Position command.

Erase Commands

Erase Display {ESC}[2J
Erases the entire display (equivalent to the DOS Clear Screen or cls command).
    examples {ESC}[2J Erase the screen.

Erase to End of Line {ESC}[K
Erases from the current cursor position through the end of the line that contains the cursor.
    examples {ESC}[K Erase from the cursor to the end of the line.

Display Attribute and Mode Commands

Set Attribute {ESC}[<attr>m
Turns on a characteristic or attribute of the display, such as high intensity, blink, or foreground and background color.

<attr> specifies the display attribute to be turned on. More than one attribute can be specified by using a semicolon to separate the attribute numbers. <attr> can be any of the following:


































Text AttributeValue
None0
High Intensity
(bold)
1
Underline
(monochrome display only)
4
Blink5
Reverse7
Invisible8

 

































Color
Attribute
Foreground
Value
Background
Value
Black3040
Red3141
Green3242
Yellow3343
Blue3444
Magenta3545
Cyan3646
White3747


If you omit <attr>, all attributes are turned off (equivalent to specifying <attr> as 0).
    examples {ESC}[1m High intensity.

{ESC}[1;5m High intensity and blink.

{ESC}[30;46m Black foreground, cyan background.

{ESC}[m Turn off all attributes.

{ESC}[0m Turn off all attributes.

{ESC}[0;1;36m Turn off all attributes, then turn on high-intensity cyan foreground.

Set Display Mode {ESC}[=<mode>h
Sets the width and color capability of the display (generally equivalent to the DOS MODE command). This command can also be used to cause lines longer than 80 characters to be broken at the 80th character and continued on the next line, rather than truncated at the 80th column; this is called line wrap. It can be turned off with the Turn Off Line Wrap command. Note the equal sign (=) that precedes <mode>.

<mode> specifies the display mode. It can be one of the following:






































Display ModeValue
40 columns by 25 rows, black and white0
40 columns by 25 rows, color on1
80 columns by 25 rows, black and white2
80 columns by 25 rows, color on3
320 by 200 graphics, color on4
320 by 200 graphics, black and white5
640 by 200 graphics, black and white6
Turn on line wrap7


    examples {ESC}[=1h Set the display to 40 by 25 color on.

{ESC}[=7h Continued lines longer than 80 characters, don't truncate them.

Turn Off Line Wrap {ESC}[=7l
Causes lines longer than 80 characters to be truncated at the 80th character, rather than continued to the next line.
    examples {ESC}[=7l Truncate lines longer than 80 characters.

Keyboard Commands

Define Key {ESC}[<key code>;<result>p
Assigns one or more characters to be produced when you press a key.

<key code> specifies the key to be defined. If the key is one of the standard ASCII characters, <key code> is a number from 1 through 127. If the key is a function key, keypad key, or a combination of the <Shift>, <Ctrl>, or <Alt> key and another key, <key code> is two numbers separated by a semicolon and can be found in the ANSI.SYS key code table.
<result> is the character or characters to be produced when a key is pressed. It can be specified as an ASCII code, an ANSI.SYS key code, a string enclosed in quotation marks, or any combination of codes and strings separated by semicolons.
To restore a key to its original meaning, enter a Define Key command that sets <result> equal to <key code>.
    examples {ESC}[126;92p Redefine the tilde <~> key as a backslash <\>.

{ESC}[126;126p Restore the tilde <~> key to its original meaning.

{ESC}[0;112;"dir|sort";13p Redefine <Alt><F9> as a Directory command piped to a Sort command, followed by a Carriage Return.

{ESC}[0;112;0;112p Restore <Alt><F9> to its original meaning.





Notes



Entering the {ESC} Character

  • In DOS:  Press and hold the <Alt> key, then type 27 on the keypad.
  • In Windows:  Press and hold the <Alt> key, then type 0027 on the keypad.
  • Exceptions:  Sometimes the above keystrokes do not work. Try one of the following methods:


    • In MS-DOS EDITOR and QBASIC, type any one of these:

      • <Ctrl>P, <Alt>027
      • <Ctrl>P, <Ctrl>[
      • <Ctrl>P, <Esc>


    • In Microsoft WORD, use a macro:

      • Sub AsciiEscChar()
           ' Insert ASCII Esc character.
           Selection.TypeText Chr(027)
        End Sub

      • Save the file as "Text Only" or "MS-DOS Text".


    • In Microsoft NOTEPAD and WORDPAD:

      • Copy the {ESC} character from another text file and paste it into the document.




Enabling ANSI.SYS


Before using escape seqences, ANSI.SYS must be named as a device driver in the CONFIG system file.



For Windows 95, Windows 98 and DOS:


  • Create or edit the CONFIG.SYS file.   (Found in the root directory.)
  • Add the following line to the file:
    DEVICE=<path>\ANSI.SYS
    where <path> is the full path of the ANSI.SYS file.   (Usually found in the WINDOWS directory.)

  • Save CONFIG.SYS with the new line.
  • Check that a copy of ANSI.SYS exists in the specified path location.
  • Restart the computer to complete the change.




For Windows NT, Windows 2000 and Windows XP:

  • Create or edit the CONFIG.NT file.   (Usually found in the WINNT\SYSTEM32 directory.)
  • Add the following line to the file:

    DEVICE=%systemroot%\system32\ANSI.SYS

  • Save CONFIG.NT with the new line.
  • Check that a copy of ANSI.SYS exists in the specified path location.
  • Restart the computer to complete the change.




Restrictions:

  • Windows NT does not support ANSI.SYS escape sequences in Win32 Console applications.
  • The Windows 2000/NT Command Interpreter, CMD.EXE, does not support ANSI.SYS. Use COMMAND.COM instead.



Using ANSI.SYS Escape Sequences


Because ANSI.SYS commands control the console device, they must be typed at the keyboard or sent to the display.




  • Put the ANSI.SYS commands in a file and display the file with the TYPE or COPY command.
  • Use the PROMPT command with the command prompt code, $e.
    Example:

    prompt $e[1;37;44m   (Set the text color to bright white and the screen color to blue.)

  • Use the ECHO command in a batch file.
    Example:
    echo {ESC}[8;26H   (Move the cursor to row 8, column 26.)
    To execute a batch file containing ANSI commands in Windows 2000/NT, use one of the following methods:


    • Open a DOS command prompt window and type the <batch path>.
    • Type %SystemRoot%\system32\COMMAND.COM /c <batch path> at the Run command line.
    • Create a program information file (PIF) by making a shortcut of COMMAND.COM, then set the Cmd Line property to the <batch path> and the Advanced Program properties to %SystemRoot%\system32\AUTOEXEC.NT and %SystemRoot%\system32\CONFIG.NT.



  • Use the WRITE, PRINT or a similiar command in FORTRAN, C, BASIC, etc.
    Example:
    WRITE(*,*)'{ESC}[2J'   (Clear the screen.)



File Syntax and Parameters






ANSI.SYS Examples



Batch File


SCREEN.BAT demonstrates some Display Attribute and Cursor commands.




Command Prompt


Type the line below in a COMMAND.COM window to change the DOS command prompt.



  • prompt=$_$d$_$t$h$h$h$_$e[1;37;43mMy Computer$e[44m $p$g
  • View a screen shot.




Other Resources






[  Index  |  Technical Notes  ]





DISCLAIMER



Page author: Dawn Rorvik (rorvikd@evergreen.edu)

Last modified: 07/17/2003



20090603

http://sial.org/howto/rsync/ loop[back

http://sial.org/howto/rsync/&nbsp;
Hey There,<br><br>The problem may be because<br><br>
<div class="smallfont" style="font-size: 11px; margin-bottom: 2px; ">Quote:</div><table cellpadding="3" cellspacing="0" border="0" width="100%"><tbody><tr><td class="bbcodeblock" style="background-color: rgb(207, 217, 255); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: inset; border-right-style: inset; border-bottom-style: inset; border-left-style: inset; border-color: initial; ">/home/ubuntu/dos/cd.squashfs</td></tr></tbody></table>from the /etc/fstab gets translated into&nbsp;<br><br><div class="smallfont" style="font-size: 11px; margin-bottom: 2px; ">Quote:</div><table cellpadding="3" cellspacing="0" border="0" width="100%"><tbody><tr><td class="bbcodeblock" style="background-color: rgb(207, 217, 255); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: inset; border-right-style: inset; border-bottom-style: inset; border-left-style: inset; border-color: initial; ">/dev/loop0</td></tr></tbody></table>once it's mounted.<br><br>Have you tried using this line in /etc/fstab instead?:<br><br><div class="smallfont" style="font-size: 11px; margin-bottom: 2px; ">Quote:</div><table cellpadding="3" cellspacing="0" border="0" width="100%"><tbody><tr><td class="bbcodeblock" style="background-color: rgb(207, 217, 255); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: inset; border-right-style: inset; border-bottom-style: inset; border-left-style: inset; border-color: initial; ">/dev/loop0 /home/ubuntu/dos/cd squashfs user,loop,ro 0 0</td></tr></tbody></table>It may or may not work, but it's worth a shot&nbsp;<img src="http://http.cdnlayer.com/lq/images/questions/images/smilies/smile.gif" border="0" alt="" title="Smilie" class="inlineimg" style="vertical-align: middle; "><br><br>Best wishes,<br>

macfuse

<a name="Compiling_Other_FUSE_File_Systems_Written_for_Linux"></a>
<a name="Compiling_Other_FUSE_File_Systems_Written_for_Linux">When running the configure script for a file system, you&nbsp;<strong>need</strong>&nbsp;to have&nbsp;<tt>-D__FreeBSD__=10</tt>&nbsp;in&nbsp;<tt>CFLAGS</tt>. This is critical!
Often, using the&nbsp;<tt>macfuse_buildtool.sh</tt>&nbsp;script to configure the software for compilation will work. As in the case of&nbsp;<tt>sshfs</tt>&nbsp;above, go to the top-level compilation source directory (the one that contains a&nbsp;<tt>configure</tt>&nbsp;script) of the software in question and run&nbsp;<tt>macfuse_buildtool.sh</tt>.
</a>

ipod notes maximum size

Your iPod will only hold 1000 Notes. Also, each Note can have a maximum size of 4000 characters. TouchCopy ensures that any Notes you create conform to these restrictions. Note that these are restrictions defined by your iPod, not TouchCopy.<br class="khtml-block-placeholder">

bash trick start as root when user != root

&nbsp;&nbsp;3 main () {
&nbsp;&nbsp;4 if [[ "$(whoami)" != 'root' || "$(id -u)" != 0 ]]; then
&nbsp;&nbsp;5 &nbsp; &nbsp;echo -e "Please give your user passwd, prog needs to run as root" ARH
&nbsp;&nbsp;6 &nbsp; &nbsp;/usr/bin/sudo $0 &nbsp;7 else

20090602

make iso osx

hdiutil makehybrid -o ~/image.iso ~/foo -iso -joliet<br class="khtml-block-placeholder">