海运的博客

记录Cygwin下mintty配置文件

发布时间:December 24, 2012 // 分类:Cygwin // No Comments

Cygwin自带mintty很好用,基本配置后配合tmuxscreen就可抛弃xshell/securecrt/putty等专用客户端了。

BoldAsFont=no
Font=Microsoft YaHei Mono
FontHeight=12
RightClickAction=paste
Term=xterm-256color
Transparency=low
CursorType=block
Locale=zh_CN
Charset=GBK
Window=Max
ForegroundColour=215,215,215
BackgroundColour=48,48,48
CursorColour=135,175,215
Black=48,48,48
Red=255,95,95
Green=175,215,135
Yellow=215,215,175
Blue=135,215,255
Magenta=215,175,215
Cyan=135,215,175
White=215,215,215
BoldBlack=48,48,48
BoldRed=255,95,95
BoldGreen=175,215,135
BoldYellow=215,215,175
BoldBlue=135,215,255
BoldMagenta=215,175,215
BoldCyan=135,215,175
BoldWhite=215,215,215

color配色参考:https://github.com/jonathanfilip/lucius

Cygwin使用Vim插件管理器Vundle错误error setting certificate verify locations解决

发布时间:December 16, 2012 // 分类:Vim,Cygwin // No Comments

Cygwin下使用Vundle通过Github安装VIM插件时提示以下错误:

error: error setting certificate verify locations:
CAfile: /usr/ssl/certs/ca-bundle.crt
CApath: none while accessing https://github.com/
fatal: HTTP request failed

通过apt-cyg安装ca-certificates解决:

apt-cyg install ca-certificates

或跳过CA验证:

export GIT_SSL_NO_VERIFY=1

Windows/Cygwin下安装配置SSH服务器

发布时间:December 5, 2012 // 分类:Cygwin // No Comments

1.Cygwin安装OpenSSH,可使用apt-cyg包管理器快速安装。

apt-cyg install openssh

配置OpenSSH服务,以管理员运行Cygwin Terminal。

$ ssh-host-config
*** Info: Generating /etc/ssh_host_key
*** Info: Generating /etc/ssh_host_rsa_key
*** Info: Generating /etc/ssh_host_dsa_key
*** Info: Generating /etc/ssh_host_ecdsa_key
*** Info: Creating default /etc/ssh_config file
*** Info: Creating default /etc/sshd_config file
*** Info: Privilege separation is set to yes by default since OpenSSH 3.3.
*** Info: However, this requires a non-privileged account called 'sshd'.
*** Info: For more info on privilege separation read /usr/share/doc/openssh/README.privsep.
*** Query: Should privilege separation be used? (yes/no) yes
*** Info: Updating /etc/sshd_config file

*** Query: Do you want to install sshd as a service?
*** Query: (Say "no" if it is already installed as a service) (yes/no) yes
*** Query: Enter the value of CYGWIN for the daemon: [] ssh
*** Info: On Windows Server 2003, Windows Vista, and above, the
*** Info: SYSTEM account cannot setuid to other users -- a capability
*** Info: sshd requires.  You need to have or to create a privileged
*** Info: account.  This script will help you do so.

*** Info: You appear to be running Windows XP 64bit, Windows 2003 Server,
*** Info: or later.  On these systems, it's not possible to use the LocalSystem
*** Info: account for services that can change the user id without an
*** Info: explicit password (such as passwordless logins [e.g. public key
*** Info: authentication] via sshd).

*** Info: If you want to enable that functionality, it's required to create
*** Info: a new account with special privileges (unless a similar account
*** Info: already exists). This account is then used to run these special
*** Info: servers.

*** Info: Note that creating a new user requires that the current account
*** Info: have Administrator privileges itself.

*** Info: No privileged account could be found.

*** Info: This script plans to use 'cyg_server'.
*** Info: 'cyg_server' will only be used by registered services.
*** Query: Do you want to use a different name? (yes/no) yes
*** Query: Enter the new user name: ssh
*** Query: Reenter: ssh

*** Query: Create new privileged user account 'ssh'? (yes/no) yes
*** Info: Please enter a password for new user ssh.  Please be sure
*** Info: that this password matches the password rules given on your system.
*** Info: Entering no password will exit the configuration.
*** Query: Please enter the password:
*** Query: Reenter:

*** Info: User 'ssh' has been created with password 'passwd'.
*** Info: If you change the password, please remember also to change the
*** Info: password for the installed services which use (or will soon use)
*** Info: the 'ssh' account.

