Flask 时快时慢的问题
app.run(host="0.0.0.0", port=8080)
当 app.run 设置成这样的时候,有时候页面加载会时快时慢。 原来默认 Flask 是单线程的,需要更改参数。
Read morePython 升级导致 yum 命令无法使用的解决办法
报错信息如下
yum -y install prce
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
No module named yum
Please install a package which provides this module, or
verify that the module is installed correctly.
It's possible that the above module doesn't match the
current version of Python, which is:
2.6.1 (r261:67515, Aug 7 2010, 11:36:17)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://wiki.linux.duke.edu/YumFaq
Read more
MySQL 无法连接 [MySql Host is blocked because of many connection errors]
MySQL 报错 Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
原因:同一个 ip 在短时间内产生太多中断的数据库连接而导致的阻塞。
Read morePHP 5.3.x 中 It is not safe to rely on the system's timezone settings 警告
警告提示:
Warning: phpinfo() [function.phpinfo]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for '8.0/no DST' instead in D:\apache2.2\htdocs\index.php on line 2
Read more
折腾的博客
经过进一个月的折腾,博客终于稳定了下来。
由于这学期学习比较紧张,所以基本没有什么时间继续做论坛。
博客也准备重做了,前几天关掉了论坛,以后就以更新博客为主。
博客由 wordpress 升级到了 typecho。
Read more一次被入侵和删除木马程序的经历
木马名称 Linux.BackDoor.Gates.5
中午服务器出现流量超高,平时只有几百 M 的流量,那时候发现流量上 G 了,而且提示阿里云有 DDOS 流量攻击行为。
开始也没有什么头绪,就是 ps 查进程,netstat 查端口号,nload 查流量。一时也没发现什么异常。
后来发现 root 的家目录下存在 conf.n
这个文件。
然而并未创建这个文件,也是感觉问题来了。
/bin/ps
,/bin/netsta
程序都是1.2M的大小,然后默认的只有几百 KB。
Invalid command 'Order' perhaps misspelled or defined by a module not included in the server configuration
报错是
Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration
Read more
Linux netcat 命令
netcat 或者叫 nc 是 Linux 下的一个用于调试和检查网络工具包。
可用于创建 TCP/IP 连接,最大的用途就是用来处理 TCP/UDP 套接字。
这里将通过一些实例来学习 netcat 命令。
1.在服务器-客户端架构上使用 netcat
netcat 工具可运行于服务器模式,侦听指定端口
nc -l 2389
然后可以使用客户端模式来连接到 2389 端口
nc localhost 2389
现在如果输入一些文本,它将被发送到服务器端
nc localhost 2389
HI, 70data
在服务器的终端窗口将会显示下面内容
nc -l 2389
HI, 70data
Read more
/usr/bin/ld cannot find -lxxx 解决思路
问题描述
/usr/bin/ld: cannot find -lxxx
其中 xxx 即表示函式库文件名称,其命名规则是:lib+库名(即xxx)+.so
。
可能原因:
1.安装,但相对应的 lib 版本不兼容。
需要的是 libjpeg.so.8.0
,但安装的是 libjpeg.so.6.0
。
2.安装了,版本也对了,但 lib(.so.version-num)
的 symbolic link 不正确,没有连结到正确的函式库文件 .so
。
需要的是 libjpeg.so.8.0
,也安装上了。但是实际使用时是查找的 libjpeg.so
,就需要相应的一个名为 libjpeg.so
的 link 指向 libjpeg.so.8.0
。
3.目录中确实没有相对应的 lib。
系统中没有安装相对应的 lib,安装了,但不在这个目录且不在环境变量中。
Read more