IOS Push 证书的重新生成

IOS的推送证书,有有效期限制,一般为一年。当我们证书过期的时候,就需要重新生成证书了。有一段时间没有上苹果网站了,昨天上去一看,此奥,改版了,下边我们将重新生成一个正式环境的push推送的证书。

1。先打开钥匙串(应用程序-实用工具-钥匙串访问),请求一个证书

 

常用名称写为:2013.04.27_push_production_***。并保存到磁盘上。

 

2。进入打开苹果网站的证书标签页面,选择 Identifiers标签下边的App IDs子标签,显示下边图片。红色圈中的是我要重新生成push签名的证书。点击此证书。

 

3。证书详情标签,罗列出了所有的功能状态,最后的Push Notifications显示可以配置,并不是Enabled可以状态,所以点击Setting功能重新上传证书。

 

4。证书设置页面中,最下边的Push Notifications 如下图所示。

 

其中:Development SSL Certificate是测试环境证书,Production SSL Certificate为正式环境证书,我们生成正式环境的证书,点击后面的Create Certificate。

 

5。Create Certificate页面如下。点击下边的continue。

 

6。选择上传的证书,我们第一步已经生成了一个证书,上传此证书。

 

7。上传成功后,将会显示下边的图片。有可能在生成证书的过程中会有loading框一直在转转转,这时候重新进入此页面即可。其实此时证书已经生成了。

 

此时,push证书已经生成,上边会标注过期时间,push的证书有效期为一年。点击Download下载此证书。

 

8。双击刚才下载的证书,会自动把此证书加入到钥匙串的签名中,如下图标示,红色圈中的,既是我刚才添加的证书,展开此证书

 

先右键点击 Apple Production IOS PushServices:com.***.***,先导出一个.p12文件。命名为cert.p12。在导出的过程中会让输入导出密码,输入相应的密码即可。

 

9。在2012.04.27_push_producation_***上点击右键,导出一个.p12的文件,命名为key.p12,与上边相同在导出的过程中会让输入导出密码,输入相应的密码即可。

 

 

10。到此为止,我们已经有了两个.p12文件,把他们放到同一个文件夹(aaa)下,需要把两个.p12文件转换成.pem文件。

a.先打开终端,切换到文件夹aaa下执行

  1. openssl pkcs12 -clcerts -nokeys -out cert.pem -in cert.p12

在执行的时候,将会让输入密码,输入刚才设置的密码即可生成一个cert.pem文件。

 

b.再执行:

  1. openssl pkcs12 -nocerts -out key.pem -in key.p12

 

此时要注意在终端中的提示,第一次输入的密码是生成证书时候的密码,第二次第三次输入密码是设置key.pem的新密码。

 

c.如果需要对 key不进行加密,执行下边语句

openssl rsa -in key.pem -out key.unencrypted.pem

d.然后就可以合并两个.pem文件,这个ck.pem就是服务端需要的证书了。

  1. cat cert.pem key.unencrypted.pem > ck.pem

 

 

此时,把生成的ck.pem给服务器端的人员即可。

C++编译器的预定义宏(Windows版、Linux版)

Intel C++编译器的预定义宏(Windows版、Linux版)

网上有很多介绍VC与GCC预定义宏的帖子,例如《CC++宏大全》。

而对于Intel C++编译器的预定义宏,似乎没人介绍。
我Google了很久,发现Intel官网上有,但是很奇怪,很多链接都失效了,报告404错误。反复调整搜索关键字,一个一个的尝试链接,最后终于找到了有效的页面了。为了怕以后链接失效,赶紧记录下载。

该手册的名字是《Intel® C++ Compiler XE 12.1 User and Reference Guides》,分别有Windows版和Linux版——
Windows:http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/win/index.htm
Linux:http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/lin/index.htm


一、Windows版

1.1 ANSI Standard Predefined Macros(ANSI标准预定义宏)

http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/win/bldaps_cls/common/bldaps_ansi_macros.htm

The ANSI/ISO standard for the C language requires that certain predefined macros be supplied with conforming compilers. The following table lists the macros that the Intel® C++ Compiler supplies in accordance with this standard:

The compiler includes predefined macros in addition to those required by the standard. The default predefined macros differ among Windows*, Linux*, and Mac OS* X operating systems due to the default /Za compiler option on Windows. Differences also exist on Linux OS and Mac OS X as a result of the -std compiler option.

