根据ZCChinaLocation 来实现的相关代码,其实就是这个oc代码的java版本,最近用到了这么个东西所以就给实现了一下。由于我是一个非专业Java程序员,因而代码写的比较糟糕,有什么不周到的地方还希望大家积极补充。
从com.alibaba.wxlib.exception.WXRuntimeException: should call prepareTargetKey first 说起
对于安卓的开发,我并没有太多的经验,并且很多的东西目前也没有深入的研究。最近在更新Findu的安卓版本的时候,出现了一个意外的错误。错误代码如下:
03-07 15:03:30.046 12215-12290/today.findu.findu.alibaba.openIMUI:watchdog E/AndroidRuntime: FATAL EXCEPTION: initFeedbackThread
Process: today.findu.findu.alibaba.openIMUI:watchdog, PID: 12215
com.alibaba.wxlib.exception.WXRuntimeException: should call prepareTargetKey first
at com.alibaba.mobileim.utility.AccountInfoTools.initTargetAppKeys(AccountInfoTools.java:190)
at com.alibaba.mobileim.FeedbackAPI.initFeedbackImpl(FeedbackAPI.java:108)
at com.alibaba.mobileim.FeedbackAPI.access$000(FeedbackAPI.java:38)
at com.alibaba.mobileim.FeedbackAPI$1.run(FeedbackAPI.java:97)
at java.lang.Thread.run(Thread.java:761)
并且同时还有大量的其他的错误信息:
03-07 15:03:34.274 12215-12215/today.findu.findu.alibaba.openIMUI:watchdog E/security: [2014@taobao_h5_3.0.0][WLqJSW6PXu8DAOb+xk4MZjLO][] : ***********************************************************
错误编码 = 10010
错误消息 = 发生错误,消息为 null sec code 162, 请使用 LogCat 查看更多细节
解决建议 = 请使用默认的 androiddebugkey 对当前开发应用签名或在应用初始化之前调用 AlibabaSDK.turnOnDebug(), 运行程序查看 logcat 输出以获取更多错误细节,并采取对应操作
错误堆栈 = ErrorCode = 162
com.alibaba.wireless.security.open.SecException
at com.alibaba.wireless.security.open.initialize.c.a(Unknown Source)
at com.alibaba.wireless.security.open.initialize.a.a(Unknown Source)
at com.alibaba.wireless.security.open.initialize.b.b(Unknown Source)
at com.alibaba.wireless.security.open.initialize.b.loadLibrarySync(Unknown Source)
at com.alibaba.wireless.security.open.initialize.b.initialize(Unknown Source)
at com.alibaba.sdk.android.security.impl.h.a(SourceFile:23)
at com.alibaba.sdk.android.security.impl.SecurityGuardWrapper.init(SourceFile:61)
at java.lang.reflect.Method.invoke(Native Method)
at com.alibaba.sdk.android.a.a.a.a(SourceFile:91)
at com.alibaba.sdk.android.task.a.c(SourceFile:186)
at com.alibaba.sdk.android.task.a.a(SourceFile:144)
at com.alibaba.sdk.android.AlibabaSDK.a(SourceFile:135)
at com.alibaba.sdk.android.AlibabaSDK.asyncInit(SourceFile:98)
at cn.org.findu.finduUI.demo.DemoApplication.onCreate(DemoApplication.java:61)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5403)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
cnbeta.com 页面内容屏蔽规则
忽然那个cb就改版了,改的不是一般难看,太分散注意力了。像上面的那样,一坨一坨的。
如果使用的是firefox可以安装uBlock ,添加如下的自定义规则:
! 2017/2/24 上午9:16:43 http://www.cnbeta.com/
www.cnbeta.com##.cnbeta-home-blue-wrapper
hot.cnbeta.com##.cnbeta-home-blue-wrapper
! 2017/2/24 上午9:17:13 http://www.cnbeta.com/articles/tech/587579.htm
www.cnbeta.com##.cnbeta-side-wrapper
hot.cnbeta.com##.cnbeta-side-wrapper
! 2017/2/24 上午9:25:05 http://www.cnbeta.com/articles/tech/587547.htm
www.cnbeta.com###J_latest_info
hot.cnbeta.com###J_latest_info
certbot-auto 阿里云配置安装
在国内的服务器上配置任何的服务都要费一番折腾,首先,国内的服务器连接国外的更新源本身就有问题。效率低还可以忍受,但是直接连不上服务器这个就没什么办法了,只能更换更新源。在《阿里云蛋疼的pip》一文中为了能够正常的使用pip,替换了默认的服务器,修改成了http://mirrors.aliyun.com/pypi/simple/ 这个源,但是也是忧郁这个蛋疼的源出现了各种问题。
在执行
./path/to/certbot-auto renew --quiet --no-self-upgrade
的时候会提示很多错误信息,找不到各种lib。
Had a problem while installing Python packages.
pip prints the following errors:
=====================================================
Collecting argparse==1.4.0 (from -r /tmp/tmp.eLMZJv8t9Y/letsencrypt-auto-requirements.txt (line 11))
Downloading http://mirrors.aliyun.com/pypi/packages/f2/94/3af39d34be01a24a6e65433d19e107099374224905f1e0cc6bbe1fd22a2f/argparse-1.4.0-py2.py3-none-any.whl
Collecting pycparser==2.14 (from -r /tmp/tmp.eLMZJv8t9Y/letsencrypt-auto-requirements.txt (line 17))
Downloading http://mirrors.aliyun.com/pypi/packages/6d/31/666614af3db0acf377876d48688c5d334b6e493b96d21aa7d332169bee50/pycparser-2.14.tar.gz (223kB)
Collecting cffi==1.4.2 (from -r /tmp/tmp.eLMZJv8t9Y/letsencrypt-auto-requirements.txt (line 21))
Downloading http://mirrors.aliyun.com/pypi/packages/92/00/c8670a2898ab7121cdac3b59f4307977a86e08a59efd662f6c05200a2f11/cffi-1.4.2.tar.gz (365kB)
Collecting ConfigArgParse==0.10.0 (from -r /tmp/tmp.eLMZJv8t9Y/letsencrypt-auto-requirements.txt (line 38))
Downloading http://mirrors.aliyun.com/pypi/packages/d0/b8/8f7689980caa66fc02671f5837dc761e4c7a47c6ca31b3e38b304cbc3e73/ConfigArgParse-0.10.0.tar.gz
Collecting configobj==5.0.6 (from -r /tmp/tmp.eLMZJv8t9Y/letsencrypt-auto-requirements.txt (line 40))
Downloading http://mirrors.aliyun.com/pypi/packages/64/61/079eb60459c44929e684fa7d9e2fdca403f67d64dd9dbac27296be2e0fab/configobj-5.0.6.tar.gz
Collecting cryptography==1.5.3 (from -r /tmp/tmp.eLMZJv8t9Y/letsencrypt-auto-requirements.txt (line 42))
Downloading http://mirrors.aliyun.com/pypi/packages/6c/c5/7fc1f8384443abd2d71631ead026eb59863a58cad0149b94b89f08c8002f/cryptography-1.5.3.tar.gz (400kB)
Collecting enum34==1.1.2 (from -r /tmp/tmp.eLMZJv8t9Y/letsencrypt-auto-requirements.txt (line 65))
Downloading http://mirrors.aliyun.com/pypi/packages/6f/e9/08fd439384b7e3d613e75a6c8236b8e64d90c47d23413493b38d4229a9a5/enum34-1.1.2.tar.gz (46kB)
Collecting funcsigs==0.4 (from -r /tmp/tmp.eLMZJv8t9Y/letsencrypt-auto-requirements.txt (line 68))
Downloading http://mirrors.aliyun.com/pypi/packages/5e/9f/025d4c92c6a1a94313cdf0813cd76f5700f8e5434fa15165090a6446ae22/funcsigs-0.4-py2.py3-none-any.whl
Collecting idna==2.0 (from -r /tmp/tmp.eLMZJv8t9Y/letsencrypt-auto-requirements.txt (line 71))
Downloading http://mirrors.aliyun.com/pypi/packages/7c/75/b566d769455929ee6ab308d8a1c6c5aecc4928e72b25d42dd019c99f7015/idna-2.0-py2.py3-none-any.whl (61kB)
Collecting ipaddress==1.0.16 (from -r /tmp/tmp.eLMZJv8t9Y/letsencrypt-auto-requirements.txt (line 74))
Downloading http://mirrors.aliyun.com/pypi/packages/23/6a/813ac29a01e4c33c19c2bded98ac3d4266ebbf0bd2c0eb0020e1c969958d/ipaddress-1.0.16-py27-none-any.whl
Collecting linecache2==1.0.0 (from -r /tmp/tmp.eLMZJv8t9Y/letsencrypt-auto-requirements.txt (line 77))
Downloading http://mirrors.aliyun.com/pypi/packages/c7/a3/c5da2a44c85bfbb6eebcfc1dde24933f8704441b98fdde6528f4831757a6/linecache2-1.0.0-py2.py3-none-any.whl
Collecting ordereddict==1.1 (from -r /tmp/tmp.eLMZJv8t9Y/letsencrypt-auto-requirements.txt (line 80))
Downloading http://mirrors.aliyun.com/pypi/packages/53/25/ef88e8e45db141faa9598fbf7ad0062df8f50f881a36ed6a0073e1572126/ordereddict-1.1.tar.gz
Collecting parsedatetime==2.1 (from -r /tmp/tmp.eLMZJv8t9Y/letsencrypt-auto-requirements.txt (line 82))
Downloading http://mirrors.aliyun.com/pypi/packages/85/1f/13fc06097e516f6259d62cea502b116451321c96e18a9d0fff9da3442e02/parsedatetime-2.1-py2-none-any.whl
Collecting pbr==1.8.1 (from -r /tmp/tmp.eLMZJv8t9Y/letsencrypt-auto-requirements.txt (line 85))
Theos dpkg-deb: error: obsolete compression type ‘lzma’; use xz instead
好久没有弄ios越狱开发的东西了,今天升级完theos 编译工具的时候提示下面的错误信息:
dpkg-deb: error: obsolete compression type 'lzma'; use xz instead
Type dpkg-deb --help for help about manipulating *.deb files;
Type dpkg --help for help about installing and deinstalling packages.
make: *** [internal-package] Error 2
MachOView 2.4 obaby’s branch
支持新命令:
#define LC_VERSION_MIN_TVOS 0x2F // add by obaby
#define LC_VERSION_MIN_WATCHOS 0x30
猛击后面的链接下载!链接: https://pan.baidu.com/s/1bHOd1k 密码: 7smt
阿里云蛋疼的pip
阿里云的主机确实蛋疼,连pip都更新不了也是醉了。参考这个帖子的办法,修改更新服务器吧:
mkdir ~/.pip
cat > ~/.pip/pip.conf < < EOF
[global]
trusted-host=mirrors.aliyun.com
index-url=http://mirrors.aliyun.com/pypi/simple/
EOF
Apache2 Django {“detail”:”Authentication credentials were not provided.”}
其实项目已经是很久之前就完成了,部署到服务器上去之后后续的工作由于懒散一致没做,近几天开始进行重新继续项目之后发现一个很蛋疼的问题,在iOS端提交数据的时候提示:
{“detail”:”Authentication credentials were not provided.”},搜索之后发现原来是mod_wsgi转发数据的时候将authorization header 去掉了,所以会导致认证失败。可以参考链接:
修复也很简单,修改/etc/apache2/apache2.conf文件添加如下一行即可:
WSGIPassAuthorization On