Jun
26-08

Emacs的一些命令

Posted in ubuntu

;;C意味着Ctrl键   M意味着Meta键或Alt键 SPC表示空格键 RET表示回车键Enter DEL表示退格键BackSpace `就是TAB键上方,数字键1旁的键
;;TAB表示TAB键,tab表示输入,即大写字母组合表示的是按键,而小写字符串是输入的字符串(输入以RET结束)
‘C-x C-f 文件名’ —打开文件
‘C-x C-s’ —保存文件
‘C-x C-c’ —退出Emacs
‘C-z’  —从Emacs切换到别的应用程序
‘C-x 1′ —仅保留当前窗格
‘C-x 2′ —水平拆分当前窗格。
‘C-x o’ —将光标移到下方窗格,圆圈是字母不是数字。表示other
‘C-x k’ —关闭某个buffer,即缓存。
‘ESC ` f c’ —依次按这四个键可以关闭当前buffer
‘ESC x calendar’ —调用日历表
‘M-x calendar’ —调用日历表
‘M-x revert-buffer’ —重新载入buffer
‘M-x shell’ —调用外壳命令
‘M-x cd’ —转换目录
‘C-x d’ —编辑目录
‘M-x info’ —帮助信息
‘M-x TAB TAB’ —获取可执行的命令
‘M-x gdb’ —
‘M-SPC’ —把游标(即光标)附近的空格缩成一个。
‘M-;’ —产生右缩进的注释
‘M-x c-mode’ —启动C模式
‘M-x c-set-style’ —指定C模式的缩进格式,格式有:Linux、Python、BSD、Java、Stroustrup、GNU、cc-mode等,而按Tab键可以格式缩进当前行
‘M-x c-toggle-auto-stat’ —开启自动模式
‘C-c C-a’ —开启/关闭自动模式
‘C-c C-e’ —调用宏扩展
‘M-! etags [...]




Jun
11-08

C语言标准函数库

Posted in 推荐

<assert.h>
void assert(int expression);
Macro used for internal error detection. (Ignored if NDEBUG is defined where <assert.h> is included.) If expression equals zero, message printed on stderr and abort called to terminate execution. Source filename and line number in message are from preprocessor macros __FILE__ and __LINE__.
<ctype.h>
int isalnum(int c);
isalpha(c) or isdigit(c)
int isalpha(int c);
isupper(c) or islower(c)
int iscntrl(int c);
is [...]




Jun
10-08

c_backup

Posted in backup

