手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆
浏览模式: 标准 | 列表Tag:swfupload

终端服务器超出了最大允许连接数临时解决方法

连接win的服务器的时候,如果非正常情况退出很有可能就会出现:“服务器超出了最大允许连接数”,这时候就比较痛苦了,如果临时需要改东西,而服务器上又运行着重要服务,这时候改也改不了了。又不能随便重启怎么办?以前自己的服务器我都是直接重启的,但是如果运行着重要的公司业务的话就不能这样折腾了。。。

这是找到的资料,先备份一下,以后可能会用的到,来源:http://www.zeali.net/entry/672

江湖救急的方法:

命令行运行 mstsc /console /v:服务器名或IP或域名:远程端口 。比如 mstsc /console /v:172.16.18.99:3389

但有时候这样运行之后仍然会出现“终端服务器超出了最大允许连接数”的错误信息,那样的话你可以尝试把 /console 参数换成 /admin 来连接。

附:
mstsc 语法 (Microsoft terminal services client)
mstsc.exe {ConnectionFile|/v:server} [/console] [/f] [/w:width /h:height]
mstsc.exe /edit”ConnectionFile”
mstsc.exe /migrate

mstsc参数
ConnectionFile 指定用于连接的 .rdp 文件的名称
/v:server[;port] 指定要连接的远程计算机
/admin 将连接到会话以管理服务器
/f 在全屏幕模式下启动“远程桌面”连接
/w:width 指定远程桌面窗口的宽度
/h:height 指定远程桌面窗口的高度
/public 在公用模式下运行远程桌面
/span 是远程计算机的高度和宽度与本地虚拟桌面相匹配,如有必要扩展到多个显示器。
若要扩展到多个显示器,所有显示必须具有相同的高度并垂直排列
/console 连接到指定 Windows 2000 Server 的控制台会话
/edit 打开指定的 .rdp 文件进行编辑
/migrate 将使用“客户端连接管理器”创建的旧版连接文件迁移到新的 .rdp 连接文件中

心碎:pyscripter。。。

昨天说了一些关于python的编辑器的列表,当然是有一些IDE存在的,所以下载了一些,只是,让我失望的也有很多。比如这个pyscripter。。。
看截图,我很开心,好象挺不错的软件,但是下载回来后却发现无法运行。看了官方的CHM里面没有多介绍,只是说了一些:

PyScripter originally started as a lightweight IDE designed to to serve the purpose of providing a strong scripting solution for Delphi applications, complementing the excellent Python for Delphi (P4D) components.  However, and with the encouragement of the P4D creator Morgan Martinez and a few early users, it has now evolved into a full-featured stand-alone Python IDE.  It is built in Delphi using P4D and the SynEdit component but is extensible using Python scripts.  Currently, it is only available for Microsoft Windows operating systems and  features a modern user-interface. Being built in a compiled language is rather snappier than some of the other IDEs graphic  and provides an extensive blend of features that make it a productive Python development environment.


在无法清楚官方想说什么的时候,去了google code上看了一下,居然还真的看到了这句话:
If you are using a 64bit version of Windows note that PyScripter will only work if a 32bit version of Python is installed.
好吧,不管是怎么样的情况,反正我64位的win7是肯定无法运行了。。。。
现在正在下载其他的,准备一个个的测试:http://wiki.python.org/moin/PythonEditors#Windows-OnlyEditors

Tags: python, pyscripter

jQuery SubClass 带来的新的变化

jquery在1.5的时候多了一个subclass,代码大约如下:

JavaScript代码
  1. subclass: function(){  
  2.     function jQuerySubclass( selector, context ) {  
  3.         return new jQuerySubclass.fn.init( selector, context );  
  4.     }  
  5.     jQuerySubclass.superclass = this;  
  6.     jQuerySubclass.fn = jQuerySubclass.prototype = this();  
  7.     jQuerySubclass.fn.constructor = jQuerySubclass;  
  8.     jQuerySubclass.subclass = this.subclass;  
  9.     jQuerySubclass.fn.init = function init( selector, context ) {  
  10.         if (context && context instanceof jQuery && !(context instanceof jQuerySubclass)){  
  11.             context = jQuerySubclass(context);  
  12.         }  
  13.         return jQuery.fn.init.call( this, selector, context, rootjQuerySubclass );  
  14.     };  
  15.     jQuerySubclass.fn.init.prototype = jQuerySubclass.fn;  
  16.     var rootjQuerySubclass = jQuerySubclass(document);  
  17.     return jQuerySubclass;  
  18. },  
