• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
vertexes
博客园 | 首页 | 新随笔 | 新文章 | 联系 | 订阅 订阅 | 管理
上一页 1 2 3 4 下一页

2012年2月3日

Linux 中list_head 如何使用
摘要: 源代码: 1 #include <linux/module.h> 2 #include <linux/init.h> 3 #include<linux/sched.h> 4 #include<linux/sem.h> 5 #include <linux/slab.h> 6 #include <linux/list.h> 7 8 MODULE_LICENSE("Dual BSD/GPL"); 9 10 struct group{11 int id;12 char character;13 struct l 阅读全文
posted @ 2012-02-03 14:12 vertexes 阅读(4323) 评论(0) 推荐(0)
 
 

2011年12月29日

*nix 获取登录者
摘要: 函数:1 #include<unistd.h>2 3 char * getlogin(void);测试函数:1 #include<stdio.h>2 #include<unistd.h>3 4 int main(void){5 char * username;6 username=getlogin();7 printf("the login is %s\n",username);8 return 0;9 }make:1 make:2 cc -g fig8_15.c -o fig8_153 clean:4 rm -rf fig8_15获取该 阅读全文
posted @ 2011-12-29 16:26 vertexes 阅读(430) 评论(0) 推荐(1)
 
Linux C 语言 获取系统时间信息
摘要: 比如获取当前年份: /* 获取当前系统时间 暂时不使用 int iyear = 0; int sysyear = 0; time_t now; struct tm *timenow; time(&now); timenow = localtime(&now); sysyear = timenow->tm_year+1900; */linux下获取系统时间的方法 可以用 localtime 函数分别获取年月日时分秒的数值。 Linux下获得系统时间的C语言的实现方法: 1. 可以用 localtime 函数分别获取年月日时分秒的数值。 #include<time.h& 阅读全文
posted @ 2011-12-29 11:10 vertexes 阅读(51586) 评论(1) 推荐(0)
 
 

2011年12月28日

Linux 中查看系统进程信息
摘要: 使用ps格式输出来查看进程状态:ps -eo user,stat..,cmduser 用户名uid 用户号pid 进程号ppid 父进程号'size' 内存大小, Kbytes字节.v'size' 总虚拟内存大小, bytes字节(包含code+data+stack)share 总共享页数nice 进程优先级(缺省为0, 最大为-20)priority(pri) 内核调度优先级pmem 进程分享的物理内存数的百分比trs 程序执行代码驻留大小rss 进程使用的总物理内存数, Kbytes字节time 进程执行起到现在总的CPU暂用时间stat 进程状态cmd(a 阅读全文
posted @ 2011-12-28 12:57 vertexes 阅读(5667) 评论(0) 推荐(0)
 
 

2011年12月25日

Ubuntu 安装Eclipse CDT 开发C、C++
摘要: 一、预备工作1.安装Java开发环境(Eclipse CDT运行必须环境)sudo apt-get install sun-java6-jdksudoapt-get install sun-java6-jre2.安装C++开发环境sudo apt-get install g++3.下载Eclipse CDT进入Eclipse官方主页下载页面http://www.eclipse.org/downloads/找到Eclipse ID for C/C++ Developers:选择Linux 32bit(如果读者安装的是64bit的Ubuntu,请选择后者),进行下载。4.安装Eclipse CDT 阅读全文
posted @ 2011-12-25 13:56 vertexes 阅读(4723) 评论(0) 推荐(0)
 
获取android 刚发出去的短信
摘要: import android.content.Context;import android.database.ContentObserver;import android.database.Cursor;import android.net.Uri;import android.os.Handler;import android.util.Log; public class ObserveSMSSend extends ContentObserver{ private final String SMSSEND_TYPE="smsInfo"; private final St 阅读全文
posted @ 2011-12-25 13:55 vertexes 阅读(892) 评论(0) 推荐(0)
 
获取人人网上的新鲜事
摘要: 第一步:在你的人人网页面上添加 “开发者” 我在人人网上找了半天 没找到。只好输入 http://dev.renren.com.按照上面的提示 一步一步完成,系统生成如下参数:APP ID149931API Key 9226a67eb392494bb251e4a1fc5943bcSecret 35325078d5b6454c91529cbf63378b8a这两个参数 相当重要 。在 文档标签页下面 有个:SDK ,点击打开 ,选择:Java SDK (内含测试代码),下载到一个本地文件夹中。第二步:第三步,在GOOGLE里搜 如下 三个包。commons-codec-1.4.jarcommon 阅读全文
posted @ 2011-12-25 13:53 vertexes 阅读(671) 评论(0) 推荐(0)
 
Android 使用LocationLstenser获取位置信息
摘要: 第一步: 注册一个LocationLstenser:this.locationManager=(LocationManager)this.getSystemService(Context.LOCATION_SERVICE); this.locationProvider=this.locationManager.getProvider(LocationManager.GPS_PROVIDER); if(locationManager!=null) { this.locationManager.requestLocationUpdates(locationProvider.getName(),30 阅读全文
posted @ 2011-12-25 13:50 vertexes 阅读(1163) 评论(0) 推荐(0)
 
UBUNTU tftp 配置
摘要: 1:sudo apt-get install tftp tftpd openbsd-inetd特别指出很多文章里用的是netkit-inetd,但是实际下载时发现这个软件是下不到的,特改用openbsd-inetd,实验效果不错。2:在根目录下创建文件夹 tftpbootcd /sudo mkdirtftpboot 建立文件夹sudo chmod 777tftpboot 更改文件夹权限3: sudo gedit /etc/inetd.conf 修改成如下样子tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd/tftpboot 阅读全文
posted @ 2011-12-25 13:49 vertexes 阅读(5092) 评论(0) 推荐(0)
 
ubuntu nsf 配置
摘要: nfs 安装(1)apt-get install nfs-kernel-serverapt-get install portmap nfs-common(2)编辑/etc/exports/home/jgyang/nfsroot*(rw,sync,no_root_squash)(3)修改挂载点的属性chmod 777 /home/jgyang/rootfs(4)重启nfssudo /etc/init.d/nfs-kernel-server restartsudo /etc/init.d/portmap restart(5)在本机上测试showmount -emount 172.20.149.19 阅读全文
posted @ 2011-12-25 13:47 vertexes 阅读(375) 评论(0) 推荐(0)
 
 
上一页 1 2 3 4 下一页

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3