#include
struct student {
int num;
char name[10];
char score[3][10];
}stu[5];
int main(){
void input(struct student stu[5]);
void output(struct student stu[5]);
input(stu);
output(stu);
return 0;
}
void input (struct student stu[5]){
int i = 0;
struct student (*p);
p = stu;
printf(”input num,name,score1,score2,score3:\n”);
while(i num,(p)->name,(p)->score[0],
(p)->score[1],(p)->score[2]);
i++;
p++;
}
}
void output (struct student stu[5]){
int i=0;
struct student (*p);
p = stu;
while( inum,(p)->name,(p)->score[0],
(p)->score[1],(p)->score[2]);
i++;
p++;
}
}
/*
#include h>
struct student {
int num;
char name[10];
char score[3][10];
}stu[5];
int main(){
void input(struct student stu[5]);
void output(struct student stu[5]);
input(stu);
output(stu);
return 0;
}
void input (struct student [...]




May
29-08

Sound on Zepto Znote 3215W almost there

Posted in ubuntu

Sound on Zepto Znote 3215W almost there
Thursday, January 31st, 2008
Today a Linux 2.6.24 kernel appeared in Debian unstable, so I immediately gave it a try, to see if it did anything to the sound issues on my Zepto Znote 3214W laptop.
First thing, the 2.6.24 kernel has ALSA 1.0.15 which is needed. The Realtek ALC268 doesn’t [...]




May
29-08

How to install driver for Realtek ALC268 (HDA) for Acer Aspire 4710 laptop

Posted in ubuntu

How to install driver for Realtek ALC268 (HDA) for Acer Aspire 4710 laptop

Hi
I have an Acer Aspire 4710 laptop; headphones were not working on Ubuntu 7.04 feisty. I installed the driver for Realtek ALC268 HDA and now head phones work fine.
Make sure that your system is updated [...]




May
29-08

Realtek ALC268集成声卡驱动问题在ubuntu下的解决方案

Posted in ubuntu

Realtek ALC268集成声卡驱动问题在ubuntu下的解决方案
Since a lot people are trying and struggling to get their Realtek ALC268 codec sound card work properly in Ubuntu 7.10 Gutsy, I think my experience will be helpful. My computer is an Acer Aspire 5315 laptop, it comes with an ALC268 codec HDA sound card. Lately I’ve been messed around with this sound [...]




May
29-08

网上找到的配置apache的办法

Posted in ubuntu

1、安装 Apache2+PHP5+MySQL
sudo apt-get install apache2 libapache2-mod-php5 php5 php5-gd mysql-server php5-mysql phpmyadmin
在下载来自动安装配置的时候 会出现一个框子让你输入密码哦!!记住是密码
2、启用 mod_rewrite 模块
sudo a2enmod rewrite
3、配置 网站的目录了
sudo gedit /etc/apache2/sites-available/default
——————默认情况下你会看到
NameVirtualHost *
<VirtualHost *>
    ServerAdmin webmaster@localhost
   
    DocumentRoot /var/www/
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/>
——————我们把它改到别处去~~也就是自定义位置
NameVirtualHost *
<VirtualHost *>
    ServerAdmin webmaster@localhost
   
    DocumentRoot /home/felix/www/
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /home/felix/www/>
——————看到了把?这个就是放在了home下你的用户名的www文件夹里面
4、重启服务器
sudo /etc/init.d/apache2 restart
5 、检查是否成功
到你的目录下新建一个index.php文件
在里面输入<?=phpinfo()?>
然后打开浏览器输入localhost看看是否phpinfo的信息出来了
如果出来了表示你成功拉 恭喜你哈~
对啦不要忘记了phpmyadmin哦
在浏览器里面输入localhost/phpmyadmin哦
就能控制mysql啦~~~
 本文来自: www.jackfeng.cn http://www.jackfeng.cn/show-589-1.html




May
14-08

原来是GCC来编译C文件啊

Posted in ubuntu

今天写了个HELLOWORLD  有加<stdio.h>  有错误
后来去掉  还是有错误:
helloworld.c: 在函数‘main’中:
helloworld.c:3: 警告: 内建函数 ‘printf’ 不兼容的隐式声明
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld 返回 1




May
14-08

今天学习了pico。

Posted in ubuntu

进入终端:pico就进入到pico编辑文本的界面了。
键入一些内容:Hello world! This is my first file in ubuntu.It is great fun.Oh , I like ubuntu!
Ctrl+O保存:键入名称first.txt  然后enter就保存了
Ctrl+X离开。
然后ls一下可以看到first.txt在你的文档里面。
more first.txt可以看到文件里面的内容。
pico first.txt可以进入pico继续编辑文件。




May
07-08

Linux锐捷2.56认证客户端XMU-Ruijie–用python写的

Posted in ubuntu

Linux锐捷2.56认证客户端XMU-Ruijie–用python写的
By
acevery
on August 20, 2007 9:16 AM | Permalink | Comments (26)
用了一周多的时间,完成了
首先说一下XMU-Ruijie的意思。XMU是Xiaman University即厦门大学,偶的母校。因为这个客户端是为解决厦门大学众多Linux用户上校园网难的问题写的。Ruijie是锐捷的拼音。
接下来说说过程把。开始几天把锐捷2.56的算法学着用pyhon的类重写,中间发现在线包的算法错了。花了一个晚上研究以前抓的包,终于修正了算法。接下来的几天又陆续学了固定时间发包的实现,daemon方式,配置文件读取,昨晚继续奋战,终于把程序最后调试好了。
这个客户端最大的优点是什么?我的初衷是用python写,从而避免xsupplicant的编译问题。同时,因为这个客户端仅仅是用来进行锐捷认 证的,所以不包含其他功能的代码,体积比xsupplicant小了很多。与此同时,配置也简化到用户名,密码,网络界面,日志文件,pid文件(后两者 一般不需要修改)。同时锐捷的协议部分是用类写的,也就是说如果别人要改成其它MD5协议只要重写一个协议的类,嵌进去即可。
相比xrgsu,不会出现多网卡检测的错误,因为XMU-Ruijie是不检测多网卡的认证速度相当快,我在宿舍中不到1秒就认证好了,DHCP大概2秒。
功能上,只做一件事,完成认证。因为DHCP客户端功能我写的肯定没有dhcpcd和dhclient好了Gentoo用户直接下载ebuild安装。同时我写了一个bash的start-stop脚本(DHCP的)和bash的安装脚本,非gentoo的用户也方便很多了。这两个bash脚本都在压缩包里了。
Gentoo用户
安装
Gentoo的用户先下载好portage文件,并放到自己的portage-overlay中:

代码: 下载并解压portage文件,如portage-overlay为/usr/local/portage [...]