Macro Value
__DATE__ The date of compilation as a string literal in the formMmm dd yyyy.
__FILE__ A string literal representing the name of the file being compiled.
__LINE__ The current line number as a decimal constant.
__STDC__ The name __STDC__ is defined when compiling a C translation unit.
__STDC_HOSTED__ 1
__TIME__ The time of compilation as a string literal in the formhh:mm:ss.


1.2 Additional Predefined Macros(额外的预定义宏)

http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/win/bldaps_cls/cppug_ccw/bldaps_macros_win.htm

The Intel® C++ Compiler supports the predefined macros listed in the table below. The compiler also includes predefined macros specified by the ISO/ANSI standard.

The following table lists the predefined macros on systems based on either the IA-32 or Intel® 64 architecture.

These labels apply:

  • i32 means that the macro is included on systems based on IA-32 architecture.
  • i64em means that the macro is included on systems based on Intel® 64 architecture.

 

Macro Name Value i32 i64em
__cilk 200; however, if /Qcilk-serialize or /Qintel-extensions- is specified, the value is undefined X X
__COUNTER__ 0 X X
__ECL Intel compiler version    
__EDG__ 1 X X
__EDG_VERSION__ EDG version X X
_export no value X X
__ICL Intel compiler version X X
_INC_STDIO no value X X
_INTEGRAL_MAX_BITS 64 X X
__INTEL_COMPILER Intel compiler version X X
__INTEL_COMPILER_BUILD_DATE YYYYMMDD X X
__INTEL_MS_COMPAT_LEVEL 1 X X
__LONG_DOUBLE_SIZE__ 64 X X
_M_AMD64 1   X
_M_IX86 700 X X
_M_IA64 64200   X
_M_X64 1   X
_MSC_EXTENSIONS 1 X X
_MSC_FULL_VER IA-32 architecture only:
13102292
X X
_MSC_VER 1400, 1500, or 1600, depending on the Microsoft Visual Studio* environment (Visual Studio 2005, 2008, or 2010, respectively). X X
_MT 1 X X
_OPENMP 200805 X X
_PGO_INSTRUMENT 1 X X
__QMSPP_ 1 X  
__SIGNED_CHARS__ 1 X X
_SIZE_T_DEFINED no value X X
__STDC_VERSION__ 199409L X X
__w64 no value X X
_WCHAR_T_DEFINED no value X X
_WCTYPE_T_DEFINED no value X X
_WIN32 1 X X
_WIN64 1   X
_VA_LIST_DEFINED no value X X

 


二、Linux版

2.1 ANSI Standard Predefined Macros(ANSI标准预定义宏)

http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/lin/bldaps_cls/common/bldaps_ansi_macros.htm

The ANSI/ISO standard for the C language requires that certain predefined macros be supplied with conforming compilers. The following table lists the macros that the Intel® C++ Compiler supplies in accordance with this standard:

The compiler includes predefined macros in addition to those required by the standard. The default predefined macros differ among Windows*, Linux*, and Mac OS* X operating systems due to the default /Za compiler option on Windows. Differences also exist on Linux OS and Mac OS X as a result of the -std compiler option.

Macro Value
__DATE__ The date of compilation as a string literal in the formMmm dd yyyy.
__FILE__ A string literal representing the name of the file being compiled.
__LINE__ The current line number as a decimal constant.
__STDC__ The name __STDC__ is defined when compiling a C translation unit.
__STDC_HOSTED__ 1
__TIME__ The time of compilation as a string literal in the formhh:mm:ss.


2.2 Additional Predefined Macros(额外的预定义宏)

http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/lin/bldaps_cls/cppug_ccl/bldaps_macros_lin.htm

The Intel® C++ Compiler includes a number of predefined macros. The compiler also includes predefined macros specified by the ISO/ANSI standard.

Predefined Macros on Systems based on IA-32 or Intel® 64 Architectures

The following table lists the predefined macros on systems based on either the IA-32 or Intel® 64 architecture.

Unless otherwise stated, the macros are supported on systems based on IA-32 architecture and also on systems based on Intel® 64 architecture.

