apache 转发

1.

在httpd.conf中找到这四行,将注释去掉(即去掉每行前面的#号)
Include conf/extra/httpd-vhosts.conf
LoadModule proxy_module modules/mod_proxy.so 
LoadModule proxy_connect_module modules/mod_proxy_connect.so 
LoadModule proxy_http_module modules/mod_proxy_http.so 
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so

 

2.

在conf/extra/httpd-vhosts.conf 文件加上

NameVirtualHost 服务器IP地址:80              (*:80也可以)

 

<VIRTUALHOST 服务器IP地址:80>
ServerAdmin superjwl@gmail.com
ServerName www.turbo00.com
ProxyPass / http://localhost:8080/ 
ProxyPassReverse / http://localhost:8080/
</VIRTUALHOST>

 

<VIRTUALHOST 服务器IP地址:80>
ServerAdmin superjwl@gmail.com
ServerName erp.turbo00.com
ProxyPass / http://localhost:8086/ 
ProxyPassReverse / http://localhost:8086/
</VIRTUALHOST>

 

注意:

实际应用中,对于jira的转发,需要加入ProxyPreserveHost On

对于gitblit的转发,需要加入AllowEncodedSlashes NoDecode;ProxyPreserveHost On.当然还需要Set web.mountParameters=false in gitblit.properties or web.xml this will use parameterized URLs.Alternatively, you can respecify web.forwardSlashCharacter

 

 

关于eclipse控制台输出的中文变问号或乱码的问题

在debug configurations,run configurations,external tools configurations中的common tab页中,把Encoding设为GB2312即可

抽奖软件

下载地址:lucky

1.无需注册,背景更换back.jpg即可

2.程序可支持串口外接工业按钮实现无键盘摇奖,具体可用邮件与我取得联系:superjwl[at]gmail.com

 

postgresql backup and resotre

backup:

pg_dump -h [HOST_ADDRESS] -p [PORT] -U [USER] [DBNAME] > [BAK_FILE]

restore:

psql  -h [HOST_ADDRESS] -p [PORT] -U [USER] [DBNAME] < [BAK_FILE]

 

Mercurial不同机器间的快速同步

1.在一台机器上的某个mercurial管理的源代码目录的.hg目录下找到hgrc
2.编辑hgrc文件,加入如下内容:
[web]
allow_read = *
allow_push = *
push_ssl = false

3.在此源代码目录选择命令:hg serve -p 80

完成后就可以在另一台机器push,pull了,
远程地址为:http://主机

多个私钥登录不同服务器时的配置

首先把不同的私钥放在.ssh目录中,并把这些私钥文件的权限改为600

比如有两个私钥文件:

id_rsa.1

id_rsa.2

然后在.ssh目录下建立config文件,内容为:

Host 1.com
    IdentityFile ~/.ssh/id_rsa.1
    User user1   

Host 2.com
    IdentityFile ~/.ssh/id_rsa.2
    User user2

之后就可以用 ssh user1@1.com 和 ssh user2@2.com 来登录不同的服务器了

windows下mysql中文乱码解决方法之一

按如下内容改为my.ini:

 

default-character-set=latin1 改为 default-character-set=utf8

character-set-server=latin1 改为 character-set-server=utf8

Android软件推荐-随手写Freenote

一直在寻找一款很方便的笔记软件,用过Evernote,Catch Note,虽然功能多,但使用下来后,实际感觉不方便,

是否有一款软件可以像一张纸,一支笔这么方便的随意画、写呢,

终于发现了,“随手写”,

可以充当纸和笔的角色,

具有多种输入方式:键盘输入、经典手写、双格手写、自由涂鸦等,

还可以插入声音,视频等,相当方便,各大市场都可以下载到

值得一试

 

不过要使用此软件,你的手机屏幕是越大越好,最好4.3以上,三星note,android平板更好,

How to flash DM500 using telnet

 

To flash an image using Telnet
This method will only work with a .img image file.
* Rename the image file to backup.img
* FTP the image file to the /tmp folder on the dreambox
* Telnet to your box and paste the following command:
cd /tmp && eraseall /dev/mtd/3 && cp backup.img /dev/mtd/3 && reboot
To telnet, click START > RUN and type Telnet ip.address.of.dreambox A command window will appear, enter username root and password dreambox.
To backup an image using Telnet
* Telnet to the box and paste the following command:
cat /dev/mtd/3 > /tmp/backup.img
* FTP to the box and navigate to the /tmp
* Here you will find the backup.img file.
How to copy an image from your PC to the Dreambox via Telnet
First of all, you need to have a mounted directory from your PC. Make sure you have the image.img file in your mounted directory on your PC. Telnet to the dreambox and paste this command:
cp /hdd/movie/image.img /tmp/image.img
The img will be copied from your mounted directory to the /tmp folder on the dreambox ready to be flashed.

———————————————————————–

post’s original address: http://www.digital-kaos.co.uk/forums/f213/how-flash-dm500-using-telnet-163444/

mssql查看某个表被哪些外键约束引用

exec sp_helpconstraint @objname=表名
go