很多看到这个代码的人都认为这个功能是用来优化插件的,因为现在jQuery的插件越来越多,有类似功能,类似名称的插件也越来越多了,所以,同名插件带来的困扰也就更多了。

未来怎么办,jQuery鼓励用户开发插件,但插件总不能老是给用户带来麻烦吧?所以这个subclass就成了新的插件机制所必备的方法,利用subclass来创建一个新的实例(即所谓的继承,当然也能覆写父类[jQuery]的方法 )。

只是这样的频繁继承,肯定会造成效率降低吧。怎么样既能继承,又不降低效率,这恐怕就是未来jQuery团队要考虑的事情了?但是否靠什么behavior这种行为的方式来加载呢?现在都在讲究这种行为触发性的插件。jQuery是不是未来也会采用这种方式呢。

Tags: jquery, plugin, subclass

翻译:crontab的介绍

以下内容来自于linux的101个hack,昨天看到了,顺手翻译了一下,毕竟看中文比看英文舒服。翻译的还是有点问题的,理解一下下啦。。。

Hack 74. Crontab
第74个hack:Crontab

Using cron you can execute a shell-script or Linux commands at a specific time and date. For example a sysadmin can schedule a backup job that can run every day. 
使用cron功能你可以在任意的时间执行一条shell指令或者Linux的命令。例如系统管理员可以运行一个计划任务来进行每天的备份工作。

How to add a job to the cron?
那么,怎么样把一个任务加入到cron呢?

# crontab –e
0 5 * * * /root/bin/backup.sh

This will execute /root/bin/backup.sh at 5 a.m every day.
上面这条指令,让你在每天上午5点 运行 /root/bin/目录下的 backup.sh 指令

Description of Cron fields.
Cron命令的各个字段的注释。

Following is the format of the crontab file.
crontab文件的格式均以下格式 

{minute} {hour} {day-of-month} {month} {day-of-week} {full-path-to-shell-script}
{分钟} {小时} {每月的第几天} {月份} {每周的第几天} {指令的全路径}
 
o  minute: Allowed range 0 -59
o  分钟的取值范围是 0-59

o  hour: Allowed range 0 -23
o  小时的取值范围是 0-23

o  day-of-month: Allowed range 0 - 31
o  每月的第几天,取值范围为 0-31

o  month: Allowed range 1 -12.  1 = January. 12 = December.
o  月份的取值范围为 1-12 ,1是1月,12是12月

o  Day-of-week: Allowed range 0 -7. Sunday is either 0 or 7.
o  每周的第几天,取值范围为0-7,0或者7都代表星期天
 
Crontab examples
Crontab 的例子

1. Run at 12:01 a.m. 1 minute after midnight everyday. This is a good time to run backup when the system is not under load. 
1. 每天午夜12点零1分 ,当系统不再被加载时就是进行备份的好时机(not under load翻译不来)
 
1 0 * * * /root/bin/backup.sh
 

2.  Run backup every weekday (Mon – Fri) at 11:59 p.m. 
每周1-5晚上11点59分执行备份操作

59 11 * * 1,2,3,4,5 /root/bin/backup.sh
 
Following will also do the same.
下面的例子则是另一种格式,功能完全一致

59 11 * * 1-5 /root/bin/backup.sh

3. Execute the command every 5 minutes.
 每五分钟执行一条命令
*/5 * * * * /root/bin/check-status.sh
 
4. Execute at 1:10 p.m on 1st of every month
 每月第一天的下午1点10分执行备份
10 13 1 * * /root/bin/full-backup.sh
 
5. Execute 11 p.m on weekdays.
每周工作日的下午11点执行备份
0 23 * * 1-5 /root/bin/incremental-backup.sh
 
Crontab Options
Crontab 的一些参数

Following are the available options with crontab:
以下是crontab所支持一些参数

o  crontab –e : Edit the crontab file. This will create a crontab, if it doesn’t exist
o  crontab -e : 编辑crontab文件,如果文件不存在,则创建一个crontab

o  crontab –l : Display the crontab file.
o  crontab -l : 显示crontab文件

o  crontab -r : Remove the crontab file.
o  crontab -r : 删除crontab文件

o  crontab -ir : This will prompt user before deleting a crontab. 
o  crontag -ir : 删除crontab文件,但在删除前会让用户进行确认

Tags: crontab