Macro (IA-32 and Intel® 64 architecture) Value
__ARRAY_OPERATORS 1
__BASE_FILE__ Name of source file
_BOOL 1
__cilk 200; however, if -cilk-serialize or -no-intel-extensions is specified, the value is undefined.
__cplusplus 1 (with C++ compiler)
__DEPRECATED 1
__EDG__ 1
__EDG_VERSION__ EDG version
__ELF__ 1
__extension__  
__EXCEPTIONS Defined as 1 when -fno-exceptions is not used.
__GNUC__ The major version number of gcc installed on the system.
__GNUG__ The major version number of g++ installed on the system.
__gnu_linux__ 1
__GNUC_MINOR__ The minor version number of gcc or g++ installed on the system.
__GNUC_PATCHLEVEL__ The patch level version number of gcc or g++ installed on the system.
__GXX_ABI_VERSION 102
__HONOR_STD 1
__i386

Available only on systems based on IA-32 architecture.

1
__i386__

Available only on systems based on IA-32 architecture.

1
i386

Available only on systems based on IA-32 architecture.

1
__ICC Intel compiler version
__INTEL_COMPILER Intel compiler version
__INTEL_COMPILER_BUILD_DATE YYYYMMDD
__INTEL_RTTI__ Defined as 1 when -fno-rtti is not specified.
__INTEL_STRICT_ANSI__ Defined as 1 when -strict-ansi is specified.
__linux 1
__linux__ 1
linux 1
__LONG_DOUBLE_SIZE__ 80
__LONG_MAX__

Available only on systems based on Intel® 64 architecture.

9223372036854775807L
__LP64__

Available only on systems based on Intel® 64 architecture.

1
_LP64

Available only on systems based on Intel® 64 architecture.

1
_MT

Available only on systems based on Intel® 64 architecture.

1
__MMX__

Available only on systems based on Intel® 64 architecture.

1
__NO_INLINE__ 1
__NO_MATH_INLINES 1
__NO_STRING_INLINES 1
_OPENMP Defined as 200805 when -openmp is specified.
__OPTIMIZE__ 1
__pentium4 1
__pentium4__ 1
__PIC__ Defined as 1 when -fPIC is specified.
__pic__ Defined as 1 when -fPIC is specified.
_PGO_INSTRUMENT Defined as 1 when -prof-gen[x] is specified.
_PLACEMENT_DELETE 1
__PTRDIFF_TYPE__ int on IA-32 architecture;
long on Intel® 64 architecture
__REGISTER_PREFIX__  
__SIGNED_CHARS__ 1
__SIZE_TYPE__ unsigned on IA-32 architecture
; unsigned long on Intel® 64 architecture
__SSE__ Defined as 1 for processors that support SSE instructions.
__SSE2__ Defined as 1 for processors that support SSE2 instructions.
__SSE3__ Defined as 1 for processors that support SSE3 instructions.
__SSSE3__ Defined as 1 for processors that support SSSE3 instructions.
__unix 1
__unix__ 1
unix 1
__USER_LABEL_PREFIX__  
__VERSION__ Intel version string
__WCHAR_T 1
__WCHAR_TYPE__ long int on IA-32 architecture
; int on Intel® 64 architecture
__WINT_TYPE__ unsigned int
__x86_64

Available only on systems based on Intel® 64 architecture.

1
__x86_64__

Available only on systems based on Intel® 64 architecture.

1

Android系统在超级终端下必会的命令大全(adb shell命令大全)

1. 显示系统中全部Android平台:

android list targets

2. 显示系统中全部AVD(模拟器):

android list avd

3. 创建AVD(模拟器):

android create avd –name 名称 –target 平台编号

4. 启动模拟器:

emulator -avd 名称 -sdcard ~/名称.img (-skin 1280×800)

5. 删除AVD(模拟器):

android delete avd –name 名称

6. 创建SDCard:

mksdcard 1024M ~/名称.img

7. AVD(模拟器)所在位置:

Linux(~/.android/avd) Windows(C:Documents and SettingsAdministrator.androidavd)

8. 启动DDMS:

ddms

9. 显示当前运行的全部模拟器:

adb devices

10. 对某一模拟器执行命令:

abd -s 模拟器编号 命令

11. 安装应用程序:

adb install -r 应用程序.apk

12. 获取模拟器中的文件:

adb pull

13. 向模拟器中写文件:

adb push

14. 进入模拟器的shell模式:

adb shell

15. 启动SDK,文档,实例下载管理器:

android

16. 缷载apk包:

adb shell

cd data/app

rm apk包

exit

adb uninstall apk包的主包名

adb install -r apk包

17. 查看adb命令帮助信息:

adb help

18. 在命令行中查看LOG信息:

