Describe linux/RHEL6/CentOS6/Scientific Linux 6虚拟机克隆导致的网卡问题解决方法 here.

刚才在VM虚拟机里测试Scientific Linux 6(RHEL6的重编译版,相当于CentOS 6),看看是否可用于生产环境。因为镜像是在家里的电脑安装的,复制过来启动系统发现网卡启动失败,提示:

Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization. [FAILED]

Google了一下,发现是网卡mac地址写入硬件问题导致。

环境:Virtualbox+RHEL 6 x64
VirtualBoxvboxmanager克隆的虚拟机,操作系统RHEL6,启动后发现网卡不能用了。重启网络服务,报以下错误:
Bringing up interface eth0: Device eth0 does not ...
more ...

Describe linux/rhel/redhat笔记 here.

echo "aaa" > tty1 #输出内容到tty终端

vi /etc/inittab id:3:initdefault #3默认不启动xwindow,5开机启动xwindow

1:2345:respawn:/sbin/ningetty tty1 #tty终端数量

===9 10 课时,系统命令初步 === linux一切皆文件,硬件也抽象成文件形式 {{{ cd ~abc 进入abc家目录 touch a 更改文件时间,如果没有文件则创建 touch /tmp/{a,b} 创建a,b2个文件 stat a 查看文件a的时间 pws 显示当前路径 ls -F 增加标记。可执行文件加/,可执行文件加*... alias ls ...

more ...

Describe .net/陈键的短信api调用 here.

== 余额查看 == {{{#!highlight c# using System.Text; using System.Net; using System.IO; using System.Web; using System; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { string linkUrl = "https://sms-api.luosimao.com/v1/status.json", username = "api", password = "key-b2652cf62f07dd09a4d561dcb4528041"; //api key

        HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(linkUrl);
        string auth = "Basic ...
more ...

Describe python/数据库操作paramstyle here.

  • 用?还是%s取决于paramstyle参数的配置,dbapi2.0文档 http://www.python.org/dev/peps/pep-0249/ 里的解释 {{{ 'qmark' Question mark style, e.g. '...WHERE name=?' 'numeric' Numeric, positional style, e.g. '...WHERE name=:1' 'named' Named style, e.g. '...WHERE name=:name' 'format' ANSI C printf format codes, e.g. '...WHERE name=%s' 'pyformat ...

more ...

Describe 文章/有一类PM here.

有一类PM,其它不擅长,就擅长排工时。 用一个软件,画各人工时长度,安排哪些任务先做哪些任务后做。 后来我就觉得PM就是排工时的,让开发或测试人员报个工时,然后安排下,给上级一个进度表,这就是他全部工作了。 当然,他还有个存在价值时跟上级讨价还价项目deadline。

more ...

Describe 生活/联通报修 here.

青浦联通报修电话:39281570

more ...

Describe c/c语言连接mysql here.

Date 五 09 八月 2013 By liugehao Category c.

{{{ apt-get install libmysqlclient-dev }}} {{{#!highlight sql create table t1( id integer auto_increment primary key ,name varchar(20), sex char[1]); }}} mysql.c文件: {{{#!highlight c

include

include

include

include

define MAX_COLUMN_LEN 32

int main(int argc, char argv[]) { MYSQL my_connection; MYSQL_RES result; MYSQL_ROW sql_row; MYSQL_FIELD fd; char column[MAX_COLUMN_LEN][MAX_COLUMN_LEN]; int res ...

more ...

Describe linux/linux显示历史命令 here.

使用 HISTTIMEFORMAT 显示时间戳

当你从命令行执行 history 命令后,通常只会显示已执行命令的序号和命令本身。如果你想要查看命令历史的时间戳,那么可以执行: {{{

export HISTTIMEFORMAT='%F %T '

history | more

1 2008-08-05 19:02:39 service network restart 2 2008-08-05 19:02:39 exit 3 2008-08-05 19:02:39 id 4 2008-08-05 19:02:39 cat /etc/redhat-release }}} 注意:这个功能只能用在当 HISTTIMEFORMAT 这个环境变量被设置之后,之后的那些新执行的 bash 命令才会被打上正确的时间戳 ...

more ...

Describe linux/gwan g-wan key value store here.

add data: http://localhost:8080/?kv4.c&act=a

get data: http://localhost:8080/?kv4.c&body=999999

首先定义结构 record_t 指针,分配内存空间,存储数据,添加进k/v存储。

{{{#!highlight c

include "gwan.h" // G-WAN exported functions

include

include

include

typedef struct record_s // this is a user-defined 'record' structure { char name; // the Key(name ...

more ...

Describe linux/weighttp install here.

wiki: http://redmine.lighttpd.net/projects/weighttp/wiki {{{ git clone git://git.lighttpd.net/weighttp cd weighttp ./waf configure }}} {{{ checking for libary ev :not found }}} libev: http://dist.schmorp.de/libev/ {{{ wget http://dist.schmorp.de/libev/libev-4.15.tar.gz tar -zxf libev-4.15.tar.gz cd libev-4.15 ...

more ...