自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(193)
  • 资源 (1)
  • 收藏
  • 关注

原创 nginx 在linux上的域名解析问题

最近遇到一个问题,通过nginx把URL中的机器名取出进行转发。但是机器名是短域名的话,nginx是无法解析的。查了一下,看来Nginx的域名解析和操作系统是不一样的,nginx有一个resolver字段可以指定DNS服务器,也可以读取系统中的nameserver,但是目前还没找到办法利用系统的search domain,无法给短名后面添加域名。https://serverfault.com/questions/638822/nginx-resolver-address-from-etc-.

2020-05-28 15:37:14 494

原创 记录一个暂时没有答案的race condition问题

今天遇到一个非常奇怪的race condition问题,是一段perl代码,进程互斥使用的是linux的文件锁,操作系统是rhel7.3.这个函数是把一个文件中的一部分key=value改写,步骤是这样的:1. 打开待读文件,上共享锁2. 读文件内容到内存,关文件3. 更改文件内容4. 打开待写文件(和待读文件是一个文件),上排他锁5. 删除文件内容,重新写入更改的文件内容

2017-08-23 00:04:20 644

原创 rc转systemd的问题

今天平了一个坑,手里的项目通过rc来进行一些配置管理,升级到rhel7之后该用systemd,发现系统启动后几乎所有服务进程全部退出,日志发现在systemd的service退出后,所有的进程都受到terminate信号。原因是实用的oneshot类型的systemd service,在配置过程中,有重启服务进程的动作,导致systemd的service接管的这些进程,而systemd主要就是

2017-04-06 20:02:42 549

原创 jvm core

最近遇到一个jvm core(hotspot)的问题,在$HOME目录下生成n多hserr_%pid%.log错误文件,有时候会生成java.core文件。在之前的性能测试和压力测试中均为发现有core file出现,无法手动重现,只有在测试组的自动化测试环境中才能重现。崩溃的原因并非堆或永久代(元数据区)溢出,异常栈也不规定,有的是在JIT编译过程,有的是在创建线程。从表象上看是

2017-04-06 00:47:32 418

原创 malloc到未初始化的内存

在最近开发过程中发现一个malloc到未初始化内存的错误.在使用CLISH(一款命令行开源软件)的时候,每次这个程序退出的时候都会发生core dump,错误为invalid pointer: 0x00007ffff02b35d8 .但是这个错误只在某一台机器上发生错误,在完全相同配置(软硬件)的另外一台机器的时候,并不发生错误,调整clish加载的xml文件的之后,这个错误也会消失....

2016-09-20 09:41:23 3456

原创 java bytes & string conversion

By default, java using utf-8 as string encoding.While convert bytes to string you need to take care of the encoding, if you want to reserve the original bytes, you have to choose the 1-1 encoding, l

2016-07-01 15:06:22 321

转载 知名网站的技术发展历程

http://blog.jobbole.com/20330/

2014-10-09 14:25:00 621

转载 大型网站系统架构的演化

原文出处: 李平的博客   欢迎分享原创到伯乐头条前言一个成熟的大型网站(如淘宝、京东等)的系统架构并不是开始设计就具备完整的高性能、高可用、安全等特性,它总是随着用户量的增加,业务功能的扩展逐渐演变完善的,在这个过程中,开发模式、技术架构、设计思想也发生了很大的变化,就连技术人员也从几个人发展到一个部门甚至一条产品线。所以成熟的系统架构是随业务扩展而完善出来的,并不是一蹴而就;不

2014-10-09 14:24:26 634

转载 数字证书原理

http://blog.jobbole.com/74614/

2014-10-09 14:18:16 704

转载 130+ 条 Vim 常用命令

Vim 是从 vi 发展出来的一个文本编辑器。代码补完、编译及错误跳转等方便编程的功能特别丰富,在程序员中被广泛使用。和 Emacs 并列成为类 Unix 系统用户最喜欢的编辑器。这里收录了130+程序员必备的 vim 命令,帮助你提高开发效率。欢迎在评论中补充你常用到,但这里没有列出来的命令。Basics:e filenameOpen filename for edi

2014-08-28 16:15:43 618

转载 Top 10 Mistakes that Python Programmers Make

http://www.toptal.com/python/top-10-mistakes-that-python-programmers-make

2014-05-13 18:26:56 714

转载 Top 10 Algorithms for Coding Interview

Top 10 Algorithms for Coding InterviewBy X WangUpdate History:Web Version latest update: 4/6/2014PDF Version latest update: 1/16/2014The following are top 10 al

2014-04-15 13:25:36 940