adb logcat -s 标签名

19. adb shell后面跟的命令主要来自:

源码systemcoretoolbox目录和源码frameworksbasecmds目录。

20. 删除系统应用:

adb remount (重新挂载系统分区,使系统分区重新可写)。

adb shell

cd system/app

rm *.apk

21. 获取管理员权限:

adb root

22. 启动Activity:

adb shell am start -n 包名/包名+类名(-n 类名,-a action,-d date,-m MIME-TYPE,-c category,-e 扩展数据,等)。

23、发布端口:

你可以设置任意的端口号,做为主机向模拟器或设备的请求端口。如:
adb forward tcp:5555 tcp:8000

24、复制文件:

你可向一个设备或从一个设备中复制文件,
复制一个文件或目录到设备或模拟器上:
adb push
如:adb push test.txt /tmp/test.txt
从设备或模拟器上复制一个文件或目录:
adb pull
如:adb pull /addroid/lib/libwebcore.so .

25、搜索模拟器/设备的实例:

取得当前运行的模拟器/设备的实例的列表及每个实例的状态:
adb devices

26、查看bug报告:
adb bugreport
27、记录无线通讯日志:

一般来说,无线通讯的日志非常多,在运行时没必要去记录,但我们还是可以通过命令,设置记录:
adb shell
logcat -b radio

28、获取设备的ID和序列号:

adb get-product
adb get-serialno

29、访问数据库SQLite3

adb shell
sqlite3

通过计算进行GPS坐标、火星坐标与百度坐标间的转换。不需数据库和联网。

通过计算进行GPS坐标、火星坐标与百度坐标间的转换。
不需数据库和联网。
注:转换算法会定期改变,但周期应该比较长。(目前的使用看来仍然可用)
在网上看到的一个方法,具体是修改自这份代码:
https://on4wp7.codeplex.com/SourceControl/changeset/view/21483#353936

  
// 百度坐标转谷歌坐标

const CGFloat x_pi = 3.14159265358979324 * 3000.0 / 180.0;

+ (void)transformatBDLat:(CGFloat)fBDLat BDLng:(CGFloat)fBDLng toGoogleLat:(CGFloat *)pfGoogleLat googleLng:(CGFloat *)pfGoogleLng
{

    CGFloat x = fBDLng - 0.0065f, y = fBDLat - 0.006f;

    CGFloat z = sqrt(x * x + y * y) - 0.00002f * sin(y * x_pi);

    CGFloat theta = atan2(y, x) - 0.000003f * cos(x * x_pi);

    *pfGoogleLng = z * cos(theta);

    *pfGoogleLat = z * sin(theta);

}

+ (CLLocationCoordinate2D)getGoogleLocFromBaiduLocLat:(CGFloat)fBaiduLat lng:(CGFloat)fBaiduLng

{

    CGFloat fLat;

    CGFloat fLng;

    [[self class] transformatBDLat:fBaiduLat BDLng:fBaiduLng toGoogleLat:&fLat; googleLng:&fLng;];

    CLLocationCoordinate2D objLoc;

    objLoc.latitude = fLat;

    objLoc.longitude = fLng;

    return objLoc;

}

// 谷歌坐标转百度坐标

+ (CLLocationCoordinate2D)getBaiduLocFromGoogleLocLat:(CGFloat)fGoogleLat lng:(CGFloat)fGoogleLng

{

    CLLocationCoordinate2D objLoc;

    CGFloat x = fGoogleLng, y = fGoogleLat;

    CGFloat z = sqrt(x * x + y * y) + 0.00002f * sin(y * x_pi);

    CGFloat theta = atan2(y, x) + 0.000003f * cos(x * x_pi);

    objLoc.longitude = z * cos(theta) + 0.0065;

    objLoc.latitude = z * sin(theta) + 0.006;

    return objLoc;

}

/*******************       === GPS-Google  BEGIN  ===    *******************/

/*               在网上看到的根据这个 c# 代码改的 GPS坐标转火星坐标               */

/*  https://on4wp7.codeplex.com/SourceControl/changeset/view/21483#353936  */

/***************************************************************************/

const double pi = 3.14159265358979324;

//

// Krasovsky 1940

//

// a = 6378245.0, 1/f = 298.3

// b = a * (1 - f)

// ee = (a^2 - b^2) / a^2;

const double a = 6378245.0;

const double ee = 0.00669342162296594323;

bool outOfChina(double lat, double lon);

