博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
(转)cygwin个性化配置
阅读量:4623 次
发布时间:2019-06-09

本文共 3846 字,大约阅读时间需要 12 分钟。

配置 cygwin 中的服务程序

详细情况阅读 /usr/share/doc/Cygwin/cygserver.README,要让一个apache httpd或者 proftpd成功运行,在winxp下:

  • 需要把 /bin/cygrunsrvLocalSystem 的身份设置为系统服务,最简单的方法就是运行 脚本 /usr/bin/cygserver-config。这将在 "Control Panel > Admin Tools > Services" 里边出现一个名为 CYGWIN cygserver 的服务项目。
  • 然后设置环境变量 CYGWIN,最简单的方法就是在 cygwin.bat 中添加一句:
    set CYGWIN=server

配置服务或应用程序之前,阅读 =/usr/share/doc= 中罗列的文档

配置 apache httpd2 服务

配置 httpd2 很简单,直接用 setup 的安装程序安装好 httpd2。然后运行如下命令即可:

apachectl2 start
要是找不到 apachectl2,看看 /usr/sbin 有没有加入到 PATH 中。

配置 proftpd 服务

阅读 /usr/share/doc/proftpd-1.2.10/* 下的一堆文档,按照配置来,先test。

配置应用程序

配置rxvt

win的cmd实在太难用了,而我又不用cygwin的X系统,所以rxvt成了我最好的选择,这里是 我的颜色配置,写入 ~/.Xdefaults 即可:

Rxvt*title:             Cygwin-RxvtRxvt*geometry:          90x40-10+30Rxvt*background:        #BFDF74Rxvt*foreground:        #001123Rxvt*scrollBar_right:   trueRxvt*colorBD:           1Rxvt*font:              courier newRxvt*blodFont:          Courier NewRxvt*saveLines:         2000Rxvt.backspacekey:      ^?Rxvt*loginShell: True!! VIM-like colorsRxvt*color0:    #000000!Rxvt*color1:   #FFFFFFRxvt*color1:    #911B08Rxvt*color2:    #00A800Rxvt*color3:    #DD0000Rxvt*color4:    #0000A8Rxvt*color5:    #A800A8Rxvt*color6:    #00A8A8Rxvt*color7:    #D8D8D8Rxvt*color8:    #B5613BRxvt*color9:    #966BEBRxvt*color10:   #00A800Rxvt*color11:   #FFFF00Rxvt*color12:   #0000A8Rxvt*color13:   #A800A8Rxvt*color14:   #00A8A8Rxvt*color15:   #B5613B

把下边这段写入 cygwin.bat

@echo offset CYGWIN=serverset HOME=d:\MyDocd:chdir d:\cygwin\binrxvt -title "Cygwin-Rxvt" -sr -sl 2000 -tn Cygwin -fn "bitstream vera sans mono-19" -e /bin/bash -login
定制特色的提示符

~/.bashrc 或者 ~/.bash_profile 中定制特色的提示符

PS1="`whoami`@`hostname | sed 's/..*//'`"PS1="[e[32;1m]${PS1}[e[0m]:[e[31;1m]w[e[0m]n"case `id -u` in0) PS1="${PS1}# ";;*) PS1="${PS1}$ ";;esac
定义环境变量

设置locale为Windows的默认locale,否则中文文件名会显示乱码:

LC_CTYPE=zh_CN.gbkCHARSET=GBKexport LC_CTYPE CHARSET

bash配置文件

~/.bashrc
# -*- coding: chinese-gbk -*LC_CTYPE=zh_CN.gbkCHARSET=GBK #glib2需要使用找个环境变量确定文件名的编码export LC_CTYPE CHARSETexport LESSCHARSET=latin1export INPUTRC=$HOME/.inputrcexport TERM=rxvt# aliasalias rm='rm -i'alias cp='cp -i'alias mv='mv -i'alias df='df -h'alias du='du -h'# Misc :)alias less='less -r --raw-control-chars'                          # raw control charactersalias whence='type -a'                        # where, of a sortalias grep='grep --color'                     # show differences in colour# Some shortcuts for different directory listingsalias ls='ls -hF --color=tty --show-control-chars'                 # classify files in colouralias dir='ls --color=auto --format=vertical --show-control-chars'alias vdir='ls --color=auto --format=long --show-control-chars'alias ll='ls -la --show-control-chars'                              # long listalias la='ls -A --show-control-chars'                              # all but . and ..alias l='ls -lF --show-control-chars'                              ## 添加清屏处理alias clear='clearn'alias clr='clearn'# 添加whereis的别名alias whereis='which'alias autoexec=autoexec.bat
~/.inputrc

主要是加入一些中文编码支持

# -*- coding: chinese-gbk -*-# base-files version 3.6-1# Insert Key"e[2~":paste-from-clipboard# equivalent to "C-?": delete-char"e[3~": delete-char# VT"e[1~": beginning-of-line"e[4~": end-of-line# kvt"e[H": beginning-of-line"e[F": end-of-line# rxvt and konsole (i.e. the KDE-app...)"e[7~": beginning-of-line"e[8~": end-of-line# VT220"eOH": beginning-of-line"eOF": end-of-line# Allow 8-bit input/outputset meta-flag on# 关闭bash命令行8字节字符转义符的转换set convert-meta off# 使bash命令行支持8字节字符输入set input-meta on# 使bash命令行支持8字节字符输出set output-meta on 我的配置文件E:\cygwin\home\zpc\.bashrc export LANG="zh_CN.UTF-8" alias ls="ls --color=auto" alias ll="ls --color=auto -l" alias l="ls --color=auto -l" alias ..="cd .." alias ...="cd ..." export PS1="\[\e[33m\]\w\[\e[0m\]\$ "

转载于:https://www.cnblogs.com/zhang-pengcheng/p/4248489.html

你可能感兴趣的文章
JavaScript 实现鼠标拖动元素
查看>>
js 模糊查询 (360接口)
查看>>
python+rabbitMQ实现生产者和消费者模式
查看>>
“模态”对话框和“后退”按钮
查看>>
关于javascript实现的网站页面侧边悬浮框"抖动"问题
查看>>
linux_命令格式和命令提示符
查看>>
Cocos2d-X-3.0之后的版本的环境搭建
查看>>
when case group by 的用法集合
查看>>
洛谷P1908 逆序对
查看>>
转义符
查看>>
poj 1019
查看>>
asp.net mvc上传文件
查看>>
bitmq集群高可用测试
查看>>
主成分分析(PCA)原理详解
查看>>
短信验证接口网址
查看>>
Geohash距离估算
查看>>
Demon_背包系统(实现装备栏,背包栏,可以切换装备)
查看>>
记录:一次数据库被恶意修改配置文件的问题
查看>>
redis 持久化
查看>>
解决Jupyter notebook[import tensorflow as tf]报错
查看>>