检查打开文件句柄不够的原因

最近被 一个打开文件 后没有关闭 的问题 恶心了

以前 我从来 都懒得 关闭 文件

在这个教训后 我决定 认真检查文件关闭

首先就是 发生句柄不够的应用 不一定 是坏蛋

可能是 其他人 吃光了句柄 正好 这个应用不够了

如何检查呢

lsof -p 进程号  看进程开了多少 文件

如果 某个文件 特别多 那就是怀疑的对象

strace -f -e trace=socket,open,close,shutdown -q -p 进程号

来观察 open 和 close是不是 配对出现

而且 句柄 id是不是 暴涨

感谢 这次问题中 同学们 的帮助

Read More

MySlot 4.0 bug fix

修订 按键中 含有 套装 列表 (equipment set)时 引起不能导出的bug

感谢 YesSanCN 发现

下载

tg123-myslot-6bab0ef

Read More

贴下 Myslot 用户的 特别的 问题

VS玩家甲 to me
show details Dec 16 (1 day ago)
从游戏里复制的字符,粘贴到游戏外的记事本,经常出现乱码。
偶尔几次正常粘贴到记事本,从记事本向游戏里粘贴又出现乱码 怎么解决啊?
farmer1992@gmail.com ✆ to VS玩家甲
show details Dec 17 (1 day ago)
贴到 游戏外产生乱码 并不是 插件的原因
是 操作系统兼容的问题
在复制之前 先 复制一段 中文 就好了
另外 MYslot 不会读取 中文
真正的按键是 那些 开头没有@ 那些 26个字母 和 数字 组成的 字符
如果 实在不能解决 就 把中文去掉也不影响的
VS玩家甲 to me
show details 12:02 (2 minutes ago)
解决了 方法管用。
再次感谢,预祝新年快乐 ~~~^_^~~

这个问题 也影响 任何在 windows xp下 的 wow插件 复制出的字符

Read More

Ubuntu server 下配置 pptp vpn的几个注意事项

怎么安装 …… 这个不需要注意

/etc/sysctl.conf

net.ipv4.ip_forward=1 这个 大家也能想到

注意的是 防火墙问题

1 端口

ufw ……需要开两个端口 如果你装了的话

ufw allow 47/tcp

ufw allow 1723/tcp

ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing)
New profiles: skip
To                         Action      From
–                         ——      —-
22/tcp (OpenSSH)           ALLOW IN    Anywhere
1723/tcp                   ALLOW IN    Anywhere
47/tcp                     ALLOW IN    Anywhere

2 forward

/etc/default/ufw

DEFAULT_FORWARD_POLICY=”ACCEPT” 需要 accept

3 NAT

iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE

192.168.0.0/24 对应你 pptp 配置的 vpn网段

Read More

这是我的座

上周 上班的地铁上

一个哑巴 敲打 一个睡着了的 人的头 然后拿出一个证件

指着 她座位上方的 字 老弱病残孕 专座 ……

他投降了 让给了她

今天 下午

一个老头 又在我眼前 做了同样的事情

我就像 吃了苍蝇一样

他们根本就不是 老弱病残孕 而是强盗

Read More

淘宝宝 短域名

淘宝宝 短域名

http://tao.bb/

目标:改变 很长 很长 很长 的 淘宝商品 网址

源代码
http://code.google.com/p/taobb/

欢迎你的建议
更欢迎你的加入

Read More

MySlot 4 for 4.0 CTM

感谢 大家 支持

下载 MySlot beta 有bug请将导出码 邮件 给我

如果没有这么多人 给我发邮件我都没机会复活这个插件

由于 4.0更换了 魔法系统

所以 本次 更新 比较变态

重写了记录算法

导出字符串 缩小 到原来的 10% 左右 所以性能有 巨大的提升 这个还有提升的空间

目前 4.0 beta 不支持 导出宏 近期会将功能补全

Read More

WelTo for 3.xx 4.xx

这个老东西 是1.0 时代

我做 知会 时候 开发的 也使我第一个插件

2.0 时代 升级为 ACE2 插件 后来 就忘记了……

下载 WelTo

