jfo planet

Hope is the best gift that tomorrow gives.

  • 首页
  • 分类
  • 归档
  • 标签
  • 搜索
close

利用VirtualBox附带工具创建tun/tap设备

发表于 2008-11-29   |   分类于 Network
工具介绍:1.VBoxTunctl、VBoxAddIF、VBoxDeleteIF版本VirtualBox-2.0.6jfo@lab:~$ VBoxTunctl -hCreate: VBoxTunctl [-b] [-u owner] [-g group] [-t device-name] [-f tun-clone-device]Delete: VBoxTunctl -d device-name [-f tun-clone-device]The default tun clone device is /dev/net/tun - some systems use/dev/misc/net/tun instead-b will result in brief output (just the device name)2.tuntun设备相当于一块虚拟网卡3.bridgeTCP/IP协议栈link layer将一台Linux主机配置成bridgejfo@lab:~$ sudo brctl addbr br0jfo@lab:~$ sudo ifconfig eth0 0.0.0.0jfo@ ...
阅读全文 »

Squid配置

发表于 2008-11-26   |   分类于 Linux App
http://wiki.ubuntu.org.cn/Squid%E9%85%8D%E7%BD%AE%E8%AF%A6%E8%A7%A3example configurehttp_port 8080cache_log /var/log/squid/cache.logaccess_log /var/log/squid/access.log squid#cache_dir null /tmpcache_dir aufs /var/cache/squid 64 16 256#cache_mem 32 MBcache_swap_low 90 cache_swap_high 95 visible_hostname jfo.proxy.labauth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/password auth_param basic children 5auth_param basic realm Squid proxy-caching web serverauth_param basic credentialsttl ...
阅读全文 »

【zz】Linux内核socket分析 & IPV4 TCP追踪

发表于 2008-11-23   |   分类于 Linux
转自 http://blog.chinaunix.net/u2/64681/index.html linux/unix的socket从实践到内核分析部分 ·1–socket的实践到内核--socket实践练习·2-socket的实践到内核--socket使用IP地址通讯·3-socket的实践到内核--追踪socket到内核·4-socket的实践到内核--追踪socket的创建 ·5-socket的实践到内核--追踪Unix的socket·6-socket的实践到内核--Unix中socket的地址绑定·7-socket的实践到内核--socket的监听·8-socket的实践到内核--接受socket的连接·9-socket的实践到内核--client调用connect·10-socket的实践到内核--UDP的socket数据的接收·11-socket的实践到内核--UDP的socket数据的发送·12-socket的实践到内核--TCP的socket数据的接收·13-socket的实践到内核--TCP的socket数据的发送·14-socket的实践到内核--socket的关闭 ...
阅读全文 »

著名的 fork 炸弹

发表于 2008-11-22   |   分类于 Linux App
:(){ :|:& };:著名的 fork 炸弹,此命令将告诉你的系统执行海量的进程,直到你的系统僵死。:(){    :|: &};:
阅读全文 »

Linux kernel - fault-injection

发表于 2008-11-12   |   分类于 Linux
linux-2.6.26.6/Documentation/fault-injection/fault-injection.txtFault injection capabilities infrastructure===========================================See also drivers/md/faulty.c and "every_nth" module option for scsi_debug.Available fault injection capabilities————————————–o failslab injects slab allocation failures. (kmalloc(), kmem_cache_alloc(), …)o fail_page_alloc injects page allocation failures. (alloc_pages(), get_free_pages(), …)o fail_make_request injects disk IO errors o ...
阅读全文 »

新版本内核/proc/pid/pagemap

发表于 2008-11-09   |   分类于 Linux
http://www.lupaworld.com/?uid-26540-action-viewspace-itemid-118022Documentation/vm/pagemap.txtpagemap, from the userspace perspective—————————————pagemap is a new (as of 2.6.25) set of interfaces in the kernel that allowuserspace programs to examine the page tables and related information byreading files in /proc.There are three components to pagemap: /proc/pid/pagemap. This file lets a userspace process find out which   physical frame each virtual page is mapped to. It contains o ...
阅读全文 »

【zz】Linux内核与用户进程通信——NETLINK实例