原创 读取jpg文件的exif信息

照片有点多,准备整理一下,按照片拍照的时间进行重新整理,用python写了一个,只读自己感兴趣的exif信息的脚本,看看速度怎么样。以前用.net写过一个,用的现成的exif类库:大约开启1~5个线程来分析所有目标图片文件,读取exif信息,放入一个队列中;大约开启20个左右的线程来进行重命名、拷贝和删除原始文件。这个程序运行起来,速度会越来越慢,一直没找到关键原因

2014-03-14 12:52:42 4524

转载 6 Stages of Linux Boot Process (Startup Sequence)

http://www.thegeekstuff.com/2011/02/linux-boot-process/6 Stages of Linux Boot Process (Startup Sequence)by RAMESH NATARAJAN on FEBRUARY 7, 2011Press the power button on your

2014-03-12 17:09:26 906

转载 Linux Kernel 2.6 Syscall Hooking via the Interrupt Descriptor Table

The symbol of sys_call_table is no longer exported since Linux 2.6.x, we have to HACK ithttp://www.elliotbradbury.com/linux-syscall-hooking-interrupt-descriptor-table/Ever since the system cal

2014-03-03 14:38:45 1381

转载 why GNU grep is fast

http://lists.freebsd.org/pipermail/freebsd-current/2010-August/019310.html编注:这是GNU grep的原作者Mike Haertel 在FreeBSD邮件列表中对 “GNU grep为什么比BSD grep要快” 所做的回答,下面是邮件正文内容:Gabor 您好,我是GNU grep的

2013-12-05 13:12:04 681

转载 Regular Expression Matching with a Trigram Index or How Google Code Search Worked

http://swtch.com/~rsc/regexp/regexp4.htmlRegular Expression Matching with a Trigram Index or How Google Code Search WorkedRuss Cox [email protected] January 2012  Introdu

2013-11-05 10:50:15 1557

转载 Overloading Methods in WCF

http://jeffbarnes.net/blog/post/2006/09/21/overloading-methods-in-wcf.aspxYesterday, I attended a local MSDN event in the Birmingham area.  It covered the .NET 2.0 System.Net namespace, an i

2013-10-30 14:14:53 551

转载 OpenSSL握手协议分析

一、 SSL握手协议(SSL Handshake Protocal)SSL握手协议的作用是在正式的秘密通信之前,让服务器和客户之间互相鉴别对方的身份并协商一种会话的加密算法和加密密钥,主要分为两个方面:1)客户端和服务器之间互相验证身份C/S主要是通过证书来验证对方的合法性。合法性包括:证书是否过期、发行服务器证书的CA是否可靠、发行者证书的公钥能否正确解开服务器证

2013-10-05 16:00:11 1511

转载 Anatomy of a Program in Memory

http://duartes.org/gustavo/blog/post/anatomy-of-a-program-in-memoryMemory management is the heart of operating systems; it is crucial for both programming and system administration. In the n

2013-09-07 00:32:46 842

原创 How to launch application to start->run

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App PathsAdd the path to this reg key path, and you can do it.

2013-08-13 17:18:00 695

转载 How to logon windows automatically

http://support.microsoft.com/kb/315231

2013-08-02 10:14:18 687

原创 How to redirect via http request domain name

I want to redirect guest to user1's blog while he/she access www.user1.com, and redirect guest to user2's blog while he/she accesswww.user2.com$domain = strtolower($_SERVER["HTTP_HOST"]);$USER1_

2013-03-01 17:38:59 620

转载 The easy way to run Powershell 2.0 using .NET Framework 4.0

http://viziblr.com/news/2012/5/16/the-easy-way-to-run-powershell-20-using-net-framework-40.htmlIf you've been exploring creating your own modules and cmdlets with Visual Studio, you've likel

2013-02-28 14:44:41 701

原创 esclipse debug

Remote Debugging with Eclipsehttp://eclipsezone.com/eclipse/forums/t53459.html

2013-01-08 15:29:40 708

原创 使用windbg进行简单的debug c++代码

了解eax, esp, ebp的作用(x86上是exx, x64上是rxx)1. eax -- 数据寄存器,用来存储/读取数据,做累加的操作2. esp 指针寄存器- 堆栈指针,里面寸的都是指针,需要调用dd来查看内容3. ebp 指针寄存器 - 基址寄存器,每段函数进入后都会有如下指令集:00414330 push ebp <-- 存当前函数上层函数的基指针

2012-12-26 23:39:01 2916

转载 How to generate memory dump while application is running.