*** Info: Also keep in mind that the user 'ssh' needs read permissions
*** Info: on all users' relevant files for the services running as 'ssh'.
*** Info: In particular, for the sshd server all users' .ssh/authorized_keys
*** Info: files must have appropriate permissions to allow public key
*** Info: authentication. (Re-)running ssh-user-config for each user will set
*** Info: these permissions correctly. [Similar restrictions apply, for
*** Info: instance, for .rhosts files if the rshd server is running, etc].


*** Info: The sshd service has been installed under the 'ssh'
*** Info: account.  To start the service now, call `net start sshd' or
*** Info: `cygrunsrv -S sshd'.  Otherwise, it will start automatically
*** Info: after the next reboot.

*** Info: Host configuration finished. Have fun!

启动SSH服务:

cygrunsrv -S sshd

Windows下安装Cygwin及包管理器apt-cyg

发布时间:December 5, 2012 // 分类:Cygwin // No Comments

Cygwin可以在Windows下使用unix环境Bash和各种功能强大的工具,对于Linux管理员来说不想使用Linux桌面是必备的工具。
Cygwin下也有类似Linux下包管理工具apt-cyg,可以方便的通过网络安装各种软件。
1.下载安装:http://cygwin.com/setup.exe
2.选择安装源及软件,如需安装apt-cyg需安装以下软件包:

wget
tar
gawk
bzip2

3.Cygwin安装完成后打开Cygwin Terminal安装apt-cyg包管理器:

wget http://apt-cyg.googlecode.com/svn/trunk/apt-cyg -P /bin
chmod.exe +x /bin/apt-cyg

apt-cyg安装源为ftp://mirror.mcs.anl.gov,设置为网易镜像源。

 apt-cyg -m http://mirrors.163.com/cygwin/

使用apt-cyg安装软件:

apt-cyg update
#更新源
apt-cyg install ping -u
#使用参数u不必每次都更新源
Working directory is /setup
Mirror is http://mirrors.163.com/cygwin/

Installing ping
Found package ping
--2012-12-05 09:59:20--  http://mirrors.163.com/cygwin//release/ping/ping-1.0-1.tar.bz2
正在解析主机 mirrors.163.com (mirrors.163.com)... 123.58.173.89, 123.58.173.106
正在连接 mirrors.163.com (mirrors.163.com)|123.58.173.89|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:8352 (8.2K) [application/octet-stream]
正在保存至: “ping-1.0-1.tar.bz2”

100%[==============================================>] 8,352       --.-K/s 用时 0.1s

2012-12-05 09:59:21 (64.1 KB/s) - 已保存 “ping-1.0-1.tar.bz2” [8352/8352])

Unpacking...
Package ping requires the following packages, installing:
cygwin
Package cygwin is already installed, skipping
Package ping installed

Cygwin安装procps,包含uptime/free/top等常用工具:

bin/prockill.exe
bin/procps.exe
sbin/sysctl.exe
usr/bin/free.exe
usr/bin/pgrep.exe
usr/bin/pkill.exe
usr/bin/pmap.exe
usr/bin/pwdx.exe
usr/bin/skill.exe
usr/bin/slabtop.exe
usr/bin/snice.exe
usr/bin/tload.exe
usr/bin/top.exe
usr/bin/uptime.exe
usr/bin/vmstat.exe
usr/bin/w.exe
usr/bin/watch.exe

DOS命令输出编码为GBK,Cygwin下默认为UTF-8,兼顾显示乱码的问题设置Cygwin编码为GBK:

export LANG="zh_CN.GBK"

其它设置:

alias ls="ls --color=auto"
export PS1="\[\e]0;\w\a\]\[\e[32m\]\u@\h:\[\e[33m\]\w\[\e[0m\]\$ "
分类
最新文章
最近回复
  • ccc: 可以提供易调用openssl常用函数吗?
  • 夜未央: 在centos7 下面 貌似转换不了。有人遇到过么????
  • brian: 博主你好,请教一个问题。我使用fprobe进行将交换机流量转换成netflow时是没有问题的,...
  • 吴昊: 学习了,感谢博主分享
  • linhua: 只需配置 服务端 的接收端口随机化就行了, 发送端口 因为 连接追踪(conntrack)的缘...
  • Realm: 博主你好,按照你的教程设置了IP转发及SNAT:echo 1 > /proc/sys/net/...
  • Roki: 大神, 为什么我在make clean 就出错了呢 ?你能帮我看看吗 。。。474495758...
  • Duuge: 遇到相同的问题,但未能解决,请求帮助。1、遇到的问题:/target-i386_i486_uC...
  • carlo: 大哥,我觉得你的技术好牛逼!能加你QQ吗
  • lebron: Unknown package 'lrzsz'.Collected errors:* opkg...
页面执行耗时:0.0485秒。-->