不可思议的错觉-向上滚动的球

No Comments

牛人搞的视频组合

No Comments

重装OS的一些笔记

No Comments

windows 7 系统下安装Windows 7

http://www.21andy.com/blog/20090827/1349.html
1、下载 Windows 7 ISO镜像,用虚拟光驱拷贝至非C盘(如d:\win7)
2、开机按F8 – 修复系统 – 选择最后一项命令修复 – 在命令框输入 d:\win7\sources\setup.exe,开始安装
3、进入安装界面、选择custom安装
4、选择安装语言、格式化C盘
5、OK了,装好后是一个纯系统(非双系统)。

Windows 7下硬盘安装Ubuntu 10.04

http://www.linuxidc.com/Linux/2010-05/25875.htm

、在Windows7中下载并安装EasyBCD_1.7.2

2、将 Ubuntu-10.04-desktop-i386.iso文件复制到C盘根目录,用压缩软件打开,再打开casper目录,把initrd.lz、 vmlinuz二个文件解压到C盘根目录下。

3、运行EasyBCD_1.7.2进入操作窗口后,
点Add/Remove Entries
再点右下边的NeoGrub
再点Install NeoGrub
再点Save
选中NeoGrub Bootloader,再点Configure

4、在出现menu.lst记事本窗口中输入以下内容并保存:
root
kernel /vmlinuz iso-scan/filename=/Ubuntu-10.04-desktop-i386.iso boot=casper splash
initrd /initrd.lz
boot

5、电脑重启后,就会发现启动菜单会多了一项NeoGrub Bootloader,选择后会进入Ubuntu 10.04光盘系统。按快捷键运行(Alt+F2),在运行框内输入:
sudo umount -l /isodevice

最后点桌面上的Ubuntu安装图标及可开始正常安装
安装成功后,重启电脑会直接进入Ubuntu 10.04,打开终端输入以下命令:
sudo update-grub
再次重启及可出现Windows7引导菜单

Recover Grub 2 via LiveCD

https://wiki.ubuntu.com/Grub2#Recover%20Grub%202%20via%20LiveCD

  • First, grab a copy of the latest Ubuntu LiveCD and boot it.
  • Open a terminal and type

$ sudo fdisk -l

  • Now, you need to remember which device listed is your linux distribution, for reference, /dev/sda1 will be used. Now we need to mount the filesystem to /mnt

$ sudo mount /dev/sda1 /mnt

  • If you have /boot on a separate partition, that need’s to be mounted aswell. For reference, /dev/sda2 will be used.

$ sudo mount /dev/sda2 /mnt/boot Make sure you don’t mix these up, pay attention to the output of FDISK

  • Now mount the rest of your devices and some other things needed in the chroot

$ sudo mount --bind /dev /mnt/dev
$ sudo mount --bind /proc /mnt/proc
$ sudo mount --bind /sys /mnt/sys

  • Now chroot into your system

$ sudo chroot /mnt

You should be chroot’d into your system as root, you can now run commands as root, without the need for sudo.

  • Now you need to edit the /etc/default/grub file to fit your system

$ nano /etc/default/grub

  • When that is done you need to run update-grub to create the configuration file. If you have a separate /boot partition you need to mount it first!

$ update-grub

  • To install GRUB 2 to the MBR, next you need to run grub-install /dev/sda

$ grub-install /dev/sda

  • If you encounter any errors, try grub-install –recheck /dev/sda

$ grub-install --recheck /dev/sda

  • Press Ctrl+D to exit out of the chroot.
  • Once you exit back to your regular console, undo all the mounting, first the /dev and others

$ sudo umount /mnt/dev
$ sudo umount /mnt/sys
$ sudo umount /mnt/proc

  • Now you can unmount the root system. (But if you have a separate boot partition which you mounted earlier, you have to unmount this first, or you will get a “device busy” error message.)

$ sudo umount /mnt

  • And you should be free to restart your system right into GRUB 2 and then into your system installation.

If you had alternate OS entries, update-grub might say “Cannot find list of partitions!”. Ignore it and continue – once you can boot into your linux installation, do so and then rerun update-grub and grub-install /dev/sda as root.

WinInet, WinHttp, Winsock, ws2_32的基本解释

No Comments

http://www.hackpig.cn/post/500.html

在Windows平台进行网络程序开发, 可以使用不同的库, 但是最常用的还是微软自己开发的库。具体说来,有:

(1)Winsock,工作于网络层和传输层的开发库,对于编写TCP,UDP,以及原始IP通信程序非常合适。函数原形也基本符合Unix socket标准。Windows平台上的大多数程序,如QQ,讯雷等都基于其开发。

(2)ws2_32,是Winsock的升级版本,在兼容的基础上增加了不符合Unix socket标准,但更适合Windows平台的库函数,一般以WSA*开头。

现代的大多数Windows平台程序也都开始依赖于此库。

(3)WinInet,Windows Internet扩展库,工作于应用协议层,提供了http,ftp,gopher协议的实现,为基于以上三种协议的程序开发提供基础平台,需要说明的是,尽管WinInet工作于应用层,但其本身wininet.dll的实现并不依赖于winsock.dll或ws2_32.dll,而是独立存在的。至少目前的版本是这样。基于WinInet的应用程序最著名的例子就是IE了。

(4)WinHttp,也是工作于应用协议层,提供了http协议的实现。看起来与WinInet有重复的部分,没错,WinHttp就是为了替换WinInet中的http部分的,它更加健壮稳定,而且还为http服务器端开发提供了库函数。如果进行现代http的开发,建议使用WinHTTP而不是WinInet。使用WinHTTP进行开发的著名例子就是Google的浏览器Chrome,但是Chrome2.0以后版本google放弃了winhttp而是使用了自己开发的http库,这也是为了使chrome实现跨平台的重要举措。另外,WinHttp.dll也不依赖于winsock或ws2_32,也是独立运行的。

如果基于socket编程的话,Winows平台与其它平台函数基本相同,实现跨平台比较容易。

如果基于http进行编程的话,不同平台库差别很大,如果不考虑跨平台使用WinHttp,如果考虑跨平台可以考虑使用libwww。

另外,wsock和wininet或winhttp也可以同时使用。

猫步是怎么练成的 。瞧人家走的那猫步,多纯粹

No Comments

Older Entries