上一页 1 2 3 4 5 6 7 8 9 10 ··· 16 下一页
  2012年10月7日
摘要: 修改MSDN上的示例,使之可以通过RSA证书文件加密和解密,中间遇到一个小问题。Q:执行ExportParameters()方法时,回报CryptographicException:该项不适于在指定状态下使用(Key not valid for use in specified state)。A:导入带有私钥的证书时,需要使用"X509KeyStorageFlags"参数标记"私钥可导出"。X509Certificate2 prvcrt = new X509Certificate2(@"X:\path\to\CA.pfx", &quo 阅读全文
posted @ 2012-10-07 11:47 eshizhan 阅读(10416) 评论(2) 推荐(1) 编辑
摘要: 1.证书格式PEM 格式PEM格式通常用于数字证书认证机构(Certificate Authorities,CA),扩展名为.pem, .crt, .cer, and .key。内容为Base64编码的ASCII码文件,有类似"-----BEGIN CERTIFICATE-----" 和 "-----END CERTIFICATE-----"的头尾标记。服务器认证证书,中级认证证书和私钥都可以储存为PEM格式(认证证书其实就是公钥)。Apache和类似的服务器使用PEM格式证书。DER 格式DER格式与PEM不同之处在于其使用二进制而不是Base64编码 阅读全文
posted @ 2012-10-07 11:47 eshizhan 阅读(15565) 评论(2) 推荐(1) 编辑
  2012年10月5日
摘要: 数学,永远是那么神奇!1.质数是其中一个永久的话题,今天在stackoverflow上又看到一奇贴,分享之。是关于Python生成质数的,有兴趣研究的,请做好长时间Google的准备。http://stackoverflow.com/questions/2068372/fastest-way-to-list-all-primes-below-n-in-python2.RSA算法也离不开质数,而且是大质数,其实Linux下的openssl可以通过命令行验证和生成大质数。$ openssl prime 1313 is prime$ openssl prime -generate -bits 102 阅读全文
posted @ 2012-10-05 23:08 eshizhan 阅读(534) 评论(0) 推荐(0) 编辑
  2012年10月3日
摘要: 只是介绍我在ArchLinux折腾中文字体及主题的心得,仅供参考。主要参考Arch Wiki,有几点注意下:1.英文字体一般会使用ttf-dejavu,中文字体使用wqy-microhei(yaourt),但个人感觉ttf-dejavu没有wqy-microhei看上去舒服,因此没有安装ttf-dejavu,于是出现了一些问题,midori中monospace字体会显示不完整,应该是没有识别mono字体的缘故。解决办法:编辑/etc/fonts/conf.avail/65-wqy-microhei.confView Code <?xml version="1.0"?& 阅读全文
posted @ 2012-10-03 12:17 eshizhan 阅读(19638) 评论(0) 推荐(0) 编辑
  2012年9月29日
摘要: 当离开INSERT模式时,Preview窗口会自动关闭vimrc:" If you prefer the Omni-Completion tip window to close when a selection is" made, these lines close it on movement in insert mode or when leaving" insert modeautocmd CursorMovedI * if pumvisible() == 0|pclose|endifautocmd InsertLeave * if pumvisible() 阅读全文
posted @ 2012-09-29 14:46 eshizhan 阅读(1962) 评论(0) 推荐(0) 编辑
  2012年9月27日
摘要: python-qt4-doc/examples problemQ:"ImportError: No module named qtdemo_rc" when running pyqt demo.A:pyrcc4 -o qtdemo_rc.py qtdemo.qrcTips:#!/usr/bin/env python2# -*- coding: utf-8 -*-import osimport sysif len(sys.argv) > 1: pth = sys.argv[1]else: pth = '.'for root, dirs, files in 阅读全文
posted @ 2012-09-27 17:42 eshizhan 阅读(580) 评论(0) 推荐(0) 编辑
  2012年9月23日
摘要: sudo /etc/init.d/postgresql stopdu -sh /var/lib/postgresql/8.4/main/pg_xlog/985M /var/lib/postgresql/8.4/main/pg_xlog//usr/lib/postgresql/8.4/bin/pg_controldata /var/lib/postgresql/8.4/main/...Latest checkpoint's NextXID: 1/2718420992Latest checkpoint's NextOID: 496696...sudo -... 阅读全文
posted @ 2012-09-23 22:52 eshizhan 阅读(3853) 评论(0) 推荐(0) 编辑
摘要: 最近测试中发现虚拟机的网络性能遇到了瓶颈,于是想一探究竟,发现自己一直忽略了这块儿知识,于是做个笔记。1.VirtualBoxeshizhan比较常用的是VirtualBox,以下简称Vbox,先从它入手:网络适配器查看官方文档发现,Vbox中可以模拟五种网络适配器,AMD PCNet PCI II (Am79C970A);AMD PCNet FAST III (Am79C973, 默认);Intel PRO/1000 MT Desktop (82540EM);Intel PRO/1000 T Server (82543GC);Intel PRO/1000 MT Server (82545EM 阅读全文
posted @ 2012-09-23 22:22 eshizhan 阅读(10188) 评论(0) 推荐(3) 编辑
  2012年9月19日
摘要: 在Winform中ListView的TopItem属性可以把某项设置设为ListView中最上面的第一项,但这个属性有问题,赋值后不一定该项不一定位于第一条,本质上Windows API没有提供类似的功能,可能是通过设置Scroll Value来封装的,问题比较好解决,进行重复赋值,直到达到正确的位置。public void SetScrollPosition(int pos){ pos = Math.Min(Items.Count - 1, pos); if (pos < 0 || pos >= Items.Count) return; EnsureVisible(pos); . 阅读全文
posted @ 2012-09-19 00:13 eshizhan 阅读(1950) 评论(0) 推荐(0) 编辑
  2012年9月15日
摘要: 从VirualBox 4.2 Beta1 到 VirualBox 4.2 RC4,这时VirualBox最长的一次版本进化,伴随着N多改进,这包括对OS X ML和Win8适配,网络带宽控制,虚拟机分组,剪贴板共享和Drag'n'drop拖拽等期待已久的功能,尤其是Drag'n'drop拖拽,该功能早在六年前[via],社区就有人提出了,但一直没能实现,其实核心代码早已支持(vbox 是 based on QEMU的),只是Addition需要做些处理。另外,这个版本界面也变得更加美观和实用了。Good Job !Changelog: VirtualBox 4. 阅读全文
posted @ 2012-09-15 15:22 eshizhan 阅读(487) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 16 下一页