Category Archives: 信息技术

OmniOS Shell Env Check List

bash Shell

~/.profile

#!/bin/bash
# Solaris 衍生的 OS,默认都将 GNU 路径放在前面
# 而支持 ACLs 的 ls/chmod ,是在 /usr/bin 目录中的
export PATH=/usr/bin:/usr/sbin:/sbin:/usr/gnu/bin

export TERM=xterm-color

# Enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='/usr/bin/ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi

# Some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

~/.vimrc

set nocp
set bs=2
syntax on

./.inputrc

"\e[1~": beginning-of-line     # Home
"\e[4~": end-of-line           # End
"\e[5~": beginning-of-history  # PageUp
"\e[6~": end-of-history        # PageDown
"\e[3~": delete-char           # Delete
"\e[2~": quoted-insert         # Insert
"\eOD": backward-word          # Ctrl+Left
"\eOC": forward-word           # Ctrl+Right

/etc/default/init

TZ="Asia/Shanghai"
CMASK=022
LANG=en_US.UTF-8

转 [译] 为什么我们找不到前端工程师?

原文为 Why can’t we find Front End developers? 作者是 Jose Aguinaga,前端工程师、用户体验设计师跟热爱 JavaScript 的软件工程师。

正文开始


有天,作者偶然在 Quora 上发现一个跟前端工程师及新创公司有关的问题:为什么新创公司很难找到前端工程师?

该讨论串的原 PO 提到:

(前略)我想多数人都同意前端开发比其他软件工程领域简单一些,那到底为何那些新创公司还是很难找到前端工程师?

我看到几个不错的回应,这些回应大多一针见血。而根据过去我寻找前端职缺,面试前端工程师,以及平常在前端项目里的工作经验,以下提出我的个人意见:

Continue reading

Install ShadowSocks Client as a Windows Service

1/ Install Node.js

http://nodejs.org/

2/ Install ShadowSocks

Open Node.js command line environment, and type following command:

npm install -g shadowsocks

3/ NSSM Configure

Download from http://nssm.cc/

Run nssm.exe from command line window.

nssm.exe install

nssm service installer

 

 

 

 

 

 

Key parameters:

Parameter Description Example Value
Path ShadowSocks client full path. C:\Users\Administrator\AppData\Roaming\npm\sslocal.cmd
Startup directory ShadowSocks config file location. C:\xxxxx\AuthInfo
Arguments ShadowSocks startup parameter, include config file name. -c Linode_ShadowSocks_Local.json

 

Example Screen:

TAB Application:

nssm_application_tab

 

 

 

 

 

 

TAB Details

nssm_detail_tab

 

 

 

 

 

 

TAB Log on

nssm_logon_tab

将 Tomcat 7 默认端口更改为 1024 以下 (Linux)

以 Ubuntu 14.04 LTS / tomcat 7 为例。

1) 安装 authbind

apt-get install authbind

2) 使 80 / 443 端口对 authbind 可用(以 root 权限操作):

touch /etc/authbind/byport/80
touch /etc/authbind/byport/443
chmod 500 /etc/authbind/byport/80
chmod 500 /etc/authbind/byport/443
chown tomcat7 /etc/authbind/byport/80
chown tomcat7 /etc/authbind/byport/443

3) 在 Tomcat 中,置 IPv4 为默认 (authbind 当前不支持 IPv6)

要完成这个操作,须创建 TOMCAT/bin/setenv.sh 文件,并带上以下内容:

CATALINA_OPTS="-Djava.net.preferIPv4Stack=true"

如 setenv.sh 文件已存在且已定义 CATALINA_OPTS ,那可以这么做:

export CATALINA_OPTS="$CATALINA_OPTS -Djava.net.preferIPv4Stack=true"

4) 修改 /usr/share/tomcat7/bin/startup.sh

exec authbind --deep "$PRGDIR"/"$EXECUTABLE" start "$@"
# OLD: exec "$PRGDIR"/"$EXECUTABLE" start "$@"

5) 修改 /etc/default/tomcat7

AUTHBIND=yes
# OLD: AUTHBIND=no

6) 打开 /etc/tomcat7/server.xml

将 8080 更改为 80,8443 更改为 443。

7) 重启 tomcat 服务

service tomcat7 restart

VMware Workstation VM Background 后不能重连解决一例

VMware Workstation VM Background 后不能重连,VNC倒是一直可连接。

看VMs的日志,有如下行:
2014-06-26T18:11:39.534+08:00| vmx| W110: CnxHandleConnection: WSASocket returned error 10022.
2014-06-26T18:11:39.534+08:00| vmx| W110: VMAutomation: Cnx_CompleteAsyncOperation() failed.

搜 VMware Community,是 Socket Provider 有冲突,接下来要做的就是识别出来。
微软有个 Autoruns 工具(http://technet.microsoft.com/en-us/sysinternals/bb963902),可以定位出 Socket Provider。

下载运行之后,到 “Winsock Providers” TAB,发现有VMware、迅雷及Apple的几个Entry,将迅雷相关的行删除并重启计算机后,故障消失。

Nexenta Sample /etc/power.conf (for Home Env.)

device-dependency-property removable-media /dev/fb

autopm enable
autoS3 disable

cpupm enable poll-mode
cpu-threshold 1s

device-thresholds /pci@0,0/pci15ad,790@11/pci15ad,1976@1/sd@0,0 10m
device-thresholds /pci@0,0/pci15ad,790@11/pci15ad,1976@1/sd@1,0 10m
device-thresholds /pci@0,0/pci15ad,790@11/pci15ad,1976@1/sd@2,0 10m
device-thresholds /pci@0,0/pci15ad,790@11/pci15ad,1976@1/sd@3,0 10m
device-thresholds /pci@0,0/pci15ad,790@11/pci15ad,1976@1/sd@4,0 10m
device-thresholds /pci@0,0/pci15ad,790@11/pci15ad,1976@1/sd@5,0 10m

device-thresholds /pci@0,0/pci15ad,1976@10/sd@0,0 10m
device-thresholds /pci@0,0/pci15ad,1976@10/sd@1,0 10m

system-threshold always-on

Version of Word does not match error when using Microsoft Word and RequisitePro

Problem(Abstract)
This technote explains how to resolve a “Version of Word (None) does not match” error. This can occur when opening Microsoft Word for use with IBM Rational RequisitePro.

Symptom
Starting Microsoft Word fails with this error:
The version of Word (None) does not match the version required by the program (Word 2000, Word 2002, Word 2003). Install the correct version of word. Microsoft Word is not installed or configured properly. Do you want to continue with Word disabled?

Cause
Microsoft Word did not create the registry key that RequisitePro requires, or you do not have sufficient read privileges for that registry key.

Resolving the problem
Verify that this registry key exists. If not, you must add it.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\10.0\Word]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\10.0\Word\InstallRoot]
"Path"="C:\\Program Files\\Microsoft Office\\Office10\\"

IMPORTANT: The number 10 refers to Word 2002, 11 is for Word 2003, 12 is for Word 2007 and 14 is for Word 2010.

Starting JIRA Automatically on Linux

官方指南看来已经过时,更新一下。

#!/bin/bash
# Jira startup script
#chkconfig: 2345 80 05
#description: Jira

# JIRA/Confluence Linux service controller script
APP=jira
APP_BIN=/opt/atlassian/jira/bin

start() {
        $APP_BIN/start-jira.sh
}
stop() {
        $APP_BIN/stop-jira.sh
}

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        service $APP stop
        sleep 8
        service $APP start
        ;;
  *)
        echo "Usage: service $APP {start|stop|restart}"
esac

exit 0