发表于 2008-11-08   |   分类于 Linux
http://blog.csdn.net/absurd/archive/2008/11/07/3244482.aspx手 机内置FLASH容量有限,在磁盘空间不足的情况下,应该提醒用户进行磁盘清理。这个处理在哪里做比较好呢?每次写入数据时由调用者检测显然是不合理的, 因为处理的太多了,何况修改SQLITE等第三方程序也是不明智的,那样会给升级版本带来麻烦。比较好的办法是在文件系统中做处理,最近同事修改了 yaffs2支持磁盘满通知功能。做法如下:在yaffs_fs.c中:#include <net/sock.h>#include <linux/netlink.h>#define DISK_FULL_MSG_SIZE 128#define NETLINK_DISK_FULL 2static struct sock yaffs_sock;在init_yaffs_fs中: if((yaffs_sock = netlink_kernel_create(NETLINK_DISK_FULL, 1, NULL, THIS_MODULE)) == NULL) { ...
阅读全文 »

【zz】论“小白兔”怎样吃掉了狼和野猪

发表于 2008-11-08   |   分类于 Saying
http://blog.sina.com.cn/s/blog_4940b3f60100b14k.html 一天,一只兔子在山洞前写文章,一只狼走了过来, 问:兔子啊,你在干什么? 答曰:写文章。 问:什么题目?” 答曰:《浅谈兔子是怎样吃掉狼的》。 狼哈哈大笑,表示不信,于是兔子把狼领进山洞…… 过了一会,兔子独自走出山洞,继续写文章。 一只野猪走了过来, 问:兔子你在写什么? 答:文章。 问:题目是什么? 答:《浅谈兔子是如何把野猪吃掉的》。 野猪不信,于是同样的事情发生。 最后,在山洞里,一只狮子在一堆白骨之间,满意的剔着牙读着兔子交给它的文章,题目:《一只动物,能力大小关键要看你的老板是谁》。 这只兔子有次不小心告诉了他的一个兔子朋友,这消息逐渐在森林中传播;狮子知道后非常生气,他告诉兔子:“如果这个星期没有食物进洞,我就吃你。” 于是兔子继续在洞口写文章。 一只小鹿走过来, “兔子,你在干什么啊?”“ 写文章 ” ...
阅读全文 »

【zz】小故事

发表于 2008-11-08   |   分类于 Saying
http://hi.baidu.com/xzhms/blog/item/ab0696430784731172f05d01.html三、且慢下手       大多数的同仁都很兴奋,因为单位里调来一位新主管,据说是个能人,专门被派来整顿业务;可是日子一天天过去,新主管却毫无作为,每天彬彬有礼进 办公室,便躲在里面难得出门,那些本来紧张得要死的坏份子,现在反而更猖獗了。他那里是个能人嘛!根本是个老好人,比以前的主管更容易唬!      四 个月过去,就在真正努力为新主管感到失望时,新主管却发威了——坏份子一律开除,能人则获得晋升。下手之快,断事之准,与四个月表现保守的他,简直像是全 然换个人。年终聚餐时,新主管在酒过三巡之后致词:「相信大家对我新到任期间的表现,和后来的大刀阔斧,一定感到不解,现在听我说个故事,各位就明白了: 「我有位朋友,买了栋带着大院的房子,他一搬进去,就将那院子全面整顿,杂草树一律清除,改种自己新买的花卉,某日原先的屋主往访,进门大吃 ...
阅读全文 »

【zz】Linux2.6内核epoll介绍

发表于 2008-11-05   |   分类于 Linux
http://blog.csdn.net/rstevens/archive/2007/10/30/1858067.aspxhttp://hi.baidu.com/jmlover/blog/item/24c28b131e6b48d7f7039ee6.htmlhttp://hi.baidu.com/jmlover/blog/item/e64df724f12926348744f91b.html名词解释:man epoll之后,得到如下结果: NAME epoll - I/O event notification facility SYNOPSIS #include <sys/epoll.h> DEscrīptION epoll is a variant of poll(2) that can be used either as Edge or Level Triggered interface and scales well to large numbers of watched fds. Three system calls are provided to set up an ...
阅读全文 »
1…313233…61
jfo

jfo

605 日志
38 分类
4 标签
RSS
GitHub 微博
友情链接
  • 收藏夹
  • 网络剪贴板
  • 爱逛吧
© 2007 - 2018 jfo
由 Hexo 强力驱动
主题 - NexT.Pisces