static double transformLat(double x, double y);

static double transformLon(double x, double y);

// World Geodetic System ==> Mars Geodetic System

CLLocationCoordinate2D transformFromWGSCoord2MarsCoord(CLLocationCoordinate2D wgsCoordinate)

{

    double wgLat = wgsCoordinate.latitude;

    double wgLon = wgsCoordinate.longitude;

    if (outOfChina(wgLat, wgLon))

    {

        return wgsCoordinate;

    }

    double dLat = transformLat(wgLon - 105.0, wgLat - 35.0);

    double dLon = transformLon(wgLon - 105.0, wgLat - 35.0);

    double radLat = wgLat / 180.0 * pi;

    double magic = sin(radLat);

    magic = 1 - ee * magic * magic;

    double sqrtMagic = sqrt(magic);

    dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi);

    dLon = (dLon * 180.0) / (a / sqrtMagic * cos(radLat) * pi);

    CLLocationCoordinate2D marsCoordinate = {wgLat + dLat, wgLon + dLon};

    return marsCoordinate;

}

bool outOfChina(double lat, double lon)
{
    if (lon < 72.004 || lon > 137.8347)
        return true;
    if (lat < 0.8293 || lat > 55.8271)
        return true;
    return false;
}

double transformLat(double x, double y)
{
    double ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * sqrt(abs(x));
    ret += (20.0 * sin(6.0 * x * pi) + 20.0 * sin(2.0 * x * pi)) * 2.0 / 3.0;
    ret += (20.0 * sin(y * pi) + 40.0 * sin(y / 3.0 * pi)) * 2.0 / 3.0;
    ret += (160.0 * sin(y / 12.0 * pi) + 320 * sin(y * pi / 30.0)) * 2.0 / 3.0;
    return ret;
}

double transformLon(double x, double y)
{
    double ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * sqrt(abs(x));
    ret += (20.0 * sin(6.0 * x * pi) + 20.0 * sin(2.0 * x * pi)) * 2.0 / 3.0;
    ret += (20.0 * sin(x * pi) + 40.0 * sin(x / 3.0 * pi)) * 2.0 / 3.0;
    ret += (150.0 * sin(x / 12.0 * pi) + 300.0 * sin(x / 30.0 * pi)) * 2.0 / 3.0;
    return ret;
}
/*******************       === GPS-Google  END  ===    *******************/
// GPS坐标转谷歌坐标
+ (CLLocationCoordinate2D)GPSLocToGoogleLoc:(CLLocationCoordinate2D)objGPSLoc
{
    return transformFromWGSCoord2MarsCoord(objGPSLoc);
}

超强SVN客户端 SmartSVN-7.5.4 for MAC 最新版下载

SmartSVN是一个功能多且易于使用的Subversion 客户端,可运行在Linux、Mac OS X、OS/2、Unix以及Windows。除了标准的SVN指令(例如checkout、update、commit、merge等)之外,其亦提供tag与branch处理(无需要为了转换不同的tag或branch而去处理URL)、内建档案比对与冲突处理器(conflict solver)等。使用者无需安装额外的工具来处理SVN working copies,SmartSVN用起来类似命令列SVN client或档案比对工具。

        版本管理是软件配置管理的基础,它管理并保护开发者的软件资源。它的主要功能有:(1) 集中管理档案,安全授权机制:档案集中地存放在服务器上,经系统管理员授权给各个用户。用户通过check in和check out的方式访问服务器上的文件,未经授权的用户则无法访问服务器上的文件。(2) 软件版本升级管理:每次登入时,在服务器上都会生成新的版本,任何版本都可以随时检出编辑。(3) 加锁功能:在文件更新时保护文件,避免不同的用户更改同一文件时发生冲突。(4) 提供不同版本源程序的比较。

2012年9月企业级Subversion提供者Wandisco公司收购了原SmartSVN公司,现已成为Wandisco公司端到端SVN解决方案的一部分。

<ignore_js_op>home-screenshot.1.png<ignore_js_op>home-screenshot.2.png<ignore_js_op>home-screenshot.3.png<ignore_js_op>home-screenshot.4.png<ignore_js_op>home-screenshot.5.png<ignore_js_op>home-screenshot.6.png

smartsvn-macosx-10_78-7_5_4.tar.gz
http://dl.vmall.com/c0a612sas8

keygen.zip
http://dl.vmall.com/c07jgn7waq