http://wiki.zimbra.com/wiki/Creating_a_Core_Dump_from_a_Running_Process_using_WinDbgCreating a Core Dump from a Running Process using WinDbgWhen trying to debug a process which

2012-12-21 12:18:14 692

原创 get parameter from dump using windbg

sos.dll:~*e!clrstack -pnative code:kvp(kv -p?)TODO: 可以实现通过windbg命令来查看stack上的每层方法的argument是什么,但是需要了解的是,这些argument到底存在register的什么地方?如何通过r命令来查看?

2012-12-11 17:31:19 614

原创 Regression经验 - patching and full package setup

以前遇到问题解决了就完事了,缺少了总结和记录,我决定以后恢复记录blog的习惯。Original Problem:这次遇到的问题是iis crash的问题。xxx.asmx是我们产品的一个web service,但是我们不想让用户可以发现这个文件的存在,当用户访问这个url的时候,会被直接direct到*.wsdl.我们可以通过web.config+修改一个顶层的HttpH

2012-12-11 17:28:36 637

原创 How to live debug managed code using windbg

For native code, we are easy to live debug and get the local variable, parameter, register fore function returned value.Today I want to introduce how to live debug managed code using windbg.1. .lo

2012-11-30 15:16:05 4332

原创 全排列和组合

最近准备M$面试,练习写了很多基础的code,很多是以前想了想没什么思路就放弃的题,如果面试过了,我会把剩下的陆续的发上来。这个排列组合算法参数有点多,不过是原创的,我觉得这两个算法组合在一起还能产生更多的题目,所以就先放上来,备份一下。没什么测试,只是试了两个组数证明大概思路应该没问题,就过了,时间紧迫啊!全排列void Perm(char str[], int le

2012-11-18 11:48:17 559

原创 Sort using

工作环境的build.exe要求代码的using namespace 必须按字母顺序排列,今天被一直提示编译错误,浪费了我N久来手动排序,崩溃了,就想写一个小东西来排序using。其实以前试过List.Sort(),发现结果并不准确。于是今天晚上抽空自己写了一个,写完了才发现,原来之前一直都忘记trim掉using xxxx;最后面那个分号,所以才导致结果不可靠,郁闷ing。不过写

2012-10-23 22:52:35 522

原创 反射实践(assembly reflection attribute)

一直都大概知道个意思,从来没实践过,今天花了一点时间实践了一下。1. 先从assembly里找type2. 判断type的attribute是否是自己想要的3. 从type里找member4. 判断member的attribute5. 实例化type6. invoke function要被反射的assemblynamespace ConsoleAppli

2012-08-23 00:58:56 726

原创 这算O(n)还是O(logn)?

转换字符串为浮点数namespace ConsoleApplication1{ class TestFaiureException : Exception { public TestFaiureException(string s) : base(s) { } } class MyUtil

2012-08-21 19:27:37 3254

原创 准备搬家了

CSDN的博客功能太差,我把所有技术相关的blog都放在这里,但是它让我太失望了。私有日志功能,没发现打包下载日志,没发现,哥,这个技术社区,能别这么扣么?没事还丢个密码啥的,太烂了,搬家,必须搬家

2012-08-21 16:52:16 912 3

原创 Trouble shooting windows certificate problems.

A simple way to to enable CAPI2 LOG at eventvwr -> applications and services log -> microsoft -> windows -> CAPI2 ->  operational.Such like this, I encounter this problem, obviously it's a certifica

2012-08-20 13:29:41 1911

转载 Uninstall visual studio 2008

While I made a mistake while installing visual studio 2008, it was interrupted. I suppose some of feature/component was not installed correctly, so I decided to re-install it.However, I found there

2012-06-25 10:21:12 726

转载 Getting Started with SVCHOST.EXE Troubleshooting

http://blogs.technet.com/b/askperf/archive/2008/01/11/getting-started-with-svchost-exe-troubleshooting.aspxTroubleshooting issues with the SVCHOST.EXE process can be a very frustrating exp

2012-06-19 11:37:43 560

转载 Why generics in method signatures?

Coming from PHP to C#, this syntax was intimidating:container.RegisterTypeCustomer>("customer1");until I realized it expresses the same thing as:container.RegisterType(typeof(Customer), "cust

2012-06-15 14:44:43 466

原创 ThreadStatic attribute

A static field marked with ThreadStaticAttribute is not shared between threads. Each executing thread has a separate instance of the field, and independently sets and gets values for that field. If

2012-04-12 15:54:41 780

高质量C编程指南--精辟

程序员必看!描述了很多好的代码习惯,相信大部分人都看过了,不过还是上传吧

2009-02-25

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除