证书透明

Submitted by lepton on Wed, 10/19/2016 - 17:08

Tags

证书透明就是让证书机构们公开他们所发布的每一张证书。

虽然这个机制不能防止CA颁发假的证书,但是它能够使得伪造证书的检测更加方便。目前,Google,赛门铁克、DigiCert等CA都在参与维护公共证书透明日志

你可以使用GoogleComodo的证书透明查询工具查询你的域名下所有的证书。

https://crt.sh/?q=leptonstar.com

diskutil

Submitted by lepton on Fri, 10/14/2016 - 15:13

Tags

diskutil list

gpt

hdiutil

hdiutil burn -erase //fast erase

hdiutil burn -fullerase 

hdiutil burn iso

hdiutil burn iso -device 

 

hdiutil burn -list // list device

objective c keyworkd

Submitted by lepton on Mon, 10/10/2016 - 16:29

Tags

@class
@defs
@protocol @required @optional @end
@interface @public @package @protected @private @property @end
@implementation @synthesize @dynamic @end
@throw @try @catch @finally
@synchronized @autoreleasepool
@selector @encode
@compatibility_alias
@”string”

c++ build flag cause the stl function symbol different

Submitted by lepton on Tue, 05/24/2016 - 12:43

Tags

export CXXFLAGS="-std=c++11 -stdlib=libc++"
export LDFLAGS="-stdlib=libc++"

 

link to libc++ or libstdc++

the stl function symbol in object file are different in mac with xcode 7

when use std::vector as a argument

the argument symbol is St6vectorIiSaIi linking to libstdc++

the other is St3__16vectorIiNS6_9allocatorIi

this will cause linking errors

How to resolve duplicate symbol link static library

Submitted by lepton on Fri, 05/20/2016 - 11:35

Tags

首先从静态库中解压 .o 文件

ar -x lib.a

nm查看符号表  找到重复的函数符号名

nm a.o

c和c++的符号表不一样

0000000000000000 T __Z4testv //c++

0000000000000000 T test //c

 

隐藏符号 相当于加 static

ld -r a.o -unexported_symbol  __Z4testv -o c.o; rm a.o; mv c.o a.o //mac 下可使用

objcopy --localize-symbol=_Z4testv a.o
 

修改符号名称

ld -r a.o -alias __Z4testv test_c  -unexported_symbol  __Z4testv -o c.o //mac 下可使用

objcopy --redefine-sym _Z4testv=test_a a.o

如果其他 .o文件引用了这个函数 对每一个文件都要执行