值得一提的是 新的 WelTo 将欢迎词 从core.lua 移动到  text.lua

这样添加和修改 就不会 影响主程序了

居然还有人 喜欢他……

升级 升级 我国服我2B

Read More

ubuntu compiz 标题栏丢失 的原因

自 8.04以来 偶尔出现的 compiz 3d后标题栏 丢失 让我 脑袋疼死了

9.10 突然爆发了以下 以前 重新设置 3d效果就可以恢复的 东西 无路如何 页无法恢复

最让人感觉像的就是 显卡 问题

不过 突然 失效 不太合理

按 论坛上 关于 增加 xorg.conf中配置项的方式 当然 无法解决问题

后来 就把 问题集中到 compiz 上

重装 卸载都不能解决

但是 一个突破就是 compiz –replace 可以解决 这个问题

加到启动项里边 就好了

现象上看 大概是 compiz 第一次煤没有 启动成功

后来一些悲剧原因 重装 ubuntu了 autostart 当然也没有了

10.10 今天 居然 又出这个 问题了

不过 这次我准备彻底解决问题拉

没有添加 compiz –replace

现象就是 compiz 不起动 后来 发现 compiz 是一种 gtk-window-decorator (理解不完全正确)

gtk-window-decorator –replace 居然可以达到同样效果

就更确认 是由于 一些原因导致了 那个东西没有启动

后来发现 /usr/bin/gnome-wm 是启动 decorator 的东西

就 修改脚本 打了 一些日志 发现 gnome启动  根本 没有执行 gnome-wm

这样 问题 本质 找到了 不过 想不出来 为什么 他没有执行

于是 google 发现了国际友人

http://ubuntuforums.org/showpost.php?p=7610738&postcount=4

I found the source of the problem, and it’s pretty easy to fix. Very non-intuitive to find, though.

At some point gnome-session switched from using regular commands to using .desktop launchers for launching things like the panel and window manager. It looks for these files in a few locations, including/usr/share/applications and $HOME/.local/share/applications.

It also appears that alacarte (the menu application), or possibly just the freedesktop.org specification for menus, uses $HOME/.local/share/applications for user-specific menu customizations.

For whatever reason, a copy of /usr/share/applications/gnome-wm.desktop was made in my $HOME/.local/share/applications directory which I suspect added Window Manager in my menu somewhere. I’m pretty anal about keeping my menus clean of stuff I don’t use, so I would have gone in and disabled that entry which changed the Hidden setting in my fancy new $HOME/.local/share/applications/gnome-wm.desktop file to True.

The last piece of the puzzle is that gnome-session stops searching after it finds an appropriate file, but it also doesn’t run a launcher if it’s hidden, so it was just straight-up skipping that step.

There are two ways to fix it, according to your preference:

  • Change the Hidden setting in $HOME/.local/share/applications/gnome-wm.desktop to false. This will (probably) put a Window Manager item in your applications menu somewhere.
  • Remove $HOME/.local/share/applications/gnome-wm.desktop entirely so that gnome-session has to find it elsewhere. If you’re gonna do this, make sure you check for Window Manager (or gnome-wm.desktop) in /usr/share/applications first.

This should work for the gnome-session panel and file manager, too.

New user notes:

  • $HOME refers to your home directory, which is /home/yourusername. My sister qualifies as a new user, and she said she may not have been able to figure that out right away.
  • To find $HOME/.local/share/applications using the file browser, you’ll need to show hidden files, since .local is hidden.
  • Launcher files (like gnome-wm.desktop) are generally listed in the file browser by a name they declare, rather than their file name. This particular file will probably be called Window Manager

回忆一下 昨天 蛋疼 改动过 菜单项……

按照 方案 解决问题

为什么 不能 compiz –replace

第一感觉 就是 不是最佳 解决方案

这里 还有 解释

http://www.jejik.com/articles/2008/10/how_to_properly_start_compiz_in_gnome/

Read More

ubuntu 升级导致eclipse插件挂掉

实验后 增加

org.eclipse.update.reconcile=true

解决问题

参考 位置

http://www.blogjava.net/eagle-daiq/articles/280230.html

Read More