The online installer is pretty much automated.If you are on an NT Domain (as is the case for all unclassified LM computers, for instance), then you should furthermore see the section on Cygwin and NT Domains.
Improve your classified Cygwin installation by properly configuring bash and rxvt!
How do I install Cygwin on a NON-networked [for instance, classified] computer?
Why am I called "Administrator"?
First of all, be assured that whatever Cygwin may call you,
you are not logged in as administrator, and have no access
rights beyond what you had before you installed Cygwin.
Still, if you leave yourself logged on with an incorrect username
such as "administrator", you'll have all kinds of problems using
chmod and other tools.
Moreover, even the label of "administrator" is disconcerting to many
admins, so it's best to fix it using the process outlined below.
Therefore, if you are on an NT Domain, such as is the case for all
LM PC's on the unclassified network, then you must
make an extra few steps when installing Cygwin to manually map
your login rights.
As far as I know, if your PC is not on an NT domain, you do not have
to do these steps. In particular, that means that this section
does not apply to many classified PC's, which are often not connected to NT
domain controllers.
I just installed Octave, and now my Cygwin's hosed!
Apparently Octave overwrites some Cygwin registry key or other, and makes Cygwin think
its "root" is under Octave. Once you fix the Cygwin path, both
programs continue to work correctly (AFAIK).
I use PuTTY, from
http://www.chiark.greenend.org.uk/~sgtatham/putty/. It's free,
it does SSH as well as telnet (if you're into that), it lets you
resize windows easily, lets you configure meta-keys for those
apps that use them...it's pretty darn good.
About the only terminal apps that I might prefer to Putty are
CRT and
SecureCRT
from VanDyke ($35 and $99, respectively). Still, PuTTY is PlenTY
good enough for government work, as it were :-)
I understand that 'bash' is becoming a default on many
platforms from Linux to Cygwin, and I have decided
that I need to use it more to learn about it. How do I
set it up so I can start working productively?
How do I [...] in vi?
Instead, use the Windows Notepad (or Textpad, or whatever)
to create the following file, called "tcsh.bat", in C:\cygwin:
Then you'll need working .cshrc and .login files in your home
directory. Here are working samples:
How do I find out what packages are installed, etc?
Before you settle on the following tips for improving the DOS window,
you may want to replace it altogether using the built-in
X Server, complete with xterm, or just
run rxvt without the overhead of X.
However, any of the three options will work fine for most people.
It's all a matter of preference.
To make the DOS window wider:
This still isn't as good as a real X terminal! Why can't I just run X?
However, it's ugly and only barely functional. For a more aestheticly
pleasing and practical configuration, I suggest you follow a variant
of these steps:
If you want to adjust the fonts to whatever suits you, type "xfontsel"
(from within X Windows) to launch a graphical font selector. After you
find a font/size combination that works for you, edit your
.Xresources file to configure xterm (or whatever) to use it.
Okay, X is too much. I don't need the overhead. Can I just run
an X-like terminal window, but not X itself?
If you've installed the rxvt package, you can run it from
Windows without having a full X-server running, as long as
you don't have a DISPLAY variable set in your environment.
Suggested procedure:
then click "Next-->"
Cygwin has a very messy relationship with NT security. The simple
fact is that NT security is very different from Unix security, and
a one-to-one mapping just isn't possible. Cygwin does the best it
can. You can explore
the details if you wish.
In the second call to mkpasswd, above, use the username
and domain name you use to log into Windows PC. For me, that's
"ziegm" and "ACCT03". For many LM employees, their
username will be the same as their badge number. Also, do not
reverse the order of the "-u username" and "-d domain" options!
Positional sequence matters in that case, unfortunately.
bash $ export CYGWIN=ntsec
or
csh % setenv CYGWIN ntsec
mkpasswd -l > /etc/passwd
mkpasswd -u username -d domain >> /etc/passwd
$ echo $USER
Yeah, it does that. Just re-run the Cygwin setup.exe program,
and manually replace the "C:\Program Files\Octave" path (or whatever)
with C:\cygwin (or wherever you put your Cygwin).
Cygwin Usage
Windows/Cygwin telnet bites. Is there anything better?
Absolutely. I can't stand them myself. All kinds of buggy
issues with changing window size, vi sessions getting scrambled
formatting, etc.
Here is my Cygwin .bash_profile, as a start (Linux users can
check ~mzieg/.bash_profile on cvs-oa for an almost-identical
Linux example)...
# .bash_profile
# set colors and prompt
export PS1="\[\e]2;peter:\w\007\e[1;36m\]peter [\[\e[1;35m\]\w\[\e[1;36m\]] \u $ \[\e[1;33m\]"
# configure history editing
set -o vi
export HISTSIZE=1000
export HISTFILE=~/.history
export HISTFILESIZE=1000
export EDITOR=vi
# set aliases for colors
alias vi=vim
alias dir='ls -lav --color=auto'
# winshit
export CYGWIN="ntsec"
# display
# export DISPLAY=localhost:0
# place nice
umask 022
# cvs
export CVSROOT=":ext:mzieg@cvs-oa.orl.lmco.com:/usr/local/cvsroot"
export MAKEFLAGS="--no-print-directory"
# construct path
unset PATH
for i in \
~/bin \
/bin \
/usr/bin \
/usr/local/bin \
/sbin \
/usr/sbin \
/usr/X11R6/bin \
/cygdrive/c/WINNT/MS/SMS/CORE/BIN \
/cygdrive/c/WINNT/system32 \
/cygdrive/c/WINNT \
/cygdrive/c/WINNT/System32/Wbem \
/cygdrive/c/Program\ Files/Support\ Tools \
/cygdrive/c/NTRESKIT \
/cygdrive/c/stuff \
/cygdrive/c \
/cygdrive/c/S11/DLL \
/cygdrive/c/MMCSW/BISNET
do
if [ -d "$i" ] ; then
if [ -z "$PATH" ] ; then
PATH=$i
else
PATH="$PATH:$i"
fi
else
echo "Warning: can't append $i to PATH because it doesn't exist."
fi
done
export PATH
# PRISM variables
export DATA_HOME=~/PRISM/BaseData
export MAKE_HOME=~/PRISM/BasePrograms
export PATH="$PATH:$MAKE_HOME/config/bin:$MAKE_HOME/config/cygwin/bin"
And just to complete the magic, here's the corresponding
~/.vimrc to make text editing every bit as enjoyable as
command-line navigation :-)
set autoindent
set softtabstop=4
set tabstop=4
set shiftwidth=4
set showmatch
set ignorecase
set background=dark
set hlsearch
set incsearch
set number
syntax on
# only set this last one if you understand the implication re: Makefiles!
set expandtab
How can I make 'csh' my default Cygwin login shell?
Don't bother editing /etc/passwd and changing your
"login shell" to /bin/tcsh; it doesn't work :-)
@echo off
c:\cygwin\bin\tcsh -l
This will
be analogous to the default C:\cygwin\cygwin.bat, which basically
does the same thing to launch the bash shell. Why not simply edit
cygwin.bat and point it to tcsh instead? You can try that, but
it may not be preserved between Cygwin updates/reinstalls/package
additions, etc.
# .cshrc
#
# this file gets executed with every subshell
# is this an interactive shell?
if ( $?prompt ) then
# yes, we're in an interactive shell
# prompt
set prompt = "%{\033[1;36m%}peter %{\033[1;35m%}[%~] %{\033[1;36m%}%n \%%{\033[1;33m%} "
# history
set history = 1000
set savehist = 1000
set EDITOR = vim
set filec fignore = (.o)
# cmd-line bindings
bindkey -v ; # use vi key bindings
# display
set DISPLAY = localhost:0
# cvs
# set MAKEFLAGS = "--no-print-directory"
set CVSROOT = :ext:mzieg@cvs-oa.orl.lmco.com:/usr/local/cvsroot
# aliases
alias vi vim
alias dir 'ls -lav --color=auto'
alias nslookup host
endif
# .login
#
# this file gets executed ONCE when the user first logs in
# construct path
setenv PATH "~/bin"
foreach i ( \
/usr/local/bin \
/usr/bin \
/bin \
/usr/sbin \
/sbin \
/usr/X11R6/bin \
)
if ( -d "$i" ) then
if ( -z "$path" ) then
setenv PATH $i
else
setenv PATH ${PATH}:$i
endif
else
echo "Warning: can't append $i to PATH because it doesn't exist."
endif
end
# terminal options
stty -istrip ; # allow 8-bit chars for input
# share our files with the group
umask 002
(I'll give a nickle to whomever can explain why that gives a
"grep not found" message whenever I login :-)
Play with 'cygcheck -c' (see 'cygcheck --help' for options)
Cygwin Display
This dinky little 80-col DOS window is crap. How can I improve it?
Yes, you're running bash or tcsh, and thus your commands are being
interpreted by a Unix shell, but the window containing the shell
remains nothing more than a DOS window. Microsoft never provided
much in the way of widgets and controls to those windows, and it can
feel a little cramped.
To pick a better font (the default is fuggly):
You can! If you've installed the recommended PRISM developer
Cygwin package set, then you can already start a minimal X-Windows
GUI just by typing "startx".
Now, whenever you type "startx" from a Cygwin window,
you'll get a full X-Windows display, more-or-less comparable to
what you're accustomed to on "normal" Unix systems like SGI & Solaris.
#!/bin/sh
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/usr/X11R6/lib/X11/xinit/.Xresources
sysmodmap=/usr/X11R6/lib/X11/xinit/.Xmodmap
# merge in defaults and keymaps
test -f $sysresources && xrdb -merge $sysresources
test -f $sysmodmap && xmodmap $sysmodmap
test -f $userresources && xrdb -merge $userresources
test -f $usermodmap && xmodmap $usermodmap
# spawn x
fvwm2 &
exec xterm -geometry 120x30
XTerm.VT100.font: -*-lucidatypewriter-medium-*-*-*-14-*-*-*-*-*-*-*
XTerm.VT100.boldFont: -*-lucidatypewriter-bold-*-*-*-14-*-*-*-*-*-*-*
XTerm.VT100.scrollBar: True
XTerm.VT100.visualBell: True
XTerm.VT100.loginShell: True
XTerm.VT100.background: Black
XTerm.VT100.foreground: White
It turns out that this too is possible :-)
! rxvt.font: -*-lucidatypewriter-medium-*-*-*-14-*-*-*-*-*-*-*
! or...
rxvt.font: Lucida Console-14
rxvt.boldFont: Lucida Console-14
rxvt.scrollBar: True
rxvt.visualBell: True
rxvt.loginShell: True
rxvt.background: Black
rxvt.foreground: White
rxvt.saveLines: 3000
rxvt.cursorColor: Green
rxvt.scrollBar_right: True
# ~/bin/win
unset DISPLAY
rxvt -e bash -login &
@echo off
REM place in C:\cygwin\rxvt.bat and put
REM a shortcut on the desktop :-)
c:\cygwin\bin\rxvt -e /bin/bash -login
